Structuring a document using comments

In Texstudio you can use

% your comment here
%BEGIN_FOLD

whatever text

%END_FOLD

in order to fold a certain range of text.

To mark special comments in colour, a feature normally used for todo comments can be abused. If you add some phrase, for example youroutline to the list of recognised to-do comments, comments starting with this expression will be coloured (which colour/font colour/bold etc. is customisable):

enter image description here

enter image description here


VIM.

Using foldmethod=marker and foldmarker=>>>,<<< you can fold everything in between >>> and <<<. If TODO is contained in a comment the TODO gets bold and in a highlighted colour. You could add more strings which are handled like TODO (but I'd have to look up how).

If you're really at it, you could as well define your own fold rules which handle your stuff without the additional markers.

Together with vim-latexsuite (a VIM plugin), you get other stuff to get your TeXing done faster.

Or you could look at the foldmethods provided by the vim-latexsuite.


Most good editors support something like this. For example in jEdit you can use a variety of custom folding commands, the most useful for (La)TeX being

%{{{ Some comment text if you want it
This is a block that I might want to fold up.
It might be quite long
%}}} some more comment text

which when folded would look like

%{{{ Some comment text if you want it
    [2 lines]
%}}} some more comment text