[Tex/LaTex] Digit zero with a dot inside also in text mode

empheqequationsnumbering

\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{empheq}

\makeatletter
\newcommand*{\pmzerodot}{%
\nfss@text{%
\sbox0{$\vcenter{}$}% math axis
\sbox2{0}%
\sbox4{0\/}%
\ooalign{%
  0\cr
  \hidewidth
  \kern\dimexpr\wd4-\wd2\relax % compensate for slanted fonts
  \raise\dimexpr(\ht2-\dp2)/2-\ht0\relax\hbox{%
    \if b\expandafter\@car\f@series\@nil\relax
      \mathversion{bold}%
    \fi
    $\cdot\m@th$%
  }%
  \hidewidth
  \cr
  \vphantom{0}% correct depth of final symbol
}%
}%
}
\makeatother

\begin{document}
\begin{empheq}{align}
0 + 1 = 1
\end{empheq}
\end{document}

enter image description here

How to add \pmzerodot in equation number?

Related to: Inserting slashed zero in non-OpenType supporting LaTeX

Best Answer

The following example defines \dotarabic, which similar to \arabic prints the arabic form of a counter with the zeros exchanged by \pmzerodot. \theequation is redefined to use \dotarabic instead of \arabic (or \arabic can be redefined, if the zero with dot should be used by all counter outputs).

Furthermore \pmzerodot is made robust, because \the<counter> are subject to the \label/\ref system. Fragile commands will break during the definition of the internal \@currentlabel.

Full example:

\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{empheq}

\makeatletter
\DeclareRobustCommand*{\pmzerodot}{%
  \nfss@text{%
    \sbox0{$\vcenter{}$}% math axis
    \sbox2{0}%
    \sbox4{0\/}%
    \ooalign{%
      0\cr
      \hidewidth
      \kern\dimexpr\wd4-\wd2\relax % compensate for slanted fonts
      \raise\dimexpr(\ht2-\dp2)/2-\ht0\relax\hbox{%
        \if b\expandafter\@car\f@series\@nil\relax
          \mathversion{bold}%
        \fi
        $\cdot\m@th$%
      }%
      \hidewidth
      \cr
      \vphantom{0}% correct depth of final symbol
    }%
  }%
}

\newcommand*{\dotarabic}[1]{%
  \expandafter\@dotarabic\csname c@#1\endcsname
}
\newcommand*{\@dotarabic}[1]{%
  \expandafter\dotarabic@scan\number #1\relax
}
\newcommand*{\dotarabic@scan}[1]{%
  \ifx\relax#1%
    \expandafter\@gobble
  \else
    \expandafter\@firstofone
  \fi
  {%
    \ifnum#1=0 %
      \ifincsname
        0%
      \else
        \pmzerodot
      \fi
    \else
      #1%
    \fi
    \dotarabic@scan
  }%
}
\makeatother

\renewcommand*{\theequation}{\dotarabic{equation}}

\begin{document}
  \addtocounter{equation}{9}
  \begin{empheq}{align}
    \label{eq:test}
    \pmzerodot + 1 = 1
  \end{empheq}
\end{document}

Result