PageRenderTime 39ms CodeModel.GetById 23ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 0ms

HTML | 118 lines | 118 code | 0 blank | 0 comment | 0 complexity | 6091cbc581f5d74687641e584d879b6a MD5 | raw file
  1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
  2<html xmlns=""><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>3.1 Environment Mappings</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-macros.html" title="3 Latex-Suite Macros"></link><link rel="prev" href="latex-macros.html" title="3 Latex-Suite Macros"></link><link rel="next" href="latex-command-maps.html" title="3.2 Command Mappings"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.1 Environment Mappings</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-macros.html">Prev</a></td><th width="60%" align="center">3 Latex-Suite Macros</th><td width="20%" align="right"><a accesskey="n" href="latex-command-maps.html">Next</a></td></tr></table><hr></hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="environment-mappings"></a>3.1 Environment Mappings</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="environment-mappings.html#inserting-environments">3.1.1 Inserting Environments</a></span></dt><dt><span class="section"><a href="environment-mappings.html#enclosing-environments">3.1.2 Enclosing in Environments</a></span></dt><dt><span class="section"><a href="environment-mappings.html#changing-environments">3.1.3 Changing Environments</a></span></dt></dl></div>
  3   Latex-Suite provides a rich set of mappings to insert, enclose and modify
  4   LaTeX environments, i.e, <code class="literal">\begin{...} ... \end{...}</code>
  5   pairs.
  6   <div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="inserting-environments"></a>3.1.1 Inserting Environments</h4></div></div></div><div class="toc"><dl><dt><span class="section"><a href="environment-mappings.html#inserting-env-f5"> Method 1: Pressing &lt;F5&gt;</a></span></dt><dt><span class="section"><a href="environment-mappings.html#inserting-env-shift-f1"> Method 2: Using &lt;S-F1&gt;-&lt;S-F4&gt;</a></span></dt><dt><span class="section"><a href="environment-mappings.html#inserting-env-threeletter"> Method 3: Using three letter sequences</a></span></dt></dl></div><p>
  7     Latex-Suite provides the following ways to insert environments
  8    </p><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a id="inserting-env-f5"></a> Method 1: Pressing <code class="literal">&lt;F5&gt;</code></h5></div></div></div><p>
  9      If you press <code class="literal">&lt;F5&gt;</code> in the insert or normal
 10      mode while on an empty line, Latex-Suite prompts you with a list of
 11      environments you might want to insert. You can either choose one
 12      from the list or type in a new environment name.  If you press
 13      <code class="literal">&lt;F5&gt;</code> on a line which already has a word,
 14      then that word is used instead of prompting.
 15     </p><p>
 16      See <a class="link" href="customizing-macros.html#Tex_Env_name" title="11.3.1 Tex_Env_name">Tex_Env_name</a> for a
 17      description of how Latex-Suite uses the word to form the expansion and how
 18      to modify Latex-Suite's behavior.
 19     </p><p>
 20      The list of environments which Latex-Suite prompts you with (when
 21      <code class="literal">&lt;F5&gt;</code> is pressed on an empty line) is formed
 22      from the <a class="link" href="customizing-macros.html#Tex_PromptedEnvironments" title="11.3.10 g:Tex_PromptedEnvironments">Tex_PromptedEnvironments</a>
 23      setting.
 24     </p><p>
 25      In addition to this setting, Latex-Suite also lists environments found in
 26      custom packages as described in the section <a class="link" href="package-actions.html" title="4.2 Actions taken for supported packages">Package actions.</a>
 27     </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a id="inserting-env-shift-f1"></a> Method 2: Using <code class="literal">&lt;S-F1&gt;</code>-<code class="literal">&lt;S-F4&gt;</code></h5></div></div></div><p>
 28      The shifted function keys, <code class="literal">&lt;S-F1&gt;</code> to
 29      <code class="literal">&lt;S-F4&gt;</code> can be mapped to insert very commonly
 30      used environments. The environments mapped to each key can be
 31      customized via the <a class="link" href="customizing-macros.html#Tex_HotKeyMappings" title="11.3.11 g:Tex_HotKeyMappings">g:Tex_HotKeyMappings</a> setting.
 32     </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a id="inserting-env-threeletter"></a> Method 3: Using three letter sequences</h5></div></div></div><p>
 33      Environments can also be inserted by pressing a 3 capital letter
 34      sequence starting with an <code class="literal">E</code>. The sequence of 3
 35      letters generally tries to follow the following rules:
 36     </p><div class="orderedlist"><ol type="1"><li>
 37       All environment mappings begin with <code class="literal">E</code></li><li>
 38       If the environment can be broken up into 2 distinct words,
 39       such as flushright (flush + right), then the next 2 letters
 40       are the first letters of the 2 words.  Example:
 41       <pre class="programlisting">flushleft  (_f_lush + _l_eft)  ---&gt; EFL
 42flushright (_f_lush + _r_ight) ---&gt; EFR
 43eqnarray   (_e_qn + _a_rray)   ---&gt; EEA</pre>
 44       If on the other hand, the environment name cannot be broken
 45       up into 2 distinct words, then the next 2 letters are the
 46       first 2 letters of the name of the environment.
 47       Example:
 48       <pre class="programlisting">equation (_eq_uation)          ---&gt; EEQ</pre></li></ol></div><p>
 49      Unfortunately there are some environments that cannot be
 50      split in two words and first two letters in name are
 51      identical. In this case shortcut is created from E, first and
 52      last letter.  Example:
 53      </p><pre class="programlisting">quote     (_q_uot_e_)          ---&gt; EQE
 54quotation (_q_uotatio_n_)      ---&gt; EQN</pre><p>
 55      Of course, not every last one of the environments can follow
 56      this rule because of ambiguities. In case of doubt, pull down
 57      the Tex-Environments menu. The menu item should give the hint
 58      for the map.
 59     </p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="enclosing-environments"></a>3.1.2 Enclosing in Environments</h4></div></div></div><div class="toc"><dl><dt><span class="section"><a href="environment-mappings.html#enclosing-env-f5"> Method 1: Pressing &lt;F5&gt;</a></span></dt><dt><span class="section"><a href="environment-mappings.html#enclosing-env-threeletter"> Method 2: Using three letter mappings</a></span></dt></dl></div><p>
 60     Latex-Suite provides visual-mode mappings which enclose visually
 61     selected portions of text in environments. There are two ways provided
 62     to do this.
 63    </p><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a id="enclosing-env-f5"></a> Method 1: Pressing <code class="literal">&lt;F5&gt;</code></h5></div></div></div><p>
 64      You can also select a portion of text visually and press
 65      <code class="literal">&lt;F5&gt;</code> while still in visual mode. This will
 66      prompt you with a list of environments. (This list can be customized
 67      via the <a class="link" href="customizing-macros.html#Tex_PromptedEnvironments" title="11.3.10 g:Tex_PromptedEnvironments">g:Tex_PromptedEnvironments</a>
 68      setting). You can either choose from this list or type in a new
 69      environment name. Once the selection is done, Latex-Suite encloses the
 70      visually selected portion in the chosen environment.
 71     </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a id="enclosing-env-threeletter"></a> Method 2: Using three letter mappings</h5></div></div></div><p>
 72      You can also select text visually and press a sequence of three
 73      characters beginning with <code class="literal">,</code> (the single comma
 74      character) and the selected text will be enclosed in the chosen
 75      environment. The three letter sequence follows directly from the
 76      three letter sequence used to insert environments as described <a class="link" href="environment-mappings.html#inserting-env-threeletter" title=" Method 3: Using three letter sequences">here</a>. The following
 77      example describes the rule used:
 78     </p><p>
 79      If <code class="literal">ECE</code> inserts a
 80      <code class="literal">\begin{center}...\end{center}</code> environment, then to
 81      enclose a block of selected text in
 82      <code class="literal">\begin{center}...\end{center}</code>, simply select the
 83      text and press <code class="literal">,ce</code>.  The rule simply says that the
 84      leading <code class="literal">E</code> is converted to <code class="literal">,</code> and
 85      the next 2 letters are small case.  
 86     </p></div><p>
 87     Some of the visual mode mappings are sensitive to whether you
 88     choose line-wise or character-wise. For example, if you choose a
 89     word and press <code class="literal">,ce</code>, then you get
 90     <code class="literal">\centerline{word}</code>, whereas if you press
 91     <code class="literal">,ce</code> on a line-wise selection, you get:
 92     </p><pre class="programlisting">\begin{center}
 93    line
 95    </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="changing-environments"></a>3.1.3 Changing Environments</h4></div></div></div><p>
 96     Pressing <code class="literal">&lt;S-F5&gt;</code> in normal mode detects which
 97     environment the cursor is presently located in and prompts you to
 98     replace it with a new one. The innermost environment is detected. For
 99     example, in the following source:
100     </p><pre class="programlisting">\begin{eqnarray}
101  \begin{array}{ccc}
102    2 &amp; 3 &amp; 4
103  \end{array}
105     if you are located in the middle "2 &amp; 3 &amp; 4" line, then pressing
106     <code class="literal">&lt;S-F5&gt;</code> will prompt you to change the array
107     environment, not the eqnarray environment. In addition, Latex-Suite will also
108     try to change lines within the environment to be consistent with the
109     new environment. For example, if the original environment was an
110     <code class="literal">eqnarray</code> environment with a
111     <code class="literal">\label</code> command, then changing it to an
112     <code class="literal">eqnarray*</code> environment will delete the
113     <code class="literal">\label</code>.
114    </p><p>
115     Pressing <code class="literal">&lt;F5&gt;</code> in normal mode has the same
116     effect as pressing <code class="literal">&lt;F5&gt;</code> in insert-mode,
117     namely you will be prompted to choose an environment to insert.
118    </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-macros.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="latex-macros.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="latex-command-maps.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3 Latex-Suite Macros�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�3.2 Command Mappings</td></tr></table></div></body></html>