alvinwan / TexSoup

fault-tolerant Python3 package for searching, navigating, and modifying LaTeX documents
https://texsoup.alvinwan.com
BSD 2-Clause "Simplified" License
290 stars 43 forks source link

$ in specific TeX contexts causes problems #125

Open mdeeg opened 4 years ago

mdeeg commented 4 years ago

When parsing URLs containing a $ using the verbatim command \url from the url package TexSoup terminates with an EOFError.

Minimal example:

from TexSoup import TexSoup
soup = TexSoup(r"\url{https://test.lab/test?var=test$}")

Is there an easy way to tell TexSoup how to handle such TeX code or simply ignore specific commands completely?

alvinwan commented 4 years ago

@mdeeg Oh huh, I didn't realize specific commands could be treated as verbatim.

There isn't a way to tell TexSoup to ignore commands ... yet -- I can followup here when that's added.

lmm-git commented 2 years ago

I think I just hit the "same" issue with the following tex input:

\begin{subblock}
  \begin{lstlisting}
    $
  \end{lstlisting}
\end{subblock}

(resulting in an EOF error as well)