如何在 Mathjax 中围绕文本编写圆圈

How to code circles around text in Mathjax

下图来自 Chiswell and Hodges Mathematical Logic 第 21 页的练习:

当我 post 在 Mathematics Stack Exchange 上回答时,我想显示类似的内容,但我不知道如何在 Mathjax 中用数字制作圆圈,也不知道如何在字母中使用正斜杠.我想我可以处理带有 "\frac" 的分数以及它的其余部分。

我从其他 post 中寻找示例进行复制,但人们似乎将圆圈替换为括号作为替代方法。

有人能告诉我应该如何或使用什么软件来获得这种效果吗?

有许多可能的方法可以围绕一个圈子。这是三个:

  1. 使用带有 circle 符号的 enclose 扩展名:

    \require{enclose}
    {\scriptstyle \enclose{circle}{\kern .06em 1\kern .06em}}
    

    在首次使用 \enclose 之前,您只需在页面上包含一次 \require{enclose}\kern 命令是使圆变成圆形而不是椭圆形,因为圆的尺寸比宽度高。

  2. 使用 \rlap 将 1 置于 \bigcirc 之上:

    {scriptstyle \rlap{\kern .18em 1}\raise.04em{\bigcirc}}}
    

    我们也稍微抬高了大圆圈,以便更好地放置。

  3. 使用\unicode{}命令获取U+2460字符,即"circled digit one":

    {\textstyle\unicode{x2460}}
    

您可以使用 cancel 包来获取 \cancel,它会在其参数上产生一条斜向上的斜杠,并使用上标将圆圈 1 放在适当的位置:

{scriptstyle\cancel{\psi}^{\raise.2em{\enclose{circle}{\kern .06em 1\kern .06em}}}}

将这一切与你的分数放在一起,你可以做类似下面可怕的黑客的事情:

\require{enclose}\require{cancel}
\frac{
  \lower.3em{\scriptstyle\cancel{\psi}\raise.6em{\enclose{circle}{\kern .06em 1\kern .06em}}}
  \kern 2.6em
  \frac{(\psi\wedge\phi)}{\phi}
  {\scriptstyle (\wedge\rm E)}
  \kern -2.5em
}{
  \kern -.7em
  {\scriptstyle\enclose{circle}{\kern .06em 1\kern .06em}}
  \frac{(\psi\wedge\phi)}{(\psi\rightarrow(\psi\wedge\phi))}
  {\scriptstyle(\rightarrow\rm I)}
  \kern -1.7em
}\ {\scriptstyle (\wedge\rm I).}

这包括大量的手动间距调整,以使分数线的长度正确。对其中很多人这样做会很痛苦。

结果如下: