1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
<!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>3.10 Alt Key Macros</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></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="smart-keys.html" title="3.9 Smart Key Mappings"></link><link rel="next" href="custom-macros-menu.html" title="3.11 Custom Macros"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.10 Alt Key Macros</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="smart-keys.html">Prev</a> </td><th width="60%" align="center">3 Latex-Suite Macros</th><td width="20%" align="right"> <a accesskey="n" href="custom-macros-menu.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="3.10 Alt Key Macros"><div class="titlepage"><div><div><h3 class="title"><a id="altkey-mappings"></a>3.10 Alt Key Macros</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="altkey-mappings.html#Alt-L">3.10.1 <code class="literal"><Alt-L></code></a></span></dt><dt><span class="section"><a href="altkey-mappings.html#Alt-B">3.10.2 <code class="literal"><Alt-B></code></a></span></dt><dt><span class="section"><a href="altkey-mappings.html#Alt-C">3.10.3 <code class="literal"><Alt-C></code></a></span></dt><dt><span class="section"><a href="altkey-mappings.html#Alt-I">3.10.4 <code class="literal"><Alt-I></code></a></span></dt></dl></div><p>
Latex-Suite utilizes a set of macros originally created by Carl Mueller in
auctex.vim to make inserting all the <code class="literal">\left ... \right</code>
stuff very easy and to also make some use of the heavily under-utilized
<code class="literal"><Alt></code> key.
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
By default, typing <code class="literal">Alt-<key></code> in Vim takes
focus to the menu bar if a menu with the hotkey
<code class="literal"><key></code> exists. If in your case, there are
conflicts due to this behavior, you will need to set
</p><pre class="programlisting">set winaltkeys=no</pre><p>
in your <code class="literal">$VIM/ftplugin/tex.vim</code> in order to use these
maps.
</p></div><div class="note" title="Customizing the maps" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Customizing the maps</h3><p>
If for some reason, you wish to not map the
<code class="literal"><Alt></code> keys, (some European users need to use
the <code class="literal"><Alt></code> key to enter diacritics), you can
change these maps to other keys as described in the section <a class="link" href="latex-suite-maps.html#customize-alt-key-maps" title="10.1.2 Alt-Key mappings">Customizing Alt-key maps</a>.
</p></div><div class="section" title="3.10.1 <Alt-L>"><div class="titlepage"><div><div><h4 class="title"><a id="Alt-L"></a>3.10.1 <code class="literal"><Alt-L></code></h4></div></div></div><p>
This is a polymorphic insert-mode mapping which expands to one of the
following depending on the character just before the cursor location.
</p><div class="informaltable"><table border="1"><colgroup><col width="0.5in" align="cener"></col><col width="0.5in"></col></colgroup><thead><tr><th align="cener">Character before cursor</th><th>Expansion</th></tr></thead><tbody><tr><td align="cener">(</td><td><code class="literal">\left( <++> \right)</code></td></tr><tr><td align="cener">[</td><td><code class="literal">\left[ <++> \right]</code></td></tr><tr><td align="cener">|</td><td><code class="literal">\left| <++> \right|</code></td></tr><tr><td align="cener">{</td><td><code class="literal">\left\{ <++> \right\}</code></td></tr><tr><td align="cener"><</td><td><code class="literal">\langle <++> \rangle</code></td></tr><tr><td align="cener">q</td><td><code class="literal">\lefteqn{<++>}<++></code></td></tr></tbody></table></div><p>
If the character before the cursor is none of the above, then it will
simply insert a <code class="literal">\label{<++>}<++></code>.
</p></div><div class="section" title="3.10.2 <Alt-B>"><div class="titlepage"><div><div><h4 class="title"><a id="Alt-B"></a>3.10.2 <code class="literal"><Alt-B></code></h4></div></div></div><p>
This insert-mode mapping encloses the previous character in
<code class="literal">\mathbf{}</code>.
</p></div><div class="section" title="3.10.3 <Alt-C>"><div class="titlepage"><div><div><h4 class="title"><a id="Alt-C"></a>3.10.3 <code class="literal"><Alt-C></code></h4></div></div></div><p>
In insert mode, this key is polymorphic as follows:
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
If the previous character is a letter or number, then capitalize it and
enclose it in <code class="literal">\mathcal{}</code>.
</li><li class="listitem">
otherwise insert <code class="literal">\cite{}</code>.
</li></ol></div><p>
In visual mode, it will simply enclose the selection in
<code class="literal">\mathcal{}</code>
</p></div><div class="section" title="3.10.4 <Alt-I>"><div class="titlepage"><div><div><h4 class="title"><a id="Alt-I"></a>3.10.4 <code class="literal"><Alt-I></code></h4></div></div></div><p>
This mapping inserts an <code class="literal">\item</code> command at the
current cursor location depending on which environment the cursor is
enclosed in. The style of the <code class="literal">\item</code> command is
dependent on the enclosing environment. By default,
<code class="literal"><Alt-I></code> has styles defined forthe following
environments:
</p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Environment</th><th>Style</th></tr></thead><tbody><tr><td>itemize</td><td>\item </td></tr><tr><td>enumerate</td><td>\item </td></tr><tr><td>theindex</td><td>\item </td></tr><tr><td>thebibliography</td><td>\item[<+biblabel+>]{<+bibkey+>} <++></td></tr><tr><td>description</td><td>\item[<+label+>] <++></td></tr></tbody></table></div><p>
<code class="literal"><Alt-I></code> is intelligent enough to
account for nested environments. For example,
</p><pre class="programlisting">\begin{itemize}
\item first item
\item second item
\begin{description}
\item[label1] first desc
\item[label2] second
% <Alt-I> will insert "\item[<+label+>] <++>" if
% used here
\end{description}
\item third item
% <Alt-I> will insert "\item " when if used here.
\end{itemize}
% <Alt-I> will insert nothing ("") if used here</pre><p>
</p><p>
The style used by <code class="literal"><Alt-I></code> can be customized
using the <a class="link" href="customizing-macros.html#Tex_ItemStyle_environment" title="11.3.13 Tex_ItemStyle_environment"><code class="literal">g:Tex_ItemStyle_environment</code></a>
variable.
</p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="smart-keys.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="custom-macros-menu.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.9 Smart Key Mappings </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.11 Custom Macros</td></tr></table></div></body></html>
|