텍스트 모드에서도 내부에 점이 있는 숫자 0

텍스트 모드에서도 내부에 점이 있는 숫자 0
\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방정식 번호를 추가하는 방법은 무엇입니까 ?

와 연관되다:LaTeX를 지원하는 비OpenType에 슬래시 0 삽입

답변1

다음 예에서는 에 의해 교환된 0으로 카운터의 아랍어 형식을 인쇄하는 것과 \dotarabic유사한 를 정의합니다 . 대신 사용하도록 재정의됩니다 (또는 점이 있는 0을 모든 카운터 출력에서 ​​사용해야 하는 경우 재정의할 수 있습니다).\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}

결과

관련 정보