如何在 LaTeX 中创建覆盖周期数的“典型弧或帽子”?

如何在 LaTeX 中创建覆盖周期数的“典型弧或帽子”?

你好!有人知道如何在 LaTeX 中创建覆盖周期数字/循环小数或循环小数的“典型弧线或帽子”吗?谢谢!

答案1

编辑:我不知道https://tex.stackexchange.com/a/451459/128553当我发表第一篇帖子时。以下是其他解决方案。

我仍然认为上划线表示法是最好的,原因如下:

  • 它或多或少在国际上享有盛誉,
  • 占用较少的水平空间,
  • 有些解决方案过于粗体,不适合字体,而且吸引了太多的注意力,
  • 如果数字太长,那么弧就不会覆盖所有数字,或者太大,或者“太平坦”而无法轻易与旋转的括号区分开来。

为了进行比较:https://en.wikipedia.org/wiki/Repeating_decimal


方案A:过去wideArcAnchorAz:您可以随意调整和的坐标wideArcAnchorB来得到符合您口味的形状。

\documentclass{article}

\usepackage{amsmath,tikz}
\usetikzlibrary{calc,topaths}

\newcommand\wideparen[1]{%
\tikz[baseline=(wideArcAnchor.base)]{
    \node[inner sep=0] (wideArcAnchor) {$#1$}; 
    \coordinate (wideArcAnchorA) at ($0.9*(wideArcAnchor.north west) + 0.1*(wideArcAnchor.north east)+(0.0em,0.75ex)$);
    \coordinate (wideArcAnchorB) at ($0.1*(wideArcAnchor.north west) + 0.9*(wideArcAnchor.north east)+(0.0em,0.75ex)$);
%   
    \draw[line width=0.1ex,line cap=round] 
        ($(wideArcAnchor.north west)+(0.0em,0.1ex)$) 
            .. controls (wideArcAnchorA) and (wideArcAnchorB) ..
        ($(wideArcAnchor.north east)+(0.0em,0.1ex)$)        
    ;
}}
\newcommand\widearc[1]{%
\tikz[baseline=(wideArcAnchor.base)]{
    \node[inner sep=0] (wideArcAnchor) {$#1$}; 
    \coordinate (wideArcAnchorA) at ($(wideArcAnchor.north west) + (0.1em,0.0ex)$);
    \coordinate (wideArcAnchorB) at ($(wideArcAnchor.north east) + (-0.1em,0.0ex)$);
%
    \draw[line width=0.1ex,line cap=round,out=45,in=135] (wideArcAnchorA) to (wideArcAnchorB);
}}

\begin{document}
\centering{}Test foo bar. 
\begin{align*}
    \zeta
        &=0.00\overline{1}\\
        &=0.00\widehat{1}\\
        &=0.00\wideparen{1}\\
        &=0.00\widearc{1}\\
        &\neq0.00\overline{12}\\
        &=0.00\widehat{12}\\
        &=0.00\wideparen{12}\\
        &=0.00\widearc{12}\\
        &\neq0.00\overline{1234567890}\\
        &=0.00\widehat{1234567890}\\
        &=0.00\wideparen{1234567890}\\
        &=0.00\widearc{1234567890}.
\end{align*}
\end{document}

在此处输入图片描述


方案 B:取自https://ctan.org/pkg/comprehensive

\documentclass{article}

\usepackage{amsmath}

\makeatletter
%Taken from https://ctan.org/pkg/comprehensive
\def\downparenthfill{$\m@th\braceld\leaders\vrule\hfill\bracerd$}
\def\wideparen#1{\mathop{\vbox{\ialign{##\crcr\noalign{\kern3\p@}
         \downparenthfill\crcr\noalign{\kern3\p@\nointerlineskip}
         $\hfil\displaystyle{#1}\hfil$\crcr}}}\limits}
\makeatother

\begin{document}
\centering{}Test foo bar. 
\begin{align*}
    \zeta
        &=0.00\overline{12}\\
        &=0.00\widehat{12}\\
        &=0.00\wideparen{12}\\
        &\neq0.00\overline{1234567890}\\
        &=0.00\widehat{1234567890}\\
        &=0.00\wideparen{1234567890}.\\
\end{align*}

\end{document}

在此处输入图片描述


变体C:

\documentclass{article}

\usepackage{amsmath}
\usepackage{mathabx}\begin{document}
\centering{}Test foo bar. 
\begin{align*}
    \zeta
        &=0.00\overline{12}\\
        &=0.00\widehat{12}\\
        &=0.00\wideparen{12}\\
        &\neq0.00\overline{1234567890}\\
        &=0.00\widehat{1234567890}\\
        &=0.00\wideparen{1234567890}.\\
\end{align*}
\end{document}

在此处输入图片描述


变体 D:使用 Utopia 可能会限制您的使用:

\documentclass{article}

\usepackage{amsmath,fourier}
\begin{document}
\centering{}Test foo bar. 
\begin{align*}
    \zeta
        &=0.00\overline{12}\\
        &=0.00\widehat{12}\\
        &=0.00\widearc{12}\\
        &\neq0.00\overline{1234567890}\\
        &=0.00\widehat{1234567890}\\
        &=0.00\widearc{1234567890}.\\
\end{align*}
\end{document}

在此处输入图片描述


方案E:arcs软件包应该提供更好的解决方案,但似乎有问题。http://tug.org/pipermail/xetex/2013-August/024674.html在我的系统上适用于 LuaLaTeX 和 XeLaTeX。

答案2

如果要保留默认字体,可以\wideparen从以下位置获取yhmath

\documentclass{article}

\usepackage{amsmath, yhmath}

\begin{document}

    \[ \frac{12}{35} = 0.3\wideparen{428\,571}\]%

\end{document} 

在此处输入图片描述

相关内容