mangecoeur / document-outline

Atom plugin for showing interactive document outlines
GNU General Public License v3.0
37 stars 20 forks source link

Issue with math in LaTeX section title #56

Open dpo opened 6 years ago

dpo commented 6 years ago

In a LaTeX document, I have section titles with math in them. Those aren't rendered correctly in the outline (I'm not sure what they should be rendered as). For instance, in the snippet

  \section{\(x_{\star}\)}

  \section{Next Section}

the title of the first section is just "\star" in the outline. As an experiment, I tried to further enclose the math in curly braces:

\section{{\(x_{\star}\)}}

and what happened is that the next section disappeared from the outline.

mangecoeur commented 6 years ago

Probably a limitation in the Latex parser. Unfortunately, Latex is so complicated I there's only so much I can do to work with every case (especially since I use Mardown myself). You are very welcome to try to improve the Regex matching (e.g. try having a look in the latex-parse file at the regexes there, and use a tool like regex101.com to try to make them work with math in headings.)