Closed ivanistheone closed 1 year ago
This is done outside of math mode as well, generally to get a space after a macro. This is causing the same problems there.
Here's another example of where space gets munged: Notice the space after \toprule
TexSoup(r'''
\begin{document}
\begin{tabular}{ll}
\toprule
{\(a\)} & \\
\bottomrule
\end{tabular}%
\end{document}
''')
\begin{document}
\begin{tabular}{ll}
\toprule{\(a\)} & \\
\bottomrule \bot
\end{tabular}%
\end{document}
People often use
\
(called control space) to insert a little extra space in math mode—to avoid the default behaviour of ignoring math spaces.In TexSoup these get eaten up somehow, so when serialize back out, the tex is different:
Failing test case:
expected:
$a \ = \ \sin\theta$
observed:
$a \=\\sin\theta$
Here are the tokens in case that's helpful:
See https://tex.stackexchange.com/a/74354 for a complete list of all special LaTeX spacing commands inside and outide of math mode.
No urgency to fix this --- perhaps it is even a feature, since prevents users from trying to override default LaTeX spacing behaviour :)