LaTeX.js icon indicating copy to clipboard operation
LaTeX.js copied to clipboard

\label and \ref do not accept argument with underscore

Open hgustafsson opened this issue 6 years ago • 1 comments
trafficstars

Get a parsing failure if \ref or \label has an underscore in the argument.

Minimal example (tested on current LaTeX.js Live Playground as well as a local copy of version 0.12.0):

\documentclass{article}

\begin{document}
\section{Introduction}
\label{test_label}
\end{document}

Gives error

ERROR: Parsing failure:

line 5 (column 7): Introduction}\n\\label{test_label}\n\\end{do
-----------------------------------------^
macro \label: group argument expected

Similar error for \ref.

hgustafsson avatar Sep 10 '19 17:09 hgustafsson

Hmm... very true! It looks like LaTeX is accepting pretty much anything but in LaTeX.js, I am using a normal TeX group. I will have to add a new argument type, like raw or something. I'll think about it.

michael-brade avatar Sep 11 '19 21:09 michael-brade