6

I copied the following command from a post on this web site.

\newcommand{\parallelsum}{\mathbin{\!/\mkern-5mu/\!}}

I have used it in other code and it has typeset the symbol for parallel lines nicely. Why is it not compiled in this code? (I try to use it in the last sentence. I put a % in front of it so that the code will compile.)

\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}
3
  • am i correct that you want a "slanted parallel"? the \! that begins and ends the expansion of your definition is a backspace, which is meaningless (never mind invalid) at the beginning of a \mathbin object. so if you just remove those two !s, there will be no complaints, but i'm not sure whether the result is what you want. Oct 9, 2015 at 18:37
  • @barbara beeton Yes, the command should typeset two slanted, parallel lines.
    – user74973
    Oct 9, 2015 at 18:40
  • that symbol is defined in unicode as U+2AFD so it should be in the stix / xits fonts, possible with the command name \sslant. Oct 9, 2015 at 18:44

3 Answers 3

6

If you load tipa with the safe option, the commands

\: \; \! \* \|

will not be redefined. Without it, you still have some aliases available, because tipa.sty does

\let\tipamedspace\:
\let\tipathickspace\;
\let\tipanegthinspace\!
\let\tipasterisktmp\*
\let\tipapipetmp\|

so you can do

\newcommand{\parallelsum}{%
  \mathbin{\tipanegthinspace/\mkern-5mu/\tipanegthinspace}%
}

On the other hand, you can get the best of both worlds by fixing the wrong approach made by 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}

enter image description here

1

tipa seems to redefine \! into something other than a negative mathspace:

 \DeclareTextCommand{\!}{T3}[1]{#1}

so it trips up your definition. You could write

\mskip -\thinmuskip

instead of your two \!s (that is the original definition of \!), but as Barbara points out, they shouldn't have any effect.

4
  • Yes, that is what Werner has said. Can I just include a command \hspace{-2pt} or something like that in the \newcommand? What is the "length" of \!?
    – user74973
    Oct 9, 2015 at 18:49
  • @user74973: you can literally write \mskip -\thinmuskip instead of \!, thinmuskip is the length you're looking for. Oct 9, 2015 at 18:50
  • Are you saying that \newcommand{\parallelsum}{\mathbin{\mskip -\thinmuskip\mkern-5mu\mskip -\thinmuskip}} gives the same pair of slanted lines as what I had if tipa was not in the preamble?
    – user74973
    Oct 9, 2015 at 18:55
  • @egreg Why did you remove your post?
    – user74973
    Oct 10, 2015 at 18:55
1

This is caused by an interaction with loading tipa.

Using \mathbin{<stuff>} forces a specific amount of space around <stuff>, so it really doesn't make sense to include spacing adjustments like \!. Instead, and similar to what you're already doing using \mkern for adjustments outside of \mathbin, if needed at all.

enter image description here

\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}
3
  • Would the \! in the \newcommand have been ignored by LaTeX if tipa had not been in the preamble? Your \newcommand{\parallelsum} has too much extra space between AB and the slanted parallel lines and between the slanted parallel lines and CD.
    – user74973
    Oct 9, 2015 at 18:45
  • @user74973: Yes. You might as well use \newcommand{\parallelsum}{/\mkern-5mu/} only.
    – Werner
    Oct 9, 2015 at 18:54
  • OK. What does the / before and after \mkern-5mu do?
    – user74973
    Oct 9, 2015 at 18:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .