\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
方程式编号?
答案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}