SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2k stars 362 forks source link

Log parsing: Fumbles `Undefined control sequence.` errors inside `align` environments. #1548

Open Jollywatt opened 2 years ago

Jollywatt commented 2 years ago

Consider the snippet:

\begin{align}
    hello this is an \error and stuff
    goes on...
\end{align}

This generates the log

! Undefined control sequence.
<argument> ...ds {align}} hello this is an \error 
                                                  and stuff goes on... 
l.71 \end{align}

which is unhelpfully shown as

<path>: Undefined control sequence. [\end{align}]

in the build window.

For most other environments, e.g.,

\begin{math}
    hello this is an \error and stuff
    goes on...
\end{math}

which generate a log similar to

! Undefined control sequence.
l.69 ^^Ihello this is an \error
                                and stuff
? 

the error is correctly identified by LaTeXTools:

<path>: Undefined control sequence. [^^Ihello this is an \error]

It seems as though the l.69 token can’t always be used to signify the problematic line — instead, the newline and indentation shows the undefined control sequence.


Using LaTeXTools v3.15.1. Not sure what other information is @needed.

Program      Location                       Status     Version
-------      --------                       ------     -------
latexmk      /Library/TeX/texbin/latexmk    available  Latexmk, John Collins, 20 November 2021. Version 4.76
pdflatex     /Library/TeX/texbin/pdflatex   available  pdfTeX 3.141592653-2.6-1.40.23 (TeX Live 2022/dev)
xelatex      /Library/TeX/texbin/xelatex    available  XeTeX 3.141592653-2.6-0.999993 (TeX Live 2021)
lualatex     /Library/TeX/texbin/lualatex   available  This is LuaHBTeX, Version 1.13.2 (TeX Live 2021)

Full log