<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>8.2 Customizing what to fold</title><link rel="stylesheet" type="text/css" href="../latex-suite.css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-folding.html" title="8 Latex Folding"></link><link rel="prev" href="default-folding.html" title="8.1 Default Folding Scheme in Latex-Suite"></link><link rel="next" href="editing-folding.html" title="8.3 Editing the folding.vim file directly"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">8.2 Customizing what to fold</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="default-folding.html">Prev</a> </td><th width="60%" align="center">8 Latex Folding</th><td width="20%" align="right"> <a accesskey="n" href="editing-folding.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="8.2 Customizing what to fold"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-what-to-fold"></a>8.2 Customizing what to fold</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="customizing-what-to-fold.html#Tex_FoldedSections">8.2.1 Tex_FoldedSections</a></span></dt><dt><span class="section"><a href="customizing-what-to-fold.html#Tex_FoldedEnvironments">8.2.2 Tex_FoldedEnvironments</a></span></dt><dt><span class="section"><a href="customizing-what-to-fold.html#Tex_FoldedCommands">8.2.3 Tex_FoldedCommands</a></span></dt><dt><span class="section"><a href="customizing-what-to-fold.html#Tex_FoldedMisc">8.2.4 Tex_FoldedMisc</a></span></dt><dt><span class="section"><a href="customizing-what-to-fold.html#fold-setting-advanced">8.2.5 Advanced Fold setting details</a></span></dt></dl></div><p> From version 1.6 onwards, the folding in Latex-Suite can be controlled to a large extent via a number of global variables. </p><div class="section" title="8.2.1 Tex_FoldedSections"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_FoldedSections"></a>8.2.1 Tex_FoldedSections</h4></div></div></div><p> This entry defines which sections will be folded. This setting is a comma separated list of section names. The default value is: </p><pre class="programlisting">part,chapter,section,%%fakesection, subsection,subsubsection,paragraph</pre><p> Each of the entries in the list will fold up a section of the corresponding name. The <code class="literal">%%fakesection</code> section is provided as a means for the user to group lines into "fake" sections. A <code class="literal">%%fakesection</code> is assumed to start on a line which begins with the string <code class="literal">%%fakesection</code> and continue till the start of the next <code class="literal">\section</code>, <code class="literal">\subsection</code> or any other section. </p><p> See also <a class="link" href="customizing-what-to-fold.html#fold-setting-advanced" title="8.2.5 Advanced Fold setting details">advanced fold settings</a>. </p></div><div class="section" title="8.2.2 Tex_FoldedEnvironments"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_FoldedEnvironments"></a>8.2.2 Tex_FoldedEnvironments</h4></div></div></div><p> This entry defines which environments will be folded. It is a comma separated string of words each of which defines a single environment. The default setting is </p><pre class="programlisting">verbatim,comment,eq,gather, align,figure,table,thebibliography, keywords,abstract,titlepage</pre><p> The words need not be standard Latex environments. You can add any word you like. Also, each word will fold up all environments whose name begins with that word. For example, in the setting above, the word <code class="literal">"eq"</code> folds up the <code class="literal">\begin{equation}</code>, <code class="literal">\begin{eqnarray}</code>, <code class="literal">\begin{eqnarray*}</code> environments. To avoid this, you can replace the word <code class="literal">"eq"</code> with <code class="literal">"eq}"</code>. </p><p> See also <a class="link" href="customizing-what-to-fold.html#fold-setting-advanced" title="8.2.5 Advanced Fold setting details">advanced fold settings</a>. </p></div><div class="section" title="8.2.3 Tex_FoldedCommands"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_FoldedCommands"></a>8.2.3 Tex_FoldedCommands</h4></div></div></div><p> This entry defines which commands will be folded. It is a comma separated string of words each of which defines a single command. The default setting is empty, i.e no commands are folded. The words need not be standard Latex commands. You can use whatever words you like. Each word will fold all commands whose name begins with that word as in the case of the <a class="link" href="customizing-what-to-fold.html#Tex_FoldedEnvironments" title="8.2.2 Tex_FoldedEnvironments">Tex_FoldedEnvironments</a> variable. </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> It is very difficult to fold commands reliably because it is very difficult to create a regexp which will match a line containing unmatched parentheses (or curly brackets), but will not match a line containing matched parentheses. </p><p> Just to make things safer, only lines which start a command but do not contain additional curly braces after the command has started are folded. In other words, if you wanted to fold the the command <code class="literal">"mycommand"</code>, then the lines </p><pre class="programlisting">\mycommand{This is a line and some more text on the next line }</pre><p> will be folded, but the lines </p><pre class="programlisting">\mycommand{This is a \textbf{line} and some more text }</pre><p> will not be folded. This is a bug which is very difficult to fix. </p></div><p> See also <a class="link" href="customizing-what-to-fold.html#fold-setting-advanced" title="8.2.5 Advanced Fold setting details">advanced fold settings</a>. </p></div><div class="section" title="8.2.4 Tex_FoldedMisc"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_FoldedMisc"></a>8.2.4 Tex_FoldedMisc</h4></div></div></div><p> This entry defines fold syntax for certain items which do not naturally fit into the section, environment of command lists. It is a comma separated list of words. The default value is: </p><pre class="programlisting">item,preamble,<<<</pre><p> </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> Unlike the other Tex_FoldedXXXX variables, the words in this setting are limited to take values from the following list: </p><p> </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Value</th><th>Meaning</th></tr></thead><tbody><tr><td>comments</td><td>Folds up contiguous blocks of comments</td></tr><tr><td>item</td><td>Folds up the <code class="literal">\item</code>s within list environments</td></tr><tr><td>preamble</td><td>Folds up the preamble of a document. (The part between the <code class="literal">\documentclass</code> command and the <code class="literal">\begin{document}</code> environment)</td></tr><tr><td><code class="literal"><<<</code></td><td>Folds defined manually by the user using the <code class="literal"><<<</code> and <code class="literal">>>></code> strings as fold-markers.</td></tr></tbody></table></div><p> Any other words in the <code class="literal">Tex_FoldedMisc</code> setting are silently ignored. </p></div><p> </p><p> See also <a class="link" href="customizing-what-to-fold.html#fold-setting-advanced" title="8.2.5 Advanced Fold setting details">advanced fold settings</a>. </p></div><div class="section" title="8.2.5 Advanced Fold setting details"><div class="titlepage"><div><div><h4 class="title"><a id="fold-setting-advanced"></a>8.2.5 Advanced Fold setting details</h4></div></div></div><p> The order of the words in the <code class="literal">Tex_FoldedXXXX</code> variables is <span class="emphasis"><em>important</em></span>. The order defines the order in which the folds are nested. For example, the value <code class="literal">"subsection,section"</code> for the <code class="literal">Tex_FoldedSections</code> variable will not fold any subsections at all. This is because the folds are created in the <span class="emphasis"><em>reverse</em></span> order in which they occur in the <code class="literal">Tex_FoldedSections</code> setting and also, once a fold is created, the interior of the fold is not examined for creating additional folds. In the above case, this means that a <code class="literal">\section</code> is folded first and then its interior is not examined further. The correct value should have been <code class="literal">"section,subsection"</code> </p><a id="fold-setting-adding"></a><p> Each of the fold setting variables <code class="literal">Tex_FoldedSections</code>, <code class="literal">Tex_FoldedEnvironments</code> etc., as explained previously is a comma separated string of variables. However, to make it easier to <span class="emphasis"><em>add</em></span> to the default settings without having to repeat the whole default setting again, Latex-Suite uses the following logic in forming the complete setting string from the <code class="literal">Tex_FoldedXXXX</code> variables. If the variable starts with a comma, then <code class="literal">Tex_FoldedXXXX</code> is added to the end of the default string rather than replacing it. Similarly, if it ends with a comma, then it will be prepended to the beginning of the default setting rather than replacing it. </p><p> For example, if <code class="literal">Tex_FoldedEnvironments</code> is set to the string <code class="literal">"myenv"</code>, then only an environment of the form <code class="literal">\begin{myenv}</code> will be folded. However, if the <code class="literal">Tex_FoldedEnvironments</code> setting is <code class="literal">",myenv"</code>, then the <code class="literal">\begin{myenv}</code> environment will be folded after all other environments in the default setting have been folded. On the other hand if <code class="literal">Tex_FoldedEnvironments</code> is of the form <code class="literal">"myenv,"</code>, the <code class="literal">\begin{myenv}</code> environment will be folded before the rest of the environments in the default setting. </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="default-folding.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-folding.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="editing-folding.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">8.1 Default Folding Scheme in Latex-Suite </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 8.3 Editing the folding.vim file directly</td></tr></table></div></body></html>