文本模式下,数字零内带点

文本模式下,数字零内带点
\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}

在此处输入图片描述

如何添加\pmzerodot方程式编号?

相关:在不支持 OpenType 的 LaTeX 中插入斜线零

答案1

下面的示例定义了\dotarabic,它类似于\arabic打印计数器的阿拉伯形式,其中用 交换了零\pmzerodot\theequation被重新定义为使用\dotarabic而不是\arabic (或者\arabic,如果所有计数器输出都应使用带点的零,则可以重新定义)。

此外,由于受/系统约束\pmzerodot,因此变得更加强大。脆弱的命令将在内部定义期间中断。\the<counter>\label\ref\@currentlabel

完整示例:

\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}

结果

相关内容