cvfosammmm / Setzer

LaTeX editor written in Python with Gtk
https://www.cvfosammmm.org/setzer/
Other
394 stars 37 forks source link

Bug: Latex commands in section/chapter titles cause the section/chapter to disappear from document structure navigator #307

Closed evamvid closed 10 months ago

evamvid commented 1 year ago

I use the ac package for abbreviations, and if I use it to make titles for sections or chapters it fails to parse. This also applies if you have any italic text in a chapter/section/subsection title.

I might try to work on this myself if I get time, but I thought I'd put it up if anybody else wants to. I think the way to go is probably just to put everything between the outermost pair of curly braces in the structure navigator, including any Latex macros.

This would be a good first issue for anyone who knows their way around regex a little bit!

edit: another way to phrase this is that the regex should match everything between the outer set of curly braces, ignoring any nested curly braces, but I'm way over my head in terms of regex knowledge to be able to implement that.

cvfosammmm commented 1 year ago

Can you post an example of a failing title?

evamvid commented 1 year ago

try:

\section{The Cultural Relevance of Melville's \textit{Moby-Dick}}

basically anything that contains an opening { won't be matched by the regex

cvfosammmm commented 10 months ago

Thanks for reporting this. Closing in favour of https://github.com/cvfosammmm/Setzer/issues/389 , because that has more info. Feel free to participate in the discussion there.