我从该网站的一篇文章中复制了以下命令。
\newcommand{\parallelsum}{\mathbin{\!/\mkern-5mu/\!}}
我在其他代码中使用过它,它很好地排版了平行线符号。为什么它没有在这个代码中编译?(我尝试在最后一句中使用它。我%
在它前面放了一个,这样代码就可以编译了。)
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings,decorations.pathreplacing,backgrounds,patterns}
\usepackage{graphicx,tipa}% http://ctan.org/pkg/{graphicx,tipa}
%This command typesets an arc symbol over letters.
\newcommand{\arc}[1]{%
\setbox9=\hbox{#1}%
\ooalign{\resizebox{\wd9}{\height}{\texttoptiebar{\phantom{A}}}\cr#1}}
%This command has LaTeX typeset the symbol for parallel lines.
\newcommand{\parallelsum}{\mathbin{\!/\mkern-5mu/\!}}
\begin{document}
\noindent {\textbf{Proposition}} \vskip1.25mm
{\em $\overline{AB}$ and $\overline{CD}$ are chords in a circle that do not intersect. They are parallel if, and only if, $\arc{AC} = \arc{BD}$.}
\vskip0.2in
\noindent {\textbf{Demonstration}} \vskip1.25mm
\noindent $\overline{AB}$ and $\overline{CD}$ are chords in a circle centered at $O$. $\arc{AC} = \arc{BD}$ if, and only if, ${\mathrm{m}}\angle{AOC} = {\mathrm{m}}\angle{BOD}$.
\begin{equation*}
{\mathrm{m}}\angle{ABC} = \frac{1}{2} \, {\mathrm{m}}\angle{AOC}
\qquad \text{and} \qquad
{\mathrm{m}}\angle{BCD} = \frac{1}{2} \, {\mathrm{m}}\angle{BOD} .
\end{equation*}
So, ${\mathrm{m}}\angle{AOC} = {\mathrm{m}}\angle{BOD}$ if, and only if, ${\mathrm{m}}\angle{ABC} = {\mathrm{m}}\angle{BCD}$. $\angle{ABC}$ and $\angle{BCD}$ are alternate interior angles. ${\mathrm{m}}\angle{ABC} = {\mathrm{m}}\angle{BCD}$ if, and only if,
%$\overline{AB} \parallelsum \overline{CD}$.
\end{document}
答案1
如果使用tipa
该safe
选项加载,命令
\: \; \! \* \|
不会被重新定义。如果没有它,你仍然有一些别名可用,tipa.sty
因为
\let\tipamedspace\:
\let\tipathickspace\;
\let\tipanegthinspace\!
\let\tipasterisktmp\*
\let\tipapipetmp\|
所以你可以
\newcommand{\parallelsum}{%
\mathbin{\tipanegthinspace/\mkern-5mu/\tipanegthinspace}%
}
另一方面,你可以通过修复错误的方法获得两全其美的效果tipa
:
\documentclass{amsart}
\usepackage{tipa}
\UndeclareTextCommand{\!}{T3}
\DeclareTextCommand{\tipaEXCLAM}{T3}{}
\DeclareTextAccentDefault{\tipaEXCLAM}{T3}
\DeclareTextComposite{\tipaEXCLAM}{T3}{G}{201}
\DeclareTextComposite{\tipaEXCLAM}{T3}{b}{225}
\DeclareTextComposite{\tipaEXCLAM}{T3}{d}{226}
\DeclareTextComposite{\tipaEXCLAM}{T3}{g}{228}
\DeclareTextComposite{\tipaEXCLAM}{T3}{j}{234}
\DeclareTextComposite{\tipaEXCLAM}{T3}{o}{242}
\DeclareRobustCommand{\!}{%
\ifmmode\mskip-\thinmuskip\else\expandafter\tipaEXCLAM\fi
}
\newcommand{\parallelsum}{\mathbin{\!/\mkern-5mu/\!}}
\begin{document}
\textipa{\!G \!b \!d \!g \!j \!o}
$AB \parallelsum CD$
\end{document}
答案2
tipa
似乎重新定义\!
为负数学空间之外的东西:
\DeclareTextCommand{\!}{T3}[1]{#1}
所以它让你的定义变得模糊。你可以写
\mskip -\thinmuskip
而不是两个\!
s(这是 的原始定义\!
),但正如芭芭拉 (Barbara) 指出的那样,它们不应该产生任何影响。
答案3
这是由于与加载交互引起的tipa
。
使用\mathbin{<stuff>}
强制在 周围留出特定量的空间<stuff>
,因此包含 之类的间距调整实际上毫无意义\!
。相反,类似于您已经使用\mkern
进行调整的操作外部如果需要的话\mathbin
。
\documentclass{amsart}
\usepackage{tipa}
%This command has LaTeX typeset the symbol for parallel lines.
%\newcommand{\parallelsum}{\mathbin{\!/\mkern-5mu/\!}}
\newcommand{\parallelsum}{\mathbin{/\mkern-5mu/}}
\begin{document}
$AB \parallelsum CD$
\end{document}