如何创建虚线等号?

如何创建虚线等号?

如何创建如下虚线等号?

在此处输入图片描述

另外,请确保

  • 受到\not同样的影响=
  • 并且其他方面与= 作用相同。

顺便说一句, 中不一定非要有三个间隙=

答案1

这是使用包的另一种解决方案trimclip。它适用于所有尺寸(大、超大等)以及scriptstylescriptscriptstyle

在此处输入图片描述

我们不是将白色覆盖在=标志上,而是剪裁=标志的部分并用空白替换。我选择了=代码中指示为.25\weq(左四分之一)的标志的左、中和右 1/4,后跟八分之一空格(.125\weq),后跟中间四分之一(.375\weq.625\weq),等等。您可以根据需要调整间距,或进一步细分=

更新

这里有两个附加版本,其中剪辑仅影响其中一条线。不是在各段之间插入空格,而是=插入剪辑符号。当底部被剪辑(\eqeqeqb)时,基线会发生变化,因此\raisebox需要使用命令。

在此处输入图片描述

\documentclass{article}

\usepackage{trimclip}

\newlength{\weq}
\newlength{\heq}

\makeatletter
\newcommand{\eqeqeq}{\mathrel{\mathpalette\eq@eq\relax}}
\newcommand{\eq@eq}[2]{\settowidth{\weq}{$\m@th#1=$}%
    \clipbox*{0pt 0pt {.25\weq} \height}{$\m@th#1=$}%
    \hspace{.125\weq}%
    \clipbox*{{.375\weq} 0pt {.625\weq} \height}{$\m@th#1=$}%
    \hspace{.125\weq}%
    \clipbox*{{.75\weq} 0pt {\weq} \height}{$\m@th#1=$}%
}
\newcommand{\eqeqeqt}{\mathrel{\mathpalette\eq@eqt\relax}}
\newcommand{\eq@eqt}[2]{\settowidth{\weq}{$\m@th#1=$}%
    \clipbox*{0pt 0pt {.25\weq} \height}{$\m@th#1=$}%
    \clipbox*{{.25\weq} 0pt {.375\weq} {.5\height}}{$\m@th#1=$}%
    \clipbox*{{.375\weq} 0pt {.625\weq} \height}{$\m@th#1=$}%
    \clipbox*{{.625\weq} 0pt {.75\weq} {.5\height}}{$\m@th#1=$}%
    \clipbox*{{.75\weq} 0pt {\weq} \height}{$\m@th#1=$}%
}
\newcommand{\eqeqeqb}{\mathrel{\mathpalette\eq@eqb\relax}}
\newcommand{\eq@eqb}[2]{\settowidth{\weq}{$\m@th#1=$}\settoheight{\heq}{$\m@th#1=$}%
    \clipbox*{0pt 0pt {.25\weq} \height}{$\m@th#1=$}%
    \raisebox{.5\heq}{\clipbox*{{.25\weq} {.5\height} {.375\weq} {\height}}{$\m@th#1=$}}%
    \clipbox*{{.375\weq} 0pt {.625\weq} \height}{$\m@th#1=$}%
    \raisebox{.5\heq}{\clipbox*{{.625\weq} {.5\height} {.75\weq} {\height}}{$\m@th#1=$}}%
    \clipbox*{{.75\weq} 0pt {\weq} \height}{$\m@th#1=$}%
}
\makeatother

\begin{document}

$A=B_{a=b_{x=y}}$

$A\eqeqeq B_{a\eqeqeq b_{x\eqeqeq y}}$

$A\eqeqeqt B_{a\eqeqeqt b_{x\eqeqeqt y}}$

$A\eqeqeqb B_{a\eqeqeqb b_{x\eqeqeqb y}}$

$A\ne B_{a\ne b_{x\ne y}}$

$A\not\eqeqeq B_{a\not\eqeqeq b_{x\not\eqeqeq y}}$

$A\not\eqeqeqt B_{a\not\eqeqeqt b_{x\not\eqeqeqt y}}$

$A\not\eqeqeqb B_{a\not\eqeqeqb b_{x\not\eqeqeqb y}}$

\end{document}

答案2

您可以使用以下技术制作自己的符号这个帖子。这是使用 的版本,\ooalign将两个白色规则叠加在=符号上以制作虚线图案。您可以通过更改和 中的参数来调整间隙的间距和厚度\hspace\rule请注意,如果您的页面颜色不是白色,则必须更改规则的颜色。

在此处输入图片描述

\documentclass{article}

\usepackage{color} %for \textcolor

\newcommand{\eqeqeq}{\mathrel{\ooalign{=\cr\hfil\textcolor{white}{\rule[.28ex]{.1em}{.6ex}\hspace{.2em}\rule[.28ex]{.1em}{.6ex}}\hfil\cr}}}

\begin{document}

$A\eqeqeq B$

$A\not\eqeqeq B$

$A=B$

$A\ne B$

\end{document}

\scriptstyle如果您需要或中的符号\scriptscriptstyle,则可以使用\mathchoice

\newcommand{\eqeqeq}{\mathrel{
   \mathchoice
     {\ooalign{=\cr\hfil\textcolor{white}{\rule[.28ex]{.1em}{.6ex}\hspace{.2em}\rule[.28ex]{.1em}{.6ex}}\hfil\cr}}
     {\ooalign{=\cr\hfil\textcolor{white}{\rule[.28ex]{.1em}{.6ex}\hspace{.2em}\rule[.28ex]{.1em}{.6ex}}\hfil\cr}}
     {\ooalign{$\scriptstyle{=}$\cr\hfil\textcolor{white}{\rule[.17ex]{.08em}{.47ex}\hspace{.18em}\rule[.17ex]{.08em}{.47ex}}\hfil\cr}}
     {\ooalign{$\scriptscriptstyle{=}$\cr\hfil\textcolor{white}{\rule[.1ex]{.06em}{.38ex}\hspace{.17em}\rule[.1ex]{.06em}{.38ex}}\hfil\cr}}
}}

在此处输入图片描述

再次,您可以根据需要调整间隙的间距和厚度。

相关内容