The editor that I use, Texmaker, provides code folding only for things in the language, like \section
and \begin{foo} ... \end{foo}
. I would like to be able to make my own folding sections, like in Visual C++ where I can write #pragma region foo ... #pragma endregion
. Specifically, the first thing that I want to hide in any code is the includes at the beginning, in the case of LaTeX, the \usepackage{}
commands. I had the idea of making a custom environment:
\newenvironment{folding}{}{}
\begin{folding}
\usepackage{geometry}
\end{folding}
However, this won't build. Can anybody explain why? Is there a way to define an environment such that this would work?
\documentclass
line.\usepackage
s then possibly you use too many packages, i.e., multiple mentions of the same package, packages that you don't actually use in the document, packages that are redundant because they are already loaded by higher-level packages, etc. Cleaning that up may make compiling faster and help with code readability without the need for code folding.