/vim/doc/latex-suite/ls-completion-usage.html
HTML | 78 lines | 78 code | 0 blank | 0 comment | 0 complexity | 554135eadb7d55b878682402eab40dc6 MD5 | raw file
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>5.1 Latex-Suite completion example</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-completion.html" title="5 Latex Completion"></link><link rel="prev" href="latex-completion.html" title="5 Latex Completion"></link><link rel="next" href="ls-completion-ref.html" title="5.2 Latex-Suite \ref completion"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5.1 Latex-Suite completion example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-completion.html">Prev</a>�</td><th width="60%" align="center">5 Latex Completion</th><td width="20%" align="right">�<a accesskey="n" href="ls-completion-ref.html">Next</a></td></tr></table><hr></hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="ls-completion-usage"></a>5.1 Latex-Suite completion example</h3></div></div></div><p>
3 Consider the situation where you are editing a file with two equations
4 labelled <code class="literal">eqn:euler</code> and <code class="literal">eqn:einstein</code>.
5 Now you want to insert a reference to one of these equations. To do this,
6 you type the <code class="literal">\ref{eqn:}</code> command and with the cursor
7 placed after <code class="literal">eqn:</code>, press <code class="literal"><F9></code>.
8 This will bring up two new windows beneath the main window you were working
9 in as shown in the figure below.
10 </p><pre class="programlisting">
11 8 These are a couple of equations:
12 9 +-- 4 lines: eqnarray (eqn:euler) : e^{j\pi} + 1 &=& 0---------------
13 13 +-- 4 lines: equation (eqn:einstein) : E = m c^2---------------------
14 17
15 18 These are a couple of figures:
16 19 +-- 7 lines: figure (fig:monkeys) : Monkeys can Type-------------------
17 26 +-- 7 lines: figure (fig:shakespeare) : Shakespeare could not type-----
18 33
19 34 This is a reference to \ref{eqn:}<++>
20 35
21 36
22 37 \end{document}
23 38
24~
25~
26~
27newfile.tex 34,32 Bot
28newfile.tex|11| \label{eqn:euler}
29newfile.tex|15| \label{eqn:einstein}
30~
31[Error List] 1,1 All
32 7
33 8 These are a couple of equations:
34 9 \begin{eqnarray}
35 10 e^{j\pi} + 1 &=& 0
36 11 \label{eqn:euler}
37 12 \end{eqnarray}
38 13 \begin{equation}
39 14 E = m c^2
40 15 \label{eqn:einstein}
41 16 \end{equation}
42newfile.tex [Preview] 11,3 21%
43 </pre><p>
44 </p><p>
45 The first window (shown as <code class="literal">[Error�List]</code> above) is a
46 <code class="literal">|cwindow|</code> containing a list of possible matches for the
47 reference. The cursor will be located in the first line of this window. The
48 bottom window is a <code class="literal">preview-window</code> showing the context of
49 the <code class="literal">\label</code>. Moving around in the
50 <code class="literal">[Error�List]</code> window automatically scrolls the
51 preview window so as to always keep showing the context of the
52 <code class="literal">\label</code> being viewed in the
53 <code class="literal">[Error�List]</code> window. You can also press
54 <code class="literal">J</code> and <code class="literal">K</code> in the
55 <code class="literal">[ErrorList]</code> window to scroll the preview window up and
56 down.
57 </p><p>
58 To insert one of the labels, simply position the cursor in the correct line
59 in the <code class="literal">[Error�List]</code> window and press
60 <code class="literal"><enter></code>. This will immediately close the two newly
61 opened windows, get back to the correct location in the original file being
62 edited and insert the label into the <code class="literal">\ref</code> command.
63 </p><p>
64 If you notice carefully in the example above, the
65 <code class="literal">[Error�List]</code> window only showed the matches for the
66 equations and did not list any of the figure labels. This is because we
67 pressed <code class="literal"><F9></code> after <code class="literal">\ref{eqn:</code>
68 instead of simply after <code class="literal">\ref{</code>. This caused Latex-Suite to
69 search only for those labels which started with the string
70 <code class="literal">eqn:</code>. If you had pressed
71 <code class="literal"><F9></code> after a <code class="literal">\ref{</code>, you would
72 have been shown matches from <span class="emphasis"><em>all</em></span> labels, not just
73 those starting with <code class="literal">eqn:</code>.
74 </p><p>
75 Thus prefixing all your labels with <code class="literal">eqn:</code>,
76 <code class="literal">fig:</code>, <code class="literal">tab:</code> etc. depending on what you
77 are labelling will lead to an easier time completing references.
78 </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-completion.html">Prev</a>�</td><td width="20%" align="center"><a accesskey="u" href="latex-completion.html">Up</a></td><td width="40%" align="right">�<a accesskey="n" href="ls-completion-ref.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5 Latex Completion�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�5.2 Latex-Suite \ref completion</td></tr></table></div></body></html>