How to fold blocks of text in latex file?


#1

Is there a way to fold blocks of text in latex file?

E.g., in a markdown file, we can fold the text at several levels of the outline by default or at the header level using markdown folder package.

Similarly, is there a way to fold texts in latex files, say under sections and subsections? This is very much required if you are writing a lengthy paper.


#2

I haven’t found a package that does LaTeX folding, but it shouldn’t be hard to emulate the behavior of markdown-folder with different regexes. That could be a package itself, or a pull request for latextools or latex-plus.


#5

I just need to fold environments, and this works fine out of the box, I think. custom-folds package could do the same, but won’t work for sections.

(I wrapped the section etc. commands in an environment anyway, because I restructure my text often and I’m too lazy to rename the commands every time)

Meta

Sorry for creating multiple posts but I think I don’t have edit rights right now.