3
Srinath Avadhanula <srinath AT fastmail DOT fm>
4
Mikolaj Machowski <mikmach AT wp DOT pl>
10
Latex-Suite attempts to provide a comprehensive set of tools to view, edit and
11
compile LaTeX documents in Vim. Together, they provide tools starting from
12
macros to speed up editing LaTeX documents to functions for forward searching
13
.dvi documents. Latex-Suite has been possible because of the contributions of
14
many people. Please see latex-suite-credits [|ls_a_dU|] for a list of people who
17
Latex-Suite is released under the Vim charityware license. For license and
18
conditions of use look at |copyright|. Replace all occurrences of ``Vim'' with
19
``Latex-Suite''. The current copyright holders of Latex-Suite are Srinath
20
Avadhanula and Mikolaj Machowski.
22
Homepage: http://vim-latex.sourceforge.net |ls_u_1|
27
|ls_1| Installation and recommended Settings
28
|ls_2| Inserting Templates
29
|ls_3| Latex-Suite Macros
30
|ls_3_1| Environment Mappings
31
|ls_3_2| Command Mappings
32
|ls_3_3| Font Mappings
33
|ls_3_4| Section Mappings
34
|ls_3_5| Greek Letter Mappings
35
|ls_3_6| Auc-Tex Key Bindings
37
|ls_3_8| BibTeX Shortcuts
38
|ls_3_9| Smart Key Mappings
39
|ls_3_10| Alt Key Macros
40
|ls_3_11| Custom Macros
41
|ls_3_12| Making your own Macros via IMAP()
42
|ls_4| Package Handling
43
|ls_4_1| Inserting package commands
44
|ls_4_2| Actions taken for supported packages
45
|ls_4_3| Automatic Package detection
46
|ls_4_4| Writing supporting for a package
47
|ls_5| Latex Completion
48
|ls_5_1| Latex-Suite completion example
49
|ls_5_2| Latex-Suite \ref completion
50
|ls_5_3| Latex-Suite \cite completion
51
|ls_5_4| Latex-Suite filename completion
52
|ls_5_5| Custom command completion
53
|ls_6| LaTeX Compiling
54
|ls_6_1| Setting Compilation rules
55
|ls_6_2| Handling dependencies in compilation
56
|ls_6_3| Compiling multiple times
57
|ls_6_4| Customizing the compiler output
58
|ls_6_5| Compiling parts of a file
59
|ls_7| Latex Viewing and Searching
60
|ls_7_1| Setting Viewing rules
61
|ls_7_2| Forward Searching DVI documents
62
|ls_7_3| Inverse Searching
64
|ls_8_1| Default Folding Scheme in Latex-Suite
65
|ls_8_2| Customizing what to fold
66
|ls_8_3| Editing the folding.vim file directly
67
|ls_9| Multiple file LaTeX projects
68
|ls_9_1| Latex-Suite project settings
69
|ls_9_2| Specifying which file to compile
70
|ls_10| Latex-Suite Commands and Maps
71
|ls_10_1| Latex-Suite Maps
72
|ls_10_2| Latex Suite Commands
73
|ls_11| Customizing Latex-Suite
74
|ls_11_1| General Settings
75
|ls_11_2| Place-Holder Customization
76
|ls_11_3| Macro Customization
77
|ls_11_4| Smart Key Customization
78
|ls_11_5| Latex Completion Customization
79
|ls_11_6| Compiler Customization
80
|ls_11_7| Viewer Customization
81
|ls_11_8| Menu Customization
82
|ls_11_9| Folding Customization
83
|ls_11_10| Package Handling Customization
86
================================================================================
89
This file can be viewed with all the sections and subsections folded to ease
90
navigation. By default, vim does not fold help documents. To create the folds,
91
press za now. The folds are created via a foldexpr which can be seen in the
92
last section of this file.
94
See |usr_28.txt| for an introduction to folding and |fold-commands| for key
95
sequences and commands to work with folds.
97
================================================================================
98
Installation and recommended Settings *ls_1* *ls_a_bc*
99
*recommended-settings*
103
If you are reading this, it most probably means that you have already installed
104
Latex-Suite and the help files. If this is not the case, follow the detailed
105
instructions on Latex-Suite's download page |ls_u_2|.
107
Make sure that you create a few necessary settings in your ~/.vimrc. >
109
" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
112
" IMPORTANT: win32 users will need to have 'shellslash' set so that latex
113
" can be called correctly.
116
" IMPORTANT: grep will sometimes skip displaying the file name if you
117
" search in a singe file. This will confuse Latex-Suite. Set your grep
118
" program to always generate a file-name.
119
set grepprg=grep\ -nH\ $*
121
" OPTIONAL: This enables automatic indentation as you type.
126
In addition, the following settings could go in your ~/.vim/ftplugin/tex.vim
128
" this is mostly a matter of taste. but LaTeX looks good with just a bit
131
" TIP: if you write your \label's as \label{fig:something}, then if you
132
" type in \ref{fig: and press <C-n> you will automatically cycle through
133
" all the figure labels. Very useful!
138
================================================================================
139
Inserting Templates *ls_2* *ls_a_bd*
140
*latex-suite-templates*
144
This functionality is available via the TeX-Suite > Templates menu. This module
145
provides a way to insert custom templates at the beginning of the current file.
147
When Latex-Suite first starts up, it scans the
148
$VIM/ftplugin/latex-suite/templates/ directory and creates menu items based on
149
the files found there. When you select a template from this menu, the file will
150
be read in above the first line of the current file.
152
A template file can utilize placeholders for initializing the cursor position
153
when the template is read in and subsequent movement. In addition, template
154
files can contain dynamic elements such as the time of creation of a file etc,
155
by using vim expressions.
157
You can place your own templates in the $VIM/ftplugin/latex-suite/templates/
158
directory in order for them to be available via the menu. Unless Latex-Suite
159
releases a template with the same name, these files should not get over-written
160
when you install a new release over an existing one.
162
NOTE: Templates are also accessible for non-gui users with the command
163
|:TTemplate|. The argument should be name of the corresponding template
164
file. If the command is called without arguments (preferred usage), then a
165
list of available templates is displayed and the user is asked to choose
170
================================================================================
171
Latex-Suite Macros *ls_3* *ls_a_be*
174
|ls_3_1| Environment Mappings
175
|ls_3_2| Command Mappings
176
|ls_3_3| Font Mappings
177
|ls_3_4| Section Mappings
178
|ls_3_5| Greek Letter Mappings
179
|ls_3_6| Auc-Tex Key Bindings
181
|ls_3_8| BibTeX Shortcuts
182
|ls_3_9| Smart Key Mappings
183
|ls_3_10| Alt Key Macros
184
|ls_3_11| Custom Macros
185
|ls_3_12| Making your own Macros via IMAP()
188
Latex-Suite ships with a very comprehensive set of insert mode and |visual-mode|
189
mappings and menu items to typeset most of the LaTeX elements.
191
NOTE: These mappings are are not standard mappings in the sense that only the
192
last character is mapped. See plugin/imaps.vim for further documentation.
193
For example, in the case of the mapping EFI provided by Latex-Suite you
194
can press the characters 'E', 'F' and 'I' as slowly as you wish (unlike
195
the normal imap command where timeout issues are involved). The characters
196
are visible as you type them (unlike normal imaps) and you can use the
197
movement or backspace key to correct yourself unlike normal mappings.
200
*place-holder* *ls_a_dV*
201
*place-holders* *ls_a_eD*
204
Almost all macros provided in Latex-Suite implement Stephen Riem's
205
bracketing system and Gergely Kontra's JumpFunc() for handling
206
place-holders. This consists of using "place-holders" to mark off
207
locations where the next relevant editing has to be done. As an example,
208
when you type EFI in |insert-mode|, you will get the following: >
210
\centerline{\psfig{figure=<+eps file+>}}
211
\caption{<+caption text+>}
212
\label{fig:<+label+>}
214
< The text <+eps file+> will be selected and you will be left in
215
|select-mode| so that you can continue typing straight away. After having
216
typed in the file name, you can press <Ctrl-J> (while still in
217
insert-mode). This will take you directly to the next "place-holder". i.e,
218
<+caption text+> will be visually selected with Vim in select mode again
219
for typing in the caption. This saves on a lot of key presses.
222
*overriding-macros* *ls_a_eE*
223
NOTE: Over-riding Latex-Suite Macros
224
------------------------------
225
If you wish to change these macros from their default values, for example,
226
if you wish to change `w to expand to \omega instead of its default
227
expansion to \wedge, you should use the IMAP function as described in the
228
Using IMAP() [|ls_a_bG|] section.
230
An important thing to note is that if you wish to over-ride macros created
231
by Latex-Suite rather than merely create new macros, you should place the
232
IMAP() calls in a script which gets sourced after the files in
233
Latex-Suite. A good place typically is as a file-type plugin file in the
234
~/.vim/after/ftplugin/ directory. (Use ~/vimfiles if you are using
235
WINDOWS). For example to over-ride `w to \omega instead of \wedge, place
236
the following line in (say) ~/.vim/after/ftplugin/tex_macros.vim: >
237
call IMAP('`w', '\omega', 'tex')
240
NOTE: It is important to use a file-name which will get sourced on a
241
FileType event. Therefore you must use a file-name which conforms to
242
the standards as described in |ftplugin-name|.
246
*pausing-imaps* *ls_a_eF*
247
NOTE: Pausing Macro expansion
248
-----------------------
249
If you wish to temporarily suspend the imaps functionality, then you can
250
set the Imap_FreezeImap to 1. If you set g:Imap_FreezeImap to 1, then it
251
will be a system-wide setting. Setting b:Imap_FreezeImap will affect only
255
The following sections describe the various editing macros provided by
259
--------------------------------------------------------------------------------
260
Environment Mappings *ls_3_1* *ls_a_bf*
261
*environment-mappings*
263
Latex-Suite provides a rich set of mappings to insert, enclose and modify LaTeX
264
environments, i.e, \begin{...} ... \end{...} pairs.
266
Inserting Environments *ls_3_1_1* *ls_a_bg*
267
*inserting-environments*
269
Latex-Suite provides the following ways to insert environments
273
Method 1: Pressing <F5> *ls_3_1_1_1* *ls_a_bh*
276
If you press <F5> in the insert or normal mode while on an empty line,
277
Latex-Suite prompts you with a list of environments you might want to insert.
278
You can either choose one from the list or type in a new environment name. If
279
you press <F5> on a line which already has a word, then that word is used
280
instead of prompting.
282
See Tex_Env_name [|ls_a_cZ|] for a description of how Latex-Suite uses the word
283
to form the expansion and how to modify Latex-Suite's behavior.
285
The list of environments which Latex-Suite prompts you with (when <F5> is
286
pressed on an empty line) is formed from the Tex_PromptedEnvironments
289
In addition to this setting, Latex-Suite also lists environments found in custom
290
packages as described in the section Package actions. [|ls_a_bL|]
293
Method 2: Using <S-F1>-<S-F4> *ls_3_1_1_2* *ls_a_bi*
294
*inserting-env-shift-f1*
296
The shifted function keys, <S-F1> to <S-F4> can be mapped to insert very
297
commonly used environments. The environments mapped to each key can be
298
customized via the g:Tex_HotKeyMappings [|ls_a_dj|] setting.
301
Method 3: Using three letter sequences *ls_3_1_1_3* *ls_a_bj*
302
*inserting-env-threeletter*
304
Environments can also be inserted by pressing a 3 capital letter sequence
305
starting with an E. The sequence of 3 letters generally tries to follow the
309
1. All environment mappings begin with E
311
2. If the environment can be broken up into 2 distinct words, such as flushright
312
(flush + right), then the next 2 letters are the first letters of the 2
314
flushleft (_f_lush + _l_eft) ---> EFL
315
flushright (_f_lush + _r_ight) ---> EFR
316
eqnarray (_e_qn + _a_rray) ---> EEA
317
< If on the other hand, the environment name cannot be broken up into 2
318
distinct words, then the next 2 letters are the first 2 letters of the name
319
of the environment. Example: >
320
equation (_eq_uation) ---> EEQ
322
Unfortunately there are some environments that cannot be split in two words and
323
first two letters in name are identical. In this case shortcut is created from
324
E, first and last letter. Example: >
325
quote (_q_uot_e_) ---> EQE
326
quotation (_q_uotatio_n_) ---> EQN
327
Of course, not every last one of the environments can follow this rule because
328
of ambiguities. In case of doubt, pull down the Tex-Environments menu. The menu
329
item should give the hint for the map.
332
Enclosing in Environments *ls_3_1_2* *ls_a_bk*
333
*enclosing-environments*
335
Latex-Suite provides visual-mode mappings which enclose visually selected
336
portions of text in environments. There are two ways provided to do this.
340
Method 1: Pressing <F5> *ls_3_1_2_1* *ls_a_bl*
343
You can also select a portion of text visually and press <F5> while still in
344
visual mode. This will prompt you with a list of environments. (This list can be
345
customized via the g:Tex_PromptedEnvironments [|ls_a_di|] setting). You can
346
either choose from this list or type in a new environment name. Once the
347
selection is done, Latex-Suite encloses the visually selected portion in the
351
Method 2: Using three letter mappings *ls_3_1_2_2* *ls_a_bm*
352
*enclosing-env-threeletter*
354
You can also select text visually and press a sequence of three characters
355
beginning with , (the single comma character) and the selected text will be
356
enclosed in the chosen environment. The three letter sequence follows directly
357
from the three letter sequence used to insert environments as described here
358
[|ls_a_bj|]. The following example describes the rule used:
360
If ECE inserts a \begin{center}...\end{center} environment, then to enclose a
361
block of selected text in \begin{center}...\end{center}, simply select the text
362
and press ,ce. The rule simply says that the leading E is converted to , and the
363
next 2 letters are small case.
364
Some of the visual mode mappings are sensitive to whether you choose line-wise
365
or character-wise. For example, if you choose a word and press ,ce, then you get
366
\centerline{word}, whereas if you press ,ce on a line-wise selection, you get: >
373
Changing Environments *ls_3_1_3* *ls_a_bn*
374
*changing-environments*
376
Pressing <S-F5> in normal mode detects which environment the cursor is presently
377
located in and prompts you to replace it with a new one. The innermost
378
environment is detected. For example, in the following source: >
384
if you are located in the middle "2 & 3 & 4" line, then pressing <S-F5> will
385
prompt you to change the array environment, not the eqnarray environment. In
386
addition, Latex-Suite will also try to change lines within the environment to be
387
consistent with the new environment. For example, if the original environment
388
was an eqnarray environment with a \label command, then changing it to an
389
eqnarray* environment will delete the \label.
391
Pressing <F5> in normal mode has the same effect as pressing <F5> in
392
insert-mode, namely you will be prompted to choose an environment to insert.
394
--------------------------------------------------------------------------------
395
Command Mappings *ls_3_2* *ls_a_bo*
398
Latex-Suite provides a rich set of mappings to insert, enclose and modify LaTeX
401
Inserting LaTeX commands *ls_3_2_1* *ls_a_bp*
404
*ls-imap-f7* *ls_a_dW*
405
*ls-imap-s-f7* *ls_a_dX*
406
Pressing <F7> in insert or normal mode while the cursor is touching a word will
407
insert a command formed from the word touching the cursor.
409
For certain common commands, Latex-Suite will expand them to include additional
410
arguments as needed. For example, frac becomes \frac{<++>}{<++>}<++>. Otherwise,
411
it will simply change the word under the cursor as follows >
412
word --> \word{<++>}<++>
413
You can define custom expansions of commands using the Tex_Com_{name} setting as
414
described in here [|ls_a_da|].
416
If <F7> is pressed when the cursor is on white-space, then Latex-Suite will
417
prompt you to choose a command and insert that instead.The list of commands is
418
constructed from the g:Tex_PromptedCommands [|ls_a_dk|] setting and also from
419
commands which Latex-Suite finds while scanning custom packages which
420
Latex-Suite finds. See the Package actions [|ls_a_bL|] section for details on
421
which files are scanned etc.
424
Enclosing in a command *ls_3_2_2* *ls_a_bq*
427
You can select a portion of text visually and press <F7> while still in visual
428
mode. This will prompt you with a list of commands. (This list can be customized
429
via the g:Tex_PromptedCommands [|ls_a_dk|] setting). You can either choose from
430
this list or type in a new command name. Once the selection is done, Latex-Suite
431
encloses the visually selected portion in the chosen command.
434
Changing commands *ls_3_2_3* *ls_a_br*
437
*ls-vmap-f7* *ls_a_dY*
438
In both insert and normal mode <S-F7> will find out if you are presently within
439
an environment and then prompt you with a list of commands to change it to.
441
--------------------------------------------------------------------------------
442
Font Mappings *ls_3_3* *ls_a_bs* *font-maps*
444
These mappings insert font descriptions such as: \textsf{<++>}<++> with the
445
cursor left in place of the first placeholder [|ls_a_eD|] (the <++> characters).
448
1. first letter is always F (F for font)
450
2. next 2 letters are the 2 letters describing the font.
452
Example: Typing FEM in insert-mode expands to \emph{<++>}<++>.
454
Just like environment mappings, you can visually select an area and press `sf to
455
have it enclosed in: \textsf{word} or >
459
depending on character-wise or line-wise selection.
461
--------------------------------------------------------------------------------
462
Section Mappings *ls_3_4* *ls_a_bt*
465
These maps insert LaTeX sections such as: >
467
etc. Just as in the case of environments and fonts, can be enclosed with a
468
visual selection. The enclosing is not sensitive to character or line-wise
471
Mnemonic: (make your own!) >
476
SS2 for subsubsection
481
Example: SSE in insert mode inserts >
483
If you select a word or line and press ,se, then you get >
484
\section{section name}
485
The menu item in Tex-Environments.Sections have a sub-menu called 'Advanced'.
486
Choosing an item from this sub-menu asks a couple of questions (whether you want
487
to include the section in the table of contents, whether there is a shorter name
488
for the table of contents) and then creates a more intelligent template.
490
--------------------------------------------------------------------------------
491
Greek Letter Mappings *ls_3_5* *ls_a_bu*
492
*greek-letter-mappings*
496
`a through `z expand to \alpha through \zeta.Upper case:
509
NOTE: LaTeX does not support upper case for all greek alphabets.
512
Just like other Latex-Suite mappings, these mappings are not created using the
513
standard imap command. Thus you can type slowly, correct using <BS> etc.
515
--------------------------------------------------------------------------------
516
Auc-Tex Key Bindings *ls_3_6* *ls_a_bv*
519
These are simple 2 key expansions for some very commonly used LaTeX elements:
522
`^ Expands To \Hat{<++>}<++>
523
`_ expands to \bar{<++>}<++>
524
`6 expands to \partial
526
`/ expands to \frac{<++>}{<++>}<++>
527
`% expands to \frac{<++>}{<++>}<++>
531
`\ expands to \setminus
535
`- expands to \bigcap
536
`+ expands to \bigcup
537
`( expands to \subset
538
`) expands to \supset
541
`, expands to \nonumber
542
`~ expands to \tilde{<++>}<++>
543
`; expands to \dot{<++>}<++>
544
`: expands to \ddot{<++>}<++>
545
`2 expands to \sqrt{<++>}<++>
547
`I expands to \int_{<++>}^{<++>}<++>
548
(again, notice the convenient place-holders)
550
In addition the visual mode macros are provided:
553
`( encloses selection in \left( and \right)
554
`[ encloses selection in \left[ and \right]
555
`{ encloses selection in \left\{ and \right\}
556
`$ encloses selection in $$ or \[ \] depending on characterwise or
560
--------------------------------------------------------------------------------
561
Diacritics *ls_3_7* *ls_a_bw*
564
These mappings speed up typing European languages which contain diacritic
565
characters such as a-umlaut etc. >
566
+<l> expands to \v{<l>}
567
=<l> expands to \'{<l>}
568
where <l> is an alphabet.
573
Latex-Suite also ships with smart backspacing [|ls_a_dZ|] functionality which
574
provides another convenience while editing languages with diacritics.
576
NOTE: Diacritics are disabled by default in Latex-Suite because they can
577
sometimes be a little too intrusive. Moreover, most European users can
578
nowadays use font encodings which display diacritic characters directly
579
instead of having to rely on Latex-Suite's method of displaying
582
Set the g:Tex_Diacritics [|ls_a_df|] variable to enable diacritics.
586
--------------------------------------------------------------------------------
587
BibTeX Shortcuts *ls_3_8* *ls_a_bx*
590
Latex-Suite provides an easy way of entering bibliographic entries. Four
591
insert-mode mappings: BBB, BBL, BBH and BBX are provided, all of which
592
essentially act in the same manner. When you type any of these in insert-mode,
593
you will get a prompt asking you to choose a entry type for the bibliographic
596
When you choose an entry type, a bibliographic entry template will be inserted.
597
For example, if you choose the option 'book' via the map BBB, then the following
598
template will be inserted: >
609
<+key+> will be highlighted in select-mode and you can type in the bib-key.
610
After that you can use <Ctrl-J> to navigate to successive locations in the
611
template and enter new values.
613
BBB inserts a template with only the fields mandatorily required for a given
614
entry type. BBL inserts a template with commonly used extra options. BBH inserts
615
a template with more options which are not as commonly used. BBX inserts a
616
template with all the fields which the entry type supports.
620
B for Bibliographic entry, L for Large entry, H for Huge entry, and X
621
stands for all eXtras.
626
Customizing Bib-TeX fields *ls_3_8_1* *ls_a_by*
629
If you wish the BBB command to insert a few additional fields in addition to the
630
fields it creates, then you will need to define global variables of the form >
632
in you $VIM/ftplugin/bib.vim file, where {type} is a string like 'article',
633
'book' etc. This variable should contain one of the letters defined in the
636
Character Field Type~
660
For example, by default, choosing 'article' via BBB inserts the following
661
template by default >
669
However, if g:Bib_article_options is defined as 'mnp', then 'article' will
670
insert the following template >
683
If you have some other fields you wish to associate with an article which are
684
not listed above, then you will have to use the Bib_{type}_extrafields option.
685
This is a newline separated string of complete field names which will be
686
included in the template. For example, if you define >
687
let g:Bib_article_extrafields = "crossref\nabstract"
688
then the article template will include the lines >
693
NOTE: You will need to define Bib_* settings in your
694
$VIMRUNTIME/ftplugin/bib.vim file.
698
--------------------------------------------------------------------------------
699
Smart Key Mappings *ls_3_9* *ls_a_bz*
702
Latex-Suite ships with the following smart keys:
706
*smart-backspace* *ls_a_dZ*
707
Pressing <BS> in insert mode checks to see whether we are just after something
708
like \'{a} and if so, deletes all of it. i.e, diacritics are treated as single
709
characters for backspacing.
713
Pressing " (English double quote) will insert `` or '' by making an intelligent
714
guess about whether we intended to open or close a quote.
718
Latex-Suite maps the <space> key in such a way that $ characters are not broken
719
across lines. It does this by first setting tw=0 so that Vim will not
720
automatically break lines and then maps the <space> key to insert newlines
721
keeping $$'s on the same line.
725
Pressing ... (3 dots) results in \ldots outside math mode and \cdots in math
728
--------------------------------------------------------------------------------
729
Alt Key Macros *ls_3_10* *ls_a_bA*
732
Latex-Suite utilizes a set of macros originally created by Carl Mueller in
733
auctex.vim to make inserting all the \left ... \right stuff very easy and to
734
also make some use of the heavily under-utilized <Alt> key.
736
NOTE: By default, typing Alt-<key> in Vim takes focus to the menu bar if a menu
737
with the hotkey <key> exists. If in your case, there are conflicts due to
738
this behavior, you will need to set >
740
< in your $VIM/ftplugin/tex.vim in order to use these maps.
743
NOTE: Customizing the maps
745
If for some reason, you wish to not map the <Alt> keys, (some European
746
users need to use the <Alt> key to enter diacritics), you can change these
747
maps to other keys as described in the section Customizing Alt-key maps
753
<Alt-L> *ls_3_10_1* *ls_a_bB* *Alt-L*
755
This is a polymorphic insert-mode mapping which expands to one of the following
756
depending on the character just before the cursor location.
758
Character before cursor Expansion~
759
( \left( <++> \right)
760
[ \left[ <++> \right]
761
| \left| <++> \right|
762
{ \left\{ <++> \right\}
763
< \langle <++> \rangle
766
If the character before the cursor is none of the above, then it will simply
767
insert a \label{<++>}<++>.
770
<Alt-B> *ls_3_10_2* *ls_a_bC* *Alt-B*
772
This insert-mode mapping encloses the previous character in \mathbf{}.
775
<Alt-C> *ls_3_10_3* *ls_a_bD* *Alt-C*
777
In insert mode, this key is polymorphic as follows:
780
1. If the previous character is a letter or number, then capitalize it and
781
enclose it in \mathcal{}.
783
2. otherwise insert \cite{}.
784
In visual mode, it will simply enclose the selection in \mathcal{}
787
<Alt-I> *ls_3_10_4* *ls_a_bE* *Alt-I*
789
This mapping inserts an \item command at the current cursor location depending
790
on which environment the cursor is enclosed in. The style of the \item command
791
is dependent on the enclosing environment. By default, <Alt-I> has styles
792
defined forthe following environments:
798
thebibliography \item[<+biblabel+>]{<+bibkey+>} <++>
799
description \item[<+label+>] <++>
801
<Alt-I> is intelligent enough to account for nested environments. For example, >
806
\item[label1] first desc
808
% <Alt-I> will insert "\item[<+label+>] <++>" if
812
% <Alt-I> will insert "\item " when if used here.
814
% <Alt-I> will insert nothing ("") if used here
817
The style used by <Alt-I> can be customized using the
818
g:Tex_ItemStyle_environment [|ls_a_dl|] variable.
820
--------------------------------------------------------------------------------
821
Custom Macros *ls_3_11* *ls_a_bF*
824
This functionality available via the TeX-Suite.Macros menu, provides a way of
825
inserting customized macros into the current file via the menu.
827
When Latex-Suite starts up, it scans the $VIM/ftplugin/latex-suite/macros/
828
directory and creates a menu from the files found there. Each file is considered
829
as a single macro. You can place your own macros in this directory, using
830
placeholders [|ls_a_eD|] if wanted.
832
When you choose a macro from the menu, the corresponding file is read into the
833
current buffer after the current cursor position. In non-gui mode, you can use
834
the |TMacro| command instead of choosing from the menu. This command takes the
835
macro file name as an argument. When called without arguments (preferred usage),
836
then a list of available macro files is displayed and the user is prompted to
839
There are some other tools provided in this menu, namely:
842
{New} Creates a new (unnamed) buffer in the latex-suite/macros/ directory.
843
Use the command :TexMacroNew in non-gui mode.
844
{Edit} Opens up the corresponding macro file for editing. Use |:TexMacroEdit|
845
in non-gui mode. When you try to edit {macro} not from local directory
846
Latex-Suite will copy it to your local directory with suffix "-local".
847
If local copy already exists Latex-Suite prompt for overwriting it.
848
{Delete} Deletes the corresponding macro. Use the prefixed numbers for fast
849
navigation of menus. Use |:TexMacroDelete| in non-gui mode. When you
850
choose to delete {macro} which is not in your local directory
851
Latex-Suite will refuse to delete it.
852
{Redraw} Rescans the macros/ directories and refreshes the macros list.
854
--------------------------------------------------------------------------------
855
Making your own Macros via IMAP() *ls_3_12* *ls_a_bG*
858
If you find the need to create your own macros, then you can use the IMAP()
859
function provided with Latex-Suite. See [|ls_a_bH|] for a short explanation of
860
why you might prefer IMAP() over Vim's standard :imap command. An example best
861
explains the usage: >
862
:call IMAP('NOM', '\nomenclature{<++>}<++>', 'tex')
863
This will create a Latex-Suite-style mapping, where if you type NOM in insert
864
mode, you will get \nomenclature{<++>}<++> with the cursor left in place of the
865
first <++> characters. See [|ls_a_bI|] for a detailed explanation of the IMAP()
868
For maps which are triggered for a given filetype, the IMAP() command above
869
should be put in the filetype plugin script for that file. For example, for
870
tex-specific mappings, the IMAP() calls should go in $VIM/ftplugin/tex.vim. For
871
globally visible maps, you will need to use the following in either your
872
~/.vimrc or a file in your $VIM/plugin directory. >
875
au VimEnter * call IMAP('Foo', 'foo', '')
881
Why use IMAP() *ls_3_12_1* *ls_a_bH*
884
Using IMAP instead of Vim's built-in :imap command has a couple of advantages:
885
1. The 'ttimeout' option will generally limit how easily you can type the left
886
hand side for a normal :imap. if you type the left hand side too slowly, then
887
the mapping will not be activated.
889
2. If you mistype one of the letters of the lhs, then the mapping is deactivated
890
as soon as you backspace to correct the mistake.
892
3. The characters in lhs are shown on top of each other. This is fairly
893
distracting. This becomes a real annoyance when a lot of characters initiate
897
IMAP() syntax *ls_3_12_2* *ls_a_bI*
900
Formally, the syntax which is used for the IMAP function is: >
901
call IMAP (lhs, rhs, ft [, phs, phe])
904
Argument Explanation~
905
lhs This is the "left-hand-side" of the mapping. When you use IMAP, only
906
the last character of this word is actually mapped, although the
907
effect is that the whole word is mapped.
909
If you have two mappings which end in a common lhs, then the mapping
910
with the longer lhs is used. For example, if you do >
911
call IMAP('BarFoo', 'something', 'tex')
912
call IMAP('Foo', 'something else', 'tex')
913
< Then typing BarFoo inserts "something", whereas Foo by itself inserts
916
Also, the nature of IMAP() makes creating certain combination of
917
mappings impossible. For example if you have >
918
call IMAP('foo', 'something', 'tex')
919
call IMAP('foobar', 'something else', 'tex')
920
< Then you will never be able to trigger "foobar" because typing "foo"
921
will immediately insert "something". This is the "cost" which you
922
incur over the normal :imap command for the convenience of no
923
'timeout' problems, the ability to correct lhs etc.
926
rhs The "right-hand-side" of the mapping. This is the expansion you will
927
get when you type lhs.
929
This string can also contain special characters such as <enter> etc.
930
To do this, you will need to specify the second argument in
931
double-quotes as follows: >
932
:call IMAP('EFE', "\\begin{figure}\<CR><++>\\end{figure}<++>", 'tex')
933
< With this, typing EFE is equivalent to typing in the right-hand side
934
with all the special characters in insert-mode. This has the advantage
935
that if you have filetype indentation set up, then the right hand side
936
will also be indented just as if you had typed it in normally.
938
*IMAP_PutTextWithMovement* *ls_a_ea*
939
You can also set up a Latex-Suite style mapping which calls a custom
940
function as follows: >
941
:call IMAP('FOO', "\<C-r>=MyFoonction()\<CR>", 'tex')
942
< where MyFoonction is a custom function you have written. If
943
MyFoonction also has to return a string containing <++> characters,
944
then you will need to use the function IMAP_PutTextWithMovement(). An
945
example best explains the usage:
948
call IMAP('FOO', "\<C-r>=AskVimFunc()\<CR>", 'vim')
949
" Askvimfunc: Asks For Function Name And Sets Up Template
951
function! AskVimFunc()
952
let name = input('Name of the function : ')
954
let name = "<+Function Name+>"
956
let islocal = input('Is this function scriptlocal ? [y]/n : ', 'y')
962
return IMAP_PutTextWithMovement(
963
\ "\" ".name.": <+short description+> \<cr>" .
964
\ "Description: <+long description+>\<cr>" .
965
\ "\<C-u>function! ".name."(<+arguments+>)<++>\<cr>" .
966
\ "<+function body+>\<cr>" .
973
ft The file type for which this mapping is active. When this string is
974
left empty, the mapping applies for all file-types. A filetype
975
specific mapping will always take precedence.
978
phs, phe If you prefer to write the rhs with characters other than <+ and +> to
979
denote place-holders, you can use the last 2 arguments to specify
980
which characters in the rhs specify place-holders. By default, these
981
are <+ and +> respectively.
983
Note that the phs and phe arguments do not control what characters
984
will be displayed for the placeholders when the mapping is actually
985
triggered. What characters are used to display place-holders when you
986
trigger an IMAP are controlled by the Imap_PlaceHolderStart
987
[|ls_a_cV|] and Imap_PlaceHolderEnd [|ls_a_er|] settings.
991
================================================================================
992
Package Handling *ls_4* *ls_a_bJ*
995
|ls_4_1| Inserting package commands
996
|ls_4_2| Actions taken for supported packages
997
|ls_4_3| Automatic Package detection
998
|ls_4_4| Writing supporting for a package
1001
Latex-Suite has a lot of functionality written to ease working with packages.
1002
Packages here refers to files which you include into the LaTeX document using
1003
the \usepackage command.
1006
--------------------------------------------------------------------------------
1007
Inserting package commands *ls_4_1* *ls_a_bK*
1008
*inserting-packages*
1010
When you first invoke Latex-Suite, it scans the
1011
$VIM/ftplugin/latex-suite/packages directory for package script files and
1012
creates a menu from all the files found there. This menu is created under
1013
TeX-Suite > Packages > Supported. This menu contains a list of packages
1014
"supported" by Latex-Suite. When you choose one of the packages from this menu
1015
(for example the amsmath package), then a line of the form >
1016
\usepackage[<++>]{amsmath}<++>
1017
will be inserted into the current file.
1019
The \usepackage line can also be inserted in an easy manner in the current file
1020
by pressing <F5> while in the preamble of the current document. This will set up
1021
a prompt from the supported packages and ask you to choose from one of them. If
1022
you do not find the package you want to insert in the list, you can type in a
1023
package-name and it will use that. Pressing <F5> in the preamble on a line
1024
containing a single word will construct a \usepackage line from that word.
1026
You can also use the TPackage [|ls_a_cD|] to insert the \usepackage line.
1028
Once you have inserted a \usepackage line, for supported packages, you can use
1029
the Options and Commands menus described in the next section [|ls_a_bL|].
1031
--------------------------------------------------------------------------------
1032
Actions taken for supported packages *ls_4_2* *ls_a_bL*
1035
Latex-Suite takes the following actions for packages detected when a file is
1036
loaded, or a new \usepackage line is inserted using one of the methods described
1037
in the previous section [|ls_a_bK|].
1039
If you are using the GUI and you have g:Tex_Menus [|ls_a_dI|] set to 1,
1040
Latex-Suite will create the following sub-menus
1041
TeX-Suite > Packages > <package> Options
1043
TeX-Suite > Packages > <package> Commands
1045
where <package> is the package you just inserted (or was detected). You can use
1046
these menus to insert commands, environments and options which Latex-Suite
1047
recognizes as belonging to this package.
1049
NOTE: While inserting an option, you need to position yourself in the
1050
appropriate place in the document, most commonly inside the square braces
1051
in the \usepackage[]{packname} command. Latex-Suite will not navigate to
1055
In addition to creating these sub-menus, Latex-Suite will also scan the
1056
$VIM/ftplugin/latex-suite/dictionaries directory and if a dictionary file
1057
corresponding to the package file is found, then it will add the file to the
1058
'dict' setting in Vim so you can use the <C-X><C-K> command to complete words
1061
For example, the SIUnits package has a custom dictionary.
1063
*latex-package-scanning* *ls_a_eb*
1064
If a package detected at startup is found by Latex-Suite in the current
1065
directory or in a location specified by the g:Tex_TEXINPUTS [|ls_a_dT|]
1066
variable, Latex-Suite will scan the package for \newenvironment and newcommand
1067
lines and also append any commands and environments found to the list of
1068
commands and environments which you are prompted with when you press <F5>
1069
[|ls_a_bh|] or <F7> [|ls_a_dW|] in insert mode.
1070
In addition, the TeX-Suite > Packages menu also contains the following submenus
1074
This command is to be invoked with the cursor placed on the package name. If the
1075
corresponding package is found, then a sub-menu with the supported commands and
1080
This function reads the preamble of the document for \usepackage lines and if
1081
Latex-Suite supports the detected packages, then sub-menus containing the
1082
package options and commands are created.
1085
--------------------------------------------------------------------------------
1086
Automatic Package detection *ls_4_3* *ls_a_bM*
1087
*automatic-package-detection*
1089
Whenever Latex-Suite begins editing a new LaTeX file, it scans it for
1090
\usepackage{name} lines, and if a supported package is found, then it will
1091
create sub-menus and add to the 'dict' setting as described above.
1093
If a master-file [|ls_a_ct|] has been specified, then it will scan that file
1094
instead of the current file. See the section Custom Packages [|ls_a_bN|] to see
1095
which files Latex-Suite will scan in more detail.
1097
For all the packages detected in this manner, Latex-Suite will take certain
1098
actions as described in the section package support. [|ls_a_bL|].
1102
Custom Packages *ls_4_3_1* *ls_a_bN*
1105
Often times, the preamble can become too long, and some people prefer to put
1106
most of their personalization in a custom package and include that using a
1107
\usepackage line. Latex-Suite tries to search such customs package for other
1108
\usepackage lines, so that supported packages included in this indirect manner
1109
can also be used to create sub-menus, extend the 'dict' setting etc. The most
1110
obvious place to place such custom packages is in the same directory as the
1111
edited file. In addition, LaTeX also supports placing custom packages in places
1112
pointed to by the $TEXINPUTS environment variable.
1114
If you use the $TEXINPUTS variable in LaTeX, and you wish Latex-Suite to search
1115
these custom packages for \usepackage lines, then you need to initialize the
1116
g:Tex_TEXINPUTS [|ls_a_dT|] variable.
1118
The g:Tex_TEXINPUTS variable needs to be set in the same format which Vim uses
1119
for the 'path' setting. This format is explained in detail if you do >
1120
:help file-searching
1123
Therefore the value of g:Tex_TEXINPUTS will most probably be different from
1124
$TEXINPUTS which your native LaTeX distribution uses.
1127
let g:Tex_TEXINPUTS = '~/texmf/mypackages/**,./**'
1128
The ** indicates that all directories below the directory ~/texmf/mypackages and
1129
./ are to be scanned for custom packages.
1131
NOTE: The present directory '.' is always searched. You need not include that in
1136
--------------------------------------------------------------------------------
1137
Writing supporting for a package *ls_4_4* *ls_a_bO*
1138
*supporting-packages*
1140
Supporting a package is easy and consists of writing a vim script with the same
1141
name as the package and placing it in the $VIM/ftplugin/latex-suite/packages
1142
directory. A package script should define two variables as described in the next
1143
two sections. In addition to these two variables, you can also define any
1144
functions, environment definitions etc. in this file.
1148
g:Tex_package_option_<package> *ls_4_4_1* *ls_a_bP*
1150
This setting is a string containing a comma separated list of options supported
1154
g:Tex_package_option_mypack = 'opt1,opt2=,sbr:group1,opt3,opt4'
1155
The = suffix means that the option takes a value. Use sbr:group name to separate
1156
options into sub-menus. All successive options will be clubbed into the group1
1157
sub-menu till the next sbr: option is encountered.
1160
g:Tex_package_<package> *ls_4_4_2* *ls_a_bQ*
1164
g:TeX_package_<package> = "pre:Command,pre:Command1"
1165
More detailed example is in latex-suite/packages/exmpl file (slightly
1167
Here is short summary of prefixes which can be used in package files:
1168
(x - place with cursor, <++> - |placeholder|)
1170
{env:command} Environment: creates simple environment template
1174
{eno:command} Environment with option:
1178
{ens:command[<<option>>]...} Environment special:
1179
\begin[<<option>>]...{command}
1182
{bra:command} Brackets:
1184
{brd:command} Brackets double:
1185
\command{x}{<++>}<++>
1186
{brs:command[<<option>>]...} Brackets special (as environment special:
1187
\command[<+x+>]{<++>}{<++>}<++>
1188
{nor:command} Normal:
1190
{noo:command} Normal with option:
1192
{nob:command} Normal with option and brackets:
1193
\command[x]{<++>}<++>
1194
{pla:command} Plain:
1196
{spe:command} Special:
1197
command <-literal insertion of command
1198
{sep:command} creates separator. Good for aesthetics and usability :)
1199
{sbr:command} Breaks menu into submenus. <command> will be title of submenu.
1200
Can be used also in package variable.
1202
Command can be also given without prefix:. The result is
1207
================================================================================
1208
Latex Completion *ls_5* *ls_a_bR*
1211
|ls_5_1| Latex-Suite completion example
1212
|ls_5_2| Latex-Suite \ref completion
1213
|ls_5_3| Latex-Suite \cite completion
1214
|ls_5_4| Latex-Suite filename completion
1215
|ls_5_5| Custom command completion
1218
Latex-Suite provides an easy way to insert references to labels and
1219
bibliographic entries and also provide filename arguments to commands such as
1220
\includegraphics. Although the completion capabilities are very diverse,
1221
Latex-Suite only uses a single key (<F9> by default) to do all of it. Pressing
1222
the <F9> key does different things based on where you are located. Latex-Suite
1223
tries to guess what you might be trying to complete at the location where you
1224
pressed <F9>. For example, pressing <F9> when you are within a \ref command will
1225
try to list the \label's in the present directory. Pressing it when you are in a
1226
\cite command will list bibliography keys. Latex-Suite also recognizes commands
1227
which need a file name argument and will put up an explorer window for you to
1230
*ls-set-grepprg* *ls_a_eG*
1231
NOTE: Before you start with Latex-Suite's completion function...
1232
----------------------------------------------------------
1233
All of Latex-Suite's completion capabilities depend on a external program
1234
being available on your system which can search through a number of files
1235
for a reg-exp pattern. On *nix systems, the pre-installed grep utility is
1236
more than adequate. Most windows systems come with a utility findstr, but
1237
that has proven to be very inadequate (for one, it does not have an option
1238
to force the file name to be displayed when searching through a single
1239
file). Your best bet is to install cygwin |ls_u_3|, but if you think
1240
that's overkill, you can search for |ls_u_4| a windows implementation of
1241
GNU grep. (Latex-Suite testing on windows has been done with cygwin's port
1244
Once you have a grep program installed, you need to set the 'grepprg'
1245
option for vim. Make sure you use a setting which forces the program to
1246
display file names even when you are searching through a single file. For
1247
GNU grep, the syntax is >
1248
set grepprg=grep\ -nH\ $*
1253
--------------------------------------------------------------------------------
1254
Latex-Suite completion example *ls_5_1* *ls_a_bS*
1255
*ls-completion-usage*
1257
Consider the situation where you are editing a file with two equations labelled
1258
eqn:euler and eqn:einstein. Now you want to insert a reference to one of these
1259
equations. To do this, you type the \ref{eqn:} command and with the cursor
1260
placed after eqn:, press <F9>. This will bring up two new windows beneath the
1261
main window you were working in as shown in the figure below. >
1263
8 These are a couple of equations:
1264
9 +-- 4 lines: eqnarray (eqn:euler) : e^{j\pi} + 1 &=& 0---------------
1265
13 +-- 4 lines: equation (eqn:einstein) : E = m c^2---------------------
1267
18 These are a couple of figures:
1268
19 +-- 7 lines: figure (fig:monkeys) : Monkeys can Type-------------------
1269
26 +-- 7 lines: figure (fig:shakespeare) : Shakespeare could not type-----
1271
34 This is a reference to \ref{eqn:}<++>
1279
newfile.tex 34,32 Bot
1280
newfile.tex|11| \label{eqn:euler}
1281
newfile.tex|15| \label{eqn:einstein}
1283
[Error List] 1,1 All
1285
8 These are a couple of equations:
1287
10 e^{j\pi} + 1 &=& 0
1288
11 \label{eqn:euler}
1292
15 \label{eqn:einstein}
1294
newfile.tex [Preview] 11,3 21%
1298
The first window (shown as [ErrorList] above) is a |cwindow| containing a list
1299
of possible matches for the reference. The cursor will be located in the first
1300
line of this window. The bottom window is a preview-window showing the context
1301
of the \label. Moving around in the [ErrorList] window automatically scrolls the
1302
preview window so as to always keep showing the context of the \label being
1303
viewed in the [ErrorList] window. You can also press J and K in the [ErrorList]
1304
window to scroll the preview window up and down.
1306
To insert one of the labels, simply position the cursor in the correct line in
1307
the [ErrorList] window and press <enter>. This will immediately close the two
1308
newly opened windows, get back to the correct location in the original file
1309
being edited and insert the label into the \ref command.
1311
If you notice carefully in the example above, the [ErrorList] window only showed
1312
the matches for the equations and did not list any of the figure labels. This is
1313
because we pressed <F9> after \ref{eqn: instead of simply after \ref{. This
1314
caused Latex-Suite to search only for those labels which started with the string
1315
eqn:. If you had pressed <F9> after a \ref{, you would have been shown matches
1316
from _all_ labels, not just those starting with eqn:.
1318
Thus prefixing all your labels with eqn:, fig:, tab: etc. depending on what you
1319
are labelling will lead to an easier time completing references.
1321
--------------------------------------------------------------------------------
1322
Latex-Suite \ref completion *ls_5_2* *ls_a_bT*
1325
Pressing <F9> when you are within a partially completed \ref command will split
1326
open a window (named __OUTLINE__) which contains a nicely formatted list of all
1327
the \labels found in the present project. The \labels are heirarchically
1328
arranged according to which \section, \subsection etc of the overall document
1329
structure they are present in. For example, when you first press <F9> after
1330
typing \ref{, you should see something like: >
1332
+-- 54 lines: 2. Kinematics--------------------------------
1333
+-- 98 lines: 3. Aerodynamics of the MFI thorax------------
1334
+-- 40 lines: 4. Jump Resonance in Fourbar Mechanisms------
1335
+-- 28 lines: 5. Design and Fabrication Issues-------------
1337
Each chapter is |fold|ed away so that you can quickly jump to the correct
1338
section/subsection in which the relevant equation is defined. This makes
1339
inserting references significantly faster for large projects with hundreds of
1340
equations. You can then open some of the folds to see for example: >
1342
+-- 54 lines: 2. Kinematics--------------------------------
1343
3. Aerodynamics of the MFI thorax
1344
3.1. Aerodynamic modeling of the MFI wing forces
1345
3.1.1. Geometric Specification
1347
\nhat = T_z(\theta_2) T_y(\theta_y)T_x(\theta_x)\nhat_0,
1349
T_1(\theta_2) &=& T_z(\theta_2)
1351
The <Tab> key is mapped in this window to toggle folds so that you can quickly
1352
open/close folds in order to navigate the heirarchy faster. Once you are
1353
positioned on a label, press <Enter>. This closes the __OUTLINE__ window,
1354
returns to the window in which you pressed <F9> and inserts the reference at the
1355
current cursor position.
1357
NOTE: Filtering labels by prefix
1358
--------------------------
1359
You can press <F9> after typing part of the \label. In this case,
1360
Latex-Suite only presents \labels which begin with the already filled
1361
characters. You can use this to choose between equations, figures, tables
1362
etc. if you consistently label equations to begin with eqn:, figures to
1363
begin with fig: etc. For example, with this scheme, pressing <F9> after
1364
typing \ref{eqn: will only list equations.
1367
NOTE: Latex-Suite works the same way if you press <F9> after any command which
1368
contains the letters ref. Thus you can complete \eqref in exactly the same
1374
This method of preseting the \labels depends on Vim being compiled with
1375
python support. To check if you have this, see the output of the :ver
1376
command. If you see something like +python, you are all set. Failing this,
1377
you will need to have python somewhere in your $PATH.
1381
--------------------------------------------------------------------------------
1382
Latex-Suite \cite completion *ls_5_3* *ls_a_bU*
1383
*latex-completion-cite*
1385
Latex-Suite provides an easy way to insert references to bibliographic entries.
1386
Pressing <F9> when the cursor is placed inside a partially completed \cite
1387
command will split open a new window (named __OUTLINE__) which contains a
1388
formatted and syntax highlighted list of all bibtex entries found. For example,
1389
pressing <F9> after typing \ref{ should present you with a window which looks
1390
something like this: >
1392
Article [dickinson:science:99]
1393
"Wing rotation and aerodynamic basis of insect flight"
1394
M. H. Dickinson and F-O. Lehman and S. P. Sane
1397
Article [ellington:84:part1]
1398
"The Aerodynamics of Hovering Insect Flight. I. The Quasi-Steady Analysis"
1400
In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984
1402
Article [ellington:84:part2]
1403
"The Aerodynamics of Hovering Insect Flight. II. Morphological Parameters"
1405
In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984
1409
You can easily jump from one entry to another using the 'n' and 'p' keys (to go
1410
to the next / previous entry respectively).
1412
You can also filter out a subset of the bibtex entries by pressing 'f' while in
1413
this window. Doing this presents the following prompt: >
1415
Field acronyms: (`:let g:Tex_EchoBibFields = 0` to avoid this message)
1416
[t] title [a] author [b] booktitle
1417
[j] journal [y] year [p] bibtype
1418
(you can also enter the complete field name)
1419
Enter filter criterion [field<space>value]:
1421
At the prompt, type >
1423
Notice that the letter a is an acronym for author according to the prompt above.
1424
Therefore this filter only shows those bibtex entries whose author field
1425
contains the text ellington. You can keep narrowing your selection by repeatedly
1426
filtering the results. If you would like to remove all the filters and see all
1427
entries again, press 'a', which removes all the filters.
1429
You can also sort the bibtex entries based on a field. To do this, press 's'.
1430
This will present you with a prompt like in the case of the filter and you are
1431
asked to choose a field. In this case, you would type in a single character.
1432
This sorts the entries according to that field.
1434
NOTE: <F9> will also work in a similar way after any command which contains the
1435
word cite in it. For example, pressing <F9> will also work with \citenum
1439
The following logic is applied to find out which bibliographic entries are
1440
included in the completion.
1443
1. Firstly, if the present file has a master-file [|ls_a_ct|] defined for it,
1444
then Latex-Suite will perform the following steps on that file instead of on
1447
2. First, the file is scanned for a \bibliography command. To explain better,
1448
assume that a command >
1449
\bibliography{file1,file2}
1450
< is found in the present file. For each bibliography file, say file1,
1451
Latex-Suite first tries to see if a .bib file, file1.bib can be found. If so,
1452
it will scan it for bib-keys of the form @BOOK{ etc., and add these searches
1453
to the completion list. If a .bib file cannot be found, then it will try to
1454
see if file1.bbl can be found. If so, Latex-Suite will search it for bib-keys
1455
of the form \bibitem and add these to the completion list.
1457
You can set the location where Latex-Suite will search for .bib and .bbl
1458
files using the |Tex_BIBINPUTS| [|ls_a_dr|] variable.
1460
3. If a \bibliography command is not found, then Latex-Suite tries to scan the
1461
present file for a \begin{thebibliography} environment. If found, Latex-Suite
1462
searches the present file for bib-keys of the form \bibitem.
1464
4. Finally, it will try to see if this file includes other files via the \input
1465
command. For each such file found, Latex-Suite will repeat the previous two
1466
steps stopping at the first file which has either a \bibliography command or
1467
a thebibliography environment.
1470
Caching the \cite completion results *ls_5_3_1* *ls_a_bV*
1471
*cite-search-caching*
1473
*TClearCiteHist* *ls_a_ec*
1474
Often times, the editing cycle proceeds by first laying out a comprehensive
1475
bibliography and then completing all the \cite commands in one session. In such
1476
situations, it is inefficient to scan the whole list of bibliography files for
1477
bib-keys each time. Latex-Suite provides a way to cache the results of the cite
1478
completion search using the Tex_RememberCiteSearch [|ls_a_du|] variable. If set,
1479
Latex-Suite will perform the search only the first time <F9> is used. Next time
1480
on, it will reuse the search results. If you wish to redo the search results,
1483
This will redo the completion list next time you use <F9>.
1485
--------------------------------------------------------------------------------
1486
Latex-Suite filename completion *ls_5_4* *ls_a_bW*
1487
*ls-filename-completion*
1489
When you press <F9> at a location where Latex-Suite guesses a filename needs to
1490
be typed, then a new explorer window will open up with the list of files. You
1491
can use this window to change directories etc. Pressing <enter> on a filename in
1492
the explorer window will automatically close the explorer window, return to the
1493
location where you pressed <F9> from and insert the filename into that position.
1495
Latex-Suite also tries to guess what kinds of files you might not want to insert
1496
and hides those accordingly. For example, if you press <F9> when you are located
1497
at \includegraphics{, then Latex-Suite knows that you will not want to insert
1498
.tex files. Therefore, the explorer window will automatically hide these files.
1500
As of now, Latex-Suite recognizes the following commands for filename
1501
completion. Along with the commands, this table also lists the files which
1502
Latex-Suite will not show for completing each command.
1504
command hide pattern~
1505
\bibliography '^\.,\.[^b]..$'
1506
\include \includeonly '^\.,\.[^t]..$'
1507
\includegraphics \psfig '^\.,\.tex$,\.bib$,\.bbl$,\.zip$,\.gz$'
1510
--------------------------------------------------------------------------------
1511
Custom command completion *ls_5_5* *ls_a_bX*
1512
*ls-completion-custom*
1514
Latex-Suite also recognizes certain commonly used LaTeX commands for the <F9>
1515
key. At the moment, the \bibliographystyle, \addtocontents and the
1516
\addcontentsline commands are recognized, although more will be added in the
1517
future. When you press the <F9> after such a command, Latex-Suite will prompt
1518
you with a list of arguments which make sense for the command.
1520
This functionality is available for commands for which a global variable of the
1521
form g:Tex_completion_{<command>} is defined where <command> is the command
1522
name. This variable is a comma separated list of values which this command
1523
takes. For example, the argument to the \bibliographystyle command is commonly
1524
one of abbr,alpha,plain,unsrt. Therefore, Latex-Suite defines >
1525
let g:Tex_completion_bibliographystyle = 'abbr,alpha,plain,unsrt'
1526
You can define your own completion variables in a similar manner for commands
1527
which you might use.
1529
================================================================================
1530
LaTeX Compiling *ls_6* *ls_a_bY*
1533
|ls_6_1| Setting Compilation rules
1534
|ls_6_2| Handling dependencies in compilation
1535
|ls_6_3| Compiling multiple times
1536
|ls_6_4| Customizing the compiler output
1537
|ls_6_5| Compiling parts of a file
1540
This functionality, available via the TeX-Suite menu, provides various tools to
1541
compile and debug LaTeX files from within Vim.
1543
If you are using commonly used LaTeX tools, then you should be all set as soon
1544
as you download and install Latex-Suite. In order to compile a LaTeX file,
1545
simply press \ll while editing the file. This runs latex on the current file and
1546
displays the errors in a |quickfix-window| below the file being edited. You can
1547
then scroll through the errors and press <enter> to be taken to the location of
1548
the corresponding error. Along with the errors being listed in the quickfix
1549
window, the corresponding log file is also opened in |preview| mode beneath the
1550
quickfix window. It is scrolled automatically to keep in sync with the error
1551
being viewed in the quickfix window. You will be automatically taken to the
1552
location of the first error/warning unless you set the g:Tex_GotoError
1553
[|ls_a_dD|] variable to 0.
1555
Latex-Suite also supports compiling LaTeX into formats other than DVI. By
1556
default, Latex-Suite supports PDF and PS formats. In order to choose a format
1557
other than DVI, use the TTarget command or the TeX-Suite > Target Format menu
1558
item. This will ask you to type in the name of the target format you want to
1559
compile to. If a rule has been defined for the format (as described in the next
1560
section [|ls_a_bZ|]), then Latex-Suite will switch to that format.
1562
Trying to choose a format for which no rule has been defined will result in
1563
Latex-Suite displaying a warning message without taking any action.
1565
If you are using a multiple file project and need to compile a master file while
1566
editing other files, then Latex-Suite provides a way to specify the file to be
1567
compiled as described in latex-master-file [|ls_a_ct|].
1570
--------------------------------------------------------------------------------
1571
Setting Compilation rules *ls_6_1* *ls_a_bZ*
1574
In order to compile LaTeX files into various formats, Latex-Suite needs to know
1575
which external programs to call and in which way they need to be called. This
1576
information is provided to Latex-Suite via a number of "rules". For each format
1577
you want to compile to, you need to specify a rule. A rule is specified by
1578
defining a variable of the form: >
1579
g:Tex_CompileRule_<format>
1580
where <format> is a string like "pdf", "dvi" etc.
1582
Example: By default, Latex-Suite uses the following rule for compiling LaTeX
1583
documents into DVI. >
1584
g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*'
1587
Default values are also provided for ps and pdf formats. You might want to
1588
change these rules in texrc according to your local tex environment.
1590
NOTE: For win32 users user MikTeX, sometimes the latex compiler's output has a
1591
bug where a single number is split across different lines. In this case,
1592
put the included vim-latex file distributed with Latex-Suite.
1596
--------------------------------------------------------------------------------
1597
Handling dependencies in compilation *ls_6_2* *ls_a_ca*
1598
*compiler-dependency*
1600
Latex-Suite also handles compiling dependencies automatically via certain rules
1601
which specify the "dependency chain" for each target format. For example, if in
1602
your case, you use >
1603
.tex -> .dvi -> .ps -> .pdf
1604
to generate pdf files from dvi files, then you will need to specify the
1605
following setting in your Latex-Suite configuration (see customizing Latex-Suite
1606
[|ls_a_cP|] for where these settings should go): >
1608
let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf'
1610
This is a comma separated string of formats specifying the order in which the
1611
formats to be compiled into should be chosen. With this setting, if you set the
1612
target format to pdf, then the next time you compile via the \ll shortcut,
1613
Latex-Suite will first generate a dvi file, then use that to generate the ps
1614
file and finally create the pdf file from that.
1616
NOTE: If any of the intermediate formats is listed in the
1617
g:Tex_MultipleCompileFormats setting as described in the section Compiling
1618
multiple times [|ls_a_cb|], then Latex-Suite might make multiple calls to
1619
the compiler to generate the output file of that format.
1622
Along with the g:Tex_FormatDependency_{format} setting, you should ofcourse
1623
specify the rule for compiling to each of the formats as described in the
1624
previous section [|ls_a_bZ|]. For example, with the setting above, you could
1627
let g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*'
1628
let g:Tex_CompileRule_ps = 'dvips -Ppdf -o $*.ps $*.dvi'
1629
let g:Tex_CompileRule_pdf = 'ps2pdf $*.ps'
1632
NOTE: By default, Latex-Suite does not specify any compiler dependencies. Each
1633
target format for which a rule has been derived will be compiled
1638
--------------------------------------------------------------------------------
1639
Compiling multiple times *ls_6_3* *ls_a_cb*
1640
*compiling-multiple*
1642
Most LaTeX compilers need to be re-run several times in several commonly
1643
occurring situations in order to get a final camera ready copy. For example,
1644
when \label's change, when new \cite commands are added etc. If the target
1645
format you are compiling to requires multiple compilations, then you will need
1646
to include the format in the g:Tex_MultipleCompileFormats setting. This is a
1647
comma separated string of formats which need multiple compilations to be
1648
generated correctly.
1650
By default, this setting contains just the dvi format. If you use the pdflatex
1651
compiler to generate pdf files, then you might want to also include pdf into the
1654
For every format included in the g:Tex_MultipleCompileFormats setting described
1655
above, Latex-Suite will use the following logic to generate the file. Note that
1656
although the following description uses latex to refer to the compiler, it could
1657
be some other compiler such as pdflatex for generating pdf output.
1659
1. If there was a .idx file, then remember its contents.
1663
3. If the .idx file changed due to the latex compiler, then run makeindex to
1664
redo the .ind file and then remember to rerun latex.
1666
4. If the .aux file generated by the latex compiler contains a \bibdata line,
1667
then it means that we are using a .bib file. Therefore, run bibtex.
1669
NOTE: This means that we will always run bibtex whenever we use the
1670
\bibliography command whether or not we actually need to. At this time,
1671
Latex-Suite does not parse the .aux file before and after the latex
1672
compiler to see if we are required to rerun bibtex.
1674
5. If the .bbl file changes because of this, then remember to rerun latex again.
1676
6. Also, we check to see if the LaTeX compiler gives certain standard warnings
1677
which notify that we need to compile once again. In this case also, remember
1680
7. If we found we had to rerun latex, then we repeat the steps above but not
1681
running makeindex or bibtex again.
1683
The LaTeX file is compiled atmost 5 times using this logic. These steps will
1684
ensure that on most platforms/environments, you will get a clean output with all
1685
the cross-references, citations etc correctly labelled and ordered.
1687
--------------------------------------------------------------------------------
1688
Customizing the compiler output *ls_6_4* *ls_a_cc*
1689
*compiler-output-customization*
1691
Most LaTeX compilers produce a very large amount of output during compilation,
1692
most of which is not relevant to debugging type-setting errors. The compiler
1693
plugin provided with Latex-Suite (which is an enhanced version of the standard
1694
compiler plugin maintained by Artem Chuprina), provides a way to filter the
1695
compiler output so that the actual errors/warnings can be presented much more
1698
The compiler plugin is set up by default to function in a "non-verbose",
1699
"ignore-common-warnings" mode, which means that irrelevant lines from the
1700
compiler output will be ignored and some very common warnings are also ignored.
1701
Latex-Suite does this via the global variable g:Tex_IgnoredWarnings [|ls_a_dA|].
1702
This is a list of patterns, which can be used to filter out (or ignore) some or
1703
the warnings and errors reported by the compiler. See the link above for its
1706
Latex-Suite uses the g:Tex_IgnoreLevel [|ls_a_dB|] setting to set a default
1707
ignore level. For example, for the default value of 4, Latex-Suite ignores
1708
warnings and errors matching the first 4 patterns in g:Tex_IgnoredWarnings.
1710
In addition to setting a default value of the ignore level, Latex-Suite provides
1711
the ability to set the level dynamically, using the TCLevel command. For
1712
example, if you issue the command: >
1714
from within Vim, then the next time you compile the document, Latex-Suite will
1715
ignore warnings and errors which match the first three patterns in
1716
g:Tex_IgnoredWarnings.
1718
When TCLevel is called with the unquoted string strict as follows: >
1720
then Latex-Suite switches to a "verbose", "no-lines-ignored" mode which is
1721
useful when you want to make final checks of your document and want to be
1722
careful not to let things slip by.
1724
See the explanation of the settings g:Tex_IgnoredWarnings [|ls_a_dA|] and
1725
g:Tex_IgnoreLevel [|ls_a_dB|] to find out how to customize the filtering done by
1728
--------------------------------------------------------------------------------
1729
Compiling parts of a file *ls_6_5* *ls_a_cd*
1732
Latex-Suite also provides a way to compile a fragment of a document. This can be
1733
very useful while debugging a complex equation or one chapter in a book, etc.
1735
To do this, visually select a portion of the text and press \ll while in visual
1736
mode. The visually selected portion will be saved to a temporary file with the
1737
preamble from the current document prepended. Latex-Suite will then switch focus
1738
to this temporary file and compile it. Continue to debug this file as required
1739
and then replace the portion of the original file with this one.
1741
Pressing \lv while viewing the temporary file will view the output file
1742
generated from the temporary file, not the original file
1744
Two commands |TPartComp| and |TPartView| are provided to be able to get this
1745
functionality via the command line.
1747
From release 1.6 onwards of Latex-Suite, the temporary file created for part
1748
compilation will reside in the same directory as the file from which the
1749
fragment is being created. This ensures that any relative path-names defined in
1750
the fragment will still work. Latex-Suite will attempt to clean the temporary
1751
file(s) created when Vim exits.
1753
================================================================================
1754
Latex Viewing and Searching *ls_7* *ls_a_ce*
1757
|ls_7_1| Setting Viewing rules
1758
|ls_7_2| Forward Searching DVI documents
1759
|ls_7_3| Inverse Searching
1763
--------------------------------------------------------------------------------
1764
Setting Viewing rules *ls_7_1* *ls_a_cf*
1765
*latex-viewing-rules*
1767
In order to view the output files created by compiling the source files, you
1768
need to specify which external program Latex-Suite should call. You can specify
1769
the external program using one of two settings Tex_ViewRule_format [|ls_a_dF|]
1770
or Tex_ViewRuleComplete_format [|ls_a_dG|]. By default, Latex-Suite has default
1771
settings for viewing various common output formats via the Tex_ViewRule_format
1772
settings, so that if you are using commonly used programs, you should be all set
1773
to view compiled files from within Vim by simply pressing \lv.
1775
NOTE: The viewing function also takes the *.latexmain [|ls_a_ct|] file into
1776
account to decide which file to show.
1779
If pressing \lv does not work, then it most probably has to do with incorrect
1780
settings of the g:Tex_ViewRule_<format> [|ls_a_dF|] where <format> is the format
1781
you are attempting to view. See the link above for how to set this according to
1784
In addition to viewing the files, Latex-Suite also supports forward and inverse
1785
searching for certain common tools for viewing DVI documents. At the moment,
1786
there is built-in support for YAP on windows (which ships with MikTeX), and the
1787
popular xdvi on *nix platforms. See the next few sections for details on forward
1788
and inverse searching.
1790
--------------------------------------------------------------------------------
1791
Forward Searching DVI documents *ls_7_2* *ls_a_cg*
1794
Forward searching refers to making a DVI viewer display a given document at a
1795
given location from within Vim. At present, this functionality is supported for
1796
YAP on windows and xdvi on *nix machines. Pressing \ls from within Vim should
1797
make the DVI viewer display the portion of the document where your cursor is
1800
*enabling-searching* *ls_a_ed*
1801
NOTE: Enabling Forward and Inverse Searching
1802
--------------------------------------
1803
Most DVI viewers need "source-special" information in order to do forward
1804
(and inverse) searching. This information is embedded in the dvi file if
1805
the LaTeX source is compiled with the --src-specials option. By default,
1806
Latex-Suite does not supply this argument to the compiler. See the section
1807
on to find out how this option can be set.
1811
--------------------------------------------------------------------------------
1812
Inverse Searching *ls_7_3* *ls_a_ch*
1815
Inverse searching refers to the DVI viewer telling Vim to display the LaTeX
1816
source file at a given location when you double-click in the DVI viewer window.
1818
You will need to enable searching [|ls_a_ed|] in order to use this
1821
You will also need to specify certain settings to the DVI viewer conveying the
1822
syntax which it needs to use to tell Vim how to display the source file. In YAP,
1823
you can set this option in View > Options > Inverse Search. The Command Line
1824
field needs to be set as follows: >
1825
"C:\Program Files\vim\vim61\gvim" -c ":RemoteOpen +%l %f"
1826
The command :RemoteOpen is supplied when you install Latex-Suite.
1828
On *nix machines, Latex-Suite attempts to call the DVI viewer in such a way that
1829
it already knows how to communicate with Vim. If this does not seem to be
1830
working, you can use the RemoteOpen command described above.
1832
================================================================================
1833
Latex Folding *ls_8* *ls_a_ci*
1836
|ls_8_1| Default Folding Scheme in Latex-Suite
1837
|ls_8_2| Customizing what to fold
1838
|ls_8_3| Editing the folding.vim file directly
1841
Latex-Suite ships with the plugin SyntaxFolds.vim which is a plugin for creating
1842
"fake" syntax folds on the fly. The fold method is actually manual but the
1843
folding is based on LaTeX syntax. This offers a speed increase over regular
1844
syntax folding. Ofcourse it has the disadvantage that the folds are not dynamic,
1845
i.e newly created syntax items are not automatically folded up. (This is a
1846
compromise between speed and convenience).
1848
When you open up a LaTeX file, all the portions will be automatically folded up.
1849
However, no new folds will be created until you press <F6> or \rf. (rf stands
1850
for "refresh folds").
1852
The fold-text is set to the first line of the folded text unless the fold is a
1853
table, figure etc. (an environment). In this case, if a \caption and/or a label
1854
is found in the folded region, then those are used to make a more meaningful
1855
fold-text, otherwise the second line of the environment is displayed along with
1856
the name of the environment. In other words, the following >
1858
\centerline{\psfig{figure=slidercrank.eps,height=6cm}}
1859
\caption{The Slider Crank Mechanism.}
1860
\label{fig:slidercrank}
1869
+--- 5 lines: figure (fig:slidercrank) : The Slider Crank Mechanism. -----
1871
+--- 3 lines: eqnarray () : \sin(\pi) = 0 --------------------------------
1875
--------------------------------------------------------------------------------
1876
Default Folding Scheme in Latex-Suite *ls_8_1* *ls_a_cj*
1879
By default Latex-Suite creates folds in the following manner:
1893
The indentation shows the "nestedness" of the folding scheme. See the next
1894
section [|ls_a_ck|] to see how you can change this scheme.
1896
--------------------------------------------------------------------------------
1897
Customizing what to fold *ls_8_2* *ls_a_ck*
1898
*customizing-what-to-fold*
1900
From version 1.6 onwards, the folding in Latex-Suite can be controlled to a
1901
large extent via a number of global variables.
1905
Tex_FoldedSections *ls_8_2_1* *ls_a_cl*
1906
*Tex_FoldedSections*
1908
This entry defines which sections will be folded. This setting is a comma
1909
separated list of section names. The default value is: >
1910
part,chapter,section,%%fakesection,
1911
subsection,subsubsection,paragraph
1912
Each of the entries in the list will fold up a section of the corresponding
1913
name. The %%fakesection section is provided as a means for the user to group
1914
lines into "fake" sections. A %%fakesection is assumed to start on a line which
1915
begins with the string %%fakesection and continue till the start of the next
1916
\section, \subsection or any other section.
1918
See also advanced fold settings [|ls_a_cp|].
1921
Tex_FoldedEnvironments *ls_8_2_2* *ls_a_cm*
1922
*Tex_FoldedEnvironments*
1924
This entry defines which environments will be folded. It is a comma separated
1925
string of words each of which defines a single environment. The default setting
1927
verbatim,comment,eq,gather,
1928
align,figure,table,thebibliography,
1929
keywords,abstract,titlepage
1930
The words need not be standard Latex environments. You can add any word you
1931
like. Also, each word will fold up all environments whose name begins with that
1932
word. For example, in the setting above, the word "eq" folds up the
1933
\begin{equation}, \begin{eqnarray}, \begin{eqnarray*} environments. To avoid
1934
this, you can replace the word "eq" with "eq}".
1936
See also advanced fold settings [|ls_a_cp|].
1939
Tex_FoldedCommands *ls_8_2_3* *ls_a_cn*
1940
*Tex_FoldedCommands*
1942
This entry defines which commands will be folded. It is a comma separated string
1943
of words each of which defines a single command. The default setting is empty,
1944
i.e no commands are folded. The words need not be standard Latex commands. You
1945
can use whatever words you like. Each word will fold all commands whose name
1946
begins with that word as in the case of the Tex_FoldedEnvironments [|ls_a_cm|]
1949
NOTE: It is very difficult to fold commands reliably because it is very
1950
difficult to create a regexp which will match a line containing unmatched
1951
parentheses (or curly brackets), but will not match a line containing
1952
matched parentheses.
1954
Just to make things safer, only lines which start a command but do not
1955
contain additional curly braces after the command has started are folded.
1956
In other words, if you wanted to fold the the command "mycommand", then
1958
\mycommand{This is a line
1959
and some more text on the next line
1961
< will be folded, but the lines >
1962
\mycommand{This is a \textbf{line}
1965
< will not be folded. This is a bug which is very difficult to fix.
1968
See also advanced fold settings [|ls_a_cp|].
1971
Tex_FoldedMisc *ls_8_2_4* *ls_a_co*
1974
This entry defines fold syntax for certain items which do not naturally fit into
1975
the section, environment of command lists. It is a comma separated list of
1976
words. The default value is: >
1978
NOTE: Unlike the other Tex_FoldedXXXX variables, the words in this setting are
1979
limited to take values from the following list:
1982
comments Folds up contiguous blocks of comments
1983
item Folds up the \items within list environments
1984
preamble Folds up the preamble of a document. (The part between the
1985
\documentclass command and the \begin{document} environment)
1986
<<< Folds defined manually by the user using the <<< and >>> strings
1989
Any other words in the Tex_FoldedMisc setting are silently ignored.
1993
See also advanced fold settings [|ls_a_cp|].
1996
Advanced Fold setting details *ls_8_2_5* *ls_a_cp*
1997
*fold-setting-advanced*
1999
The order of the words in the Tex_FoldedXXXX variables is _important_. The order
2000
defines the order in which the folds are nested. For example, the value
2001
"subsection,section" for the Tex_FoldedSections variable will not fold any
2002
subsections at all. This is because the folds are created in the _reverse_ order
2003
in which they occur in the Tex_FoldedSections setting and also, once a fold is
2004
created, the interior of the fold is not examined for creating additional folds.
2005
In the above case, this means that a \section is folded first and then its
2006
interior is not examined further. The correct value should have been
2007
"section,subsection"
2009
*fold-setting-adding* *ls_a_ee*
2010
Each of the fold setting variables Tex_FoldedSections, Tex_FoldedEnvironments
2011
etc., as explained previously is a comma separated string of variables. However,
2012
to make it easier to _add_ to the default settings without having to repeat the
2013
whole default setting again, Latex-Suite uses the following logic in forming the
2014
complete setting string from the Tex_FoldedXXXX variables. If the variable
2015
starts with a comma, then Tex_FoldedXXXX is added to the end of the default
2016
string rather than replacing it. Similarly, if it ends with a comma, then it
2017
will be prepended to the beginning of the default setting rather than replacing
2020
For example, if Tex_FoldedEnvironments is set to the string "myenv", then only
2021
an environment of the form \begin{myenv} will be folded. However, if the
2022
Tex_FoldedEnvironments setting is ",myenv", then the \begin{myenv} environment
2023
will be folded after all other environments in the default setting have been
2024
folded. On the other hand if Tex_FoldedEnvironments is of the form "myenv,", the
2025
\begin{myenv} environment will be folded before the rest of the environments in
2026
the default setting.
2028
--------------------------------------------------------------------------------
2029
Editing the folding.vim file directly *ls_8_3* *ls_a_cq*
2032
If you are using version 1.5 of Latex-Suite or older, you will need to directly
2033
edit the $VIM/ftplugin/latex-suite/folding.vim file if you wish to modify the
2034
folding scheme. You will need to modify the function MakeTexFolds() defined in
2035
that file to modify the fold syntax. MakeTexFolds makes a number of calls to
2036
AddSyntaxFoldItem. Each such call defines a new "fold item". The order in which
2037
these calls are made defines how the folds are nested. For example, if you
2038
desire an figure environment to be nested within a section, then you should
2039
define the fold for the figure first. The syntax of AddSyntaxFoldItem is as
2041
AddSyntaxFoldItem(startpat, endpat, startoff, endoff [, startskip, endskip])
2042
If the last two arguments are omitted, then they are assumed to default to the
2043
empty strings ''. The explanation for each argument is as follows:
2045
Argument Explanation~
2046
startpat a line matching this pattern defines the beginning of a fold.
2047
endpat a line matching this pattern defines the end of a fold.
2048
startoff this is the offset from the starting line at which folding will
2050
endoff like startoff, but gives the offset of the actual fold end from the
2051
line satisfying endpat. startoff and endoff are necessary when the
2052
folding region does not have a specific end pattern corresponding to
2053
a start pattern. for example in LaTeX, \section{Section Name} defines
2054
the beginning of a section, but there is no command which
2055
specifically ends a section. Thus a \section is assumed to end 1 line
2056
_before_ another section starts.
2057
startskip A Pattern Which Defines The Beginning Of A "Skipped" Region.
2059
For example, suppose we define a \itemize fold as follows: >
2061
= '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}',
2066
This defines a fold which starts with a line beginning with an \item
2067
and ending one line before a line beginning with an \item or
2068
\end{enumerate} etc.
2070
Then, as long as \item's are not nested things are fine. However,
2071
once items begin to nest, the fold started by one \item can end
2072
because of an \item in an \itemize environment within this \item.
2073
i.e, the following can happen: >
2075
\item Some text <------- fold will start here
2076
This item will contain a nested item
2077
\begin{itemize} <----- fold will end here because next line contains \item...
2079
\end{itemize} <----- ... instead of here.
2080
\item Next item of the parent itemize
2084
Therefore, in order to completely define a folding item which allows
2085
nesting, we need to also define a "skip" pattern. startskip and end
2086
skip do that. Leave '' when there is no nesting.
2087
endskip the pattern which defines the end of the "skip" pattern for nested
2092
A syntax fold region for the latex section is defined with the following
2093
arguments to AddSyntaxFoldItem: >
2094
startpat = "\\section{"
2095
endpat = "\\section{"
2100
< Note that the start and end patterns are thus the same and endoff has a
2101
negative value to capture the effect of a section ending one line before
2107
A syntax fold region for the \itemize environment is: >
2108
startpat = '^\s*\\item',
2109
endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}',
2112
startskip = '^\s*\\begin{\(enumerate\|itemize\|description\)}',
2113
endskip = '^\s*\\end{\(enumerate\|itemize\|description\)}'
2114
< Note the use of startskip and endskip to allow nesting.
2118
================================================================================
2119
Multiple file LaTeX projects *ls_9* *ls_a_cr*
2122
|ls_9_1| Latex-Suite project settings
2123
|ls_9_2| Specifying which file to compile
2126
*latex-project-example* *ls_a_ef*
2127
Many LaTeX projects contain multiple source files which are \included from a
2128
master file. A typical example of this situation is a directory layout such as
2149
In the above case, main.tex will typically look like
2153
\documentclass{report}
2156
\input{abstract.tex}
2157
\input{intro/intro.tex}
2158
\input{chapter1/chap1.tex}
2159
\input{conclusion/conclusion.tex}
2164
*latex-master-file-specification* *ls_a_eg*
2165
In such situations, you will need to convey to Latex-Suite that main.tex is the
2166
main file which \inputs the other files. This is done by creating a file called
2167
main.tex.latexmain in the same directory in which main.tex resides. This file is
2168
called the _master file_ in this manual. See Tex_MainFileExpression [|ls_a_eh|]
2169
for an alternative way of specifying the master file.
2171
NOTE: Here main.tex.latexmain is (obviously) a different file from main.tex
2172
itself. main.tex need not be renamed. This ofcourse restricts each
2173
directory to have a single master file.
2176
Each time Latex-Suite opens a new LaTeX file, it will try to see if it is part
2177
of a multiple file project by searching upwards (to the root of the file-system)
2178
from the current file's directory to see if it finds a file of the form
2179
*.latexmain. If such a file is found, then it is considered that the current
2180
file is part of a larger project. The name of the LaTeX master file is inferred
2181
directly from the first part of the *.latexmain file as described in the example
2185
--------------------------------------------------------------------------------
2186
Latex-Suite project settings *ls_9_1* *ls_a_cs*
2187
*latex-project-settings*
2189
If a master file [|ls_a_ct|] is found, then Latex-Suite :sources the file. Thus
2190
this file needs to contain valid Vim commands. This file is typically used to
2191
store project specific settings.
2193
Some typical per-project settings which are best put in the master file are
2194
Tex_ProjectSourceFiles [|ls_a_dt|]
2196
--------------------------------------------------------------------------------
2197
Specifying which file to compile *ls_9_2* *ls_a_ct*
2200
In the example described previously [|ls_a_ef|], if you are editing
2201
intro/intro.tex and press \ll, then you still want Latex-Suite to compile
2202
main.tex, because intro/intro.tex is merely a fragment which is \input'ed into
2203
main.tex. If the master file is already specified using the *.latexmain
2204
convention described previously [|ls_a_ef|], then Latex-Suite will automatically
2205
compile the master file when you are editing any of its \input'ed fragments.
2206
Thus pressing \ll while editing intro/intro.tex will compile main.tex.
2208
*Tex_MainFileExpression* *ls_a_eh*
2209
If you wish to use some different logic to specify the main file name, you can
2210
specify a custom expression via the Tex_MainFileExpression variable. This is a
2211
string containing a valid vim expression. In addition, you can use a variable
2212
modifier which is in the format used for |filename-modifiers|, for example,
2213
':p:h'. You should utilize this variable to modify the filename of the main
2215
let g:Tex_MainFileExpression = 'MainFile(modifier)'
2216
function! MainFile(fmod)
2217
if glob('*.latexmain') != ''
2218
return fnamemodify(glob('*.latexmain'), a:fmod)
2225
================================================================================
2226
Latex-Suite Commands and Maps *ls_10* *ls_a_cu*
2227
*latex-suite-commands-maps*
2229
|ls_10_1| Latex-Suite Maps
2230
|ls_10_2| Latex Suite Commands
2233
This section describes the maps and commands used in Latex-Suite. It also
2234
describes a way to change the map sequences according to your preference.
2237
--------------------------------------------------------------------------------
2238
Latex-Suite Maps *ls_10_1* *ls_a_cv*
2241
*remapping-latex-suite-keys* *ls_a_ei*
2242
Most of the mappings used in Latex-Suite can be mapped to a different key
2243
combination to suit your particular needs. An example best explains the
2244
procedure for doing this. Suppose you want to remap the <C-j> key which
2245
Latex-Suite (actually imaps.vim) uses to jump to the next placeholder. To do
2246
this, you first need to find out which <Plug> mapping <C-j> is derived from. You
2247
will need to look at the relevant section of this manual to do this. For
2248
example, the section IMAP mappings [|ls_a_cw|] has the information that the
2249
<C-j> key is derived from <Plug>IMAP_JumpForward. Therefore to remap the <C-j>
2250
key to say <C-space>, you will need to put a statement like the following in
2252
imap <C-space> <Plug>IMAP_JumpForward
2255
NOTE: To change the IMAP mappings which affect jumping between placeholders, the
2256
map statement above has to be placed in your ~/.vimrc. For other mappings
2257
you can place the map statement in your $VIM/ftplugin/tex.vim file. The
2258
reason for this is that the <C-j> maps are created in plugin/imaps.vim,
2259
which is sourced as soon as Vim starts before sourcing any ftplugin files.
2264
IMAP mappings *ls_10_1_1* *ls_a_cw*
2265
*customize-imap-maps*
2267
These mappings are utilized for jumping between placeholders as described here
2268
[|ls_a_eD|]. See the parent section [|ls_a_cv|] to find out how to use this
2269
information to change the default maps.
2271
*Plug_IMAP_JumpForward* *ls_a_ej*
2272
*Plug_IMAP_JumpBack* *ls_a_ek*
2273
*Plug_IMAP_DeleteAndJumpForward* *ls_a_el*
2274
*Plug_IMAP_DeleteAndJumBack* *ls_a_em*
2275
Plug map Default Key~
2276
<Plug>IMAP_JumpForward <C-j>
2277
<Plug>IMAP_JumpBack (none)
2278
<Plug>IMAP_DeleteAndJumpForward (none)
2279
<Plug>IMAP_DeleteAndJumpBack (none)
2281
<Plug>IMAP_JumpForward takes you to the location of the next place-holder
2284
<Plug>IMAP_JumpBack takes you to the previous place-holder [|ls_a_eD|].
2286
<Plug>IMAP_DeleteAndJumpForward deletes the presently selected place-holder and
2287
jumps to the next place-holder irrespective of whether the present placeholder
2288
is empty or not and ignoring the value of place-holder settings like
2289
g:Imap_DeleteEmptyPlaceHolders [|ls_a_cW|] and g:Imap_StickyPlaceHolders
2292
<Plug>IMAP_DeleteAndJumpBack deletes the presently selected place-holder and
2293
jumps to the previous place-holder irrespective of whether the present
2294
placeholder is empty or not and ignoring the value of place-holder settings like
2295
g:Imap_DeleteEmptyPlaceHolders [|ls_a_cW|] and g:Imap_StickyPlaceHolders
2299
Alt-Key mappings *ls_10_1_2* *ls_a_cx*
2300
*customize-alt-key-maps*
2302
These mappings are are described in the section Alt key macros [|ls_a_bA|]. See
2303
the parent section [|ls_a_ei|] to see how to use the following information to
2306
*Plug_Tex_MathBF* *ls_a_en*
2307
*Plug_Tex_MathCal* *ls_a_eo*
2308
*Plug_Tex_LeftRight* *ls_a_ep*
2309
*Plug_Tex_InsertItem* *ls_a_eq*
2310
Plug Mapping Default Key~
2311
<Plug>Tex_MathBF <Alt-B>
2312
<Plug>Tex_MathCal <Alt-C>
2313
<Plug>Tex_LeftRight <Alt-L>
2314
<Plug>Tex_InsertItem <Alt-I>
2316
--------------------------------------------------------------------------------
2317
Latex Suite Commands *ls_10_2* *ls_a_cy*
2318
*latex-suite-commands*
2322
:TMacro [{macro}] *ls_10_2_1* *ls_a_cz* *TMacro*
2324
When used without any arguments lists all available macros defined in runtime
2325
ftplugin/latex-suite/macros/ directories and prompts you to choose one of them.
2326
With one argument |:read| this macro under cursor position. With more than one
2327
argument it will not work :) In Vim >= 6.2 works completion of names of macros
2328
(see 'wildmenu', 'wildmode' for more about command-line completion).
2331
:TMacroEdit [{macro}] *ls_10_2_2* *ls_a_cA*
2334
Splits window for editing {macro}. When used without any arguments lists all
2335
available macros defined in runtime ftplugin/latex-suite/macros/ directories and
2336
prompt you to choose one of them. When you try to edit {macro} not from local
2337
directory Latex-Suite will copy it to your local directory with suffix "-local".
2338
If local copy already exists Latex-Suite prompt for overwriting it. In Vim >=
2339
6.2 works completion of names of macros (see 'wildmenu', 'wildmode' for more
2340
about command-line completion).
2343
:TMacroNew *ls_10_2_3* *ls_a_cB*
2346
Splits window to write new macro. Directory in new buffer is locally changed to
2347
Latex-Suite/macros/.
2350
:TMacroDelete [{macro}] *ls_10_2_4* *ls_a_cC*
2353
Delets {macro} from your local ftplugin/latex-suite/macros/ directory. When used
2354
without any arguments lists all available macros defined in Latex-Suite/macros/
2355
directory and prompt you to choose one of them. When you choose to delete
2356
{macro} which is not in your local directory Latex-Suite will refuse to delete
2357
it. In Vim >= 6.2 works completion of names of macros (see 'wildmenu',
2358
'wildmode' for more about command-line completion)
2361
:TPackage [{package, ...}] *ls_10_2_5* *ls_a_cD*
2364
When used without any arguments lists name of the packages for which support is
2365
available. If you are using Vim GUI and have Tex_Menus set to 1, then it will
2366
list all files found in the $VIM/ftplugin/latex-suite/packages directory.
2367
Otherwise, Latex-Suite will list files found in the
2368
$VIM/ftplugin/latex-suite/dictionaries directory. Choosing a file from the list
2370
\usepackage[<++>]{<packname>}
2371
line into the buffer at the current cursor location. For Vim 6.2 and above, you
2372
can use command-line completion to choose a package file. You can also call
2373
TPackage with one or more package names separated with spaces in which case,
2374
Latex-Suite will insert \usepackage lines for each of them in turn.
2376
After inserting the \usepackage line(s), Latex-Suite will support it (them) in
2377
various ways as described in the section Actions taken for supported packages
2381
:TPackageUpdate *ls_10_2_6* *ls_a_cE*
2384
This command `reads' name of package under cursor and turns on possible support.
2387
:TPackageUpdateAll *ls_10_2_7* *ls_a_cF*
2390
After issuing this command latexSuite scans the file in looking for not declared
2391
packages, removing not needed entries from Packages menu and turning off not
2392
necessary packages' dictionaries.
2395
:TTemplate [{template}] *ls_10_2_8* *ls_a_cG*
2398
When used without any arguments lists all available templates from
2399
latex-suite/templates/ directory and prompts to choose one of them. With one
2400
argument :0|read| {template} file. With more than one argument it will not work
2401
:) In Vim >= 6.2 works completion of names of macros (see 'wildmenu', 'wildmode'
2402
for more about command-line completion)
2405
:TSection [{argument}] *ls_10_2_9* *ls_a_cH*
2408
Used without any arguments inserts last section type (|latex-sectioning|).
2409
Accepts arguments: n> inserts section name in <n> logical level. Levels are:
2419
+<n> inserts section name <n> logical levels above the last used comand
2420
-<n> inserts section name <n> logical levels below the last used comand
2421
+ inserts section name one logical level below the last used command (equal
2424
- inserts section name one logical level over the last used command (equal
2426
-- inserts section name two logical levels over the last used command (equal
2431
Command accepts also latexSuite mappings (|latex-macros|) without preceding S
2434
will result in \part{}. It is possible to use full names of sections: :TSection
2438
:TSectionAdvanced *ls_10_2_10* *ls_a_cI*
2441
Accepts the same arguments as |TSection| but leads to a couple of questions
2442
(whether you want to include the section in the table of contents, whether there
2443
is a shorter name for the table of contents) and then creates a more intelligent
2447
:TLook *ls_10_2_11* *ls_a_cJ* *TLook*
2449
Accepts one argument. Will look through .tex files in directory of edited file
2450
for argument. It can be regexp. You don't have to enclose argument in "". <cr>
2451
takes you to location. Other keys work as described in |latex-viewer|. Note:
2452
TLook uses :grep command and is using 'grepprg'. Its regular expressions can be
2453
different from those of Vim.
2456
:TLookBib *ls_10_2_12* *ls_a_cK*
2459
Accepts one argument. Will look through .bib files in directory of edited file
2460
for argument. It can be regexp. You don't have to enclose argument in "". <cr>
2461
takes you to location. Other keys work as described in |latex-viewer|.
2463
NOTE: TLookBib uses :grep command and is using 'grepprg'. Its regular
2464
expressions can be different from those of Vim.
2469
:TLookAll *ls_10_2_13* *ls_a_cL*
2472
Accepts one argument. Will look through all files in directory of edited file
2473
for argument. It can be regexp. You don't have to enclose argument in "". <cr>
2474
takes you to location. Other keys work as described in |latex-viewer|. Note:
2475
TLook uses :grep command and is using 'grepprg'. Its regular expressions can be
2476
different from those of Vim.
2479
:TPartComp *ls_10_2_14* *ls_a_cM*
2482
No argument allowed but accepts range in all formats. Define fragment of
2483
interest with :'a,'b, :/a/,/b/, :'<,'> or :20,30. All other rules of compilation
2487
:TPartView *ls_10_2_15* *ls_a_cN*
2490
Show last compiled fragment. All rules of viewing apply but |latex-searching|.
2493
:Tshortcuts [{arg}] *ls_10_2_16* *ls_a_cO*
2496
Show shortcuts in terminal (not using menu). Without {arg} you will see simple
2497
menu prompting for one of them. Possible arguments:
2499
e Environment shortcuts
2505
================================================================================
2506
Customizing Latex-Suite *ls_11* *ls_a_cP*
2507
*customizing-latex-suite*
2509
|ls_11_1| General Settings
2510
|ls_11_2| Place-Holder Customization
2511
|ls_11_3| Macro Customization
2512
|ls_11_4| Smart Key Customization
2513
|ls_11_5| Latex Completion Customization
2514
|ls_11_6| Compiler Customization
2515
|ls_11_7| Viewer Customization
2516
|ls_11_8| Menu Customization
2517
|ls_11_9| Folding Customization
2518
|ls_11_10| Package Handling Customization
2521
Customizing Latex-Suite is done by defining certain global variables in
2522
$VIM/ftplugin/tex.vim, where $VIM corresponds to ~/.vim for *nix machines and
2523
~/vimfiles for windows machines. This file is not part of the Latex-Suite
2524
distribution. You will need to create this file yourself (or modify it if it
2525
exists) if you need to change any default settings. Since this file is not
2526
included as part of the Latex-Suite distribution, it will not be over-written in
2529
The default settings in Latex-Suite are defined in
2530
$VIM/ftplugin/latex-suite/texrc. Please take a look at this file if you find
2531
this documentation incomplete or confusing. That file is also well documented.
2533
This chapter describes the various settings which effect Latex-Suite and their
2534
default values. The settings are broken up into sections according to the
2535
behavior which they influence.
2538
--------------------------------------------------------------------------------
2539
General Settings *ls_11_1* *ls_a_cQ*
2540
*ls-general-purpose-settings*
2544
Tex_Debug *ls_11_1_1* *ls_a_cR*
2550
If set to 1, then Latex-Suite will create certain global debug statements which
2551
can be printed by doing >
2552
:call Tex_PrintDebug()
2556
Tex_UsePython *ls_11_1_2* *ls_a_cS*
2562
If Latex-Suite detects that your vim is python enabled (using has('python')),
2563
then it tries to use python in certain places to speed things up. If this
2564
misbehaves, you can set this to zero, in which case, Latex-Suite will use
2565
vimscript to accomplish the same.
2567
--------------------------------------------------------------------------------
2568
Place-Holder Customization *ls_11_2* *ls_a_cT*
2569
*customizing-place-holders*
2571
Latex-Suite uses place-holders [|ls_a_eD|] to minimize using the movement keys
2572
while typing. The following settings affect how place-holders are used.
2574
NOTE: These setting need to be set in your ~/.vimrc, not $VIM/ftplugin/tex.vim
2575
because these settings affect the behavior of imaps.vim, which is a global
2576
plugin, not a file-type plugin.
2581
g:Imap_UsePlaceHolders *ls_11_2_1* *ls_a_cU*
2582
*Imap_UsePlaceHolders*
2588
Setting this to zero completely disables using place-holders.
2591
g:Imap_PlaceHolderStart & g:Imap_PlaceHolderEnd *ls_11_2_2* *ls_a_cV*
2592
*Imap_PlaceHolderStart*
2594
*Imap_PlaceHolderEnd* *ls_a_er*
2596
Imap_PlaceHolderStart String '<+'
2597
Imap_PlaceHolderEnd String '+>'
2599
These settings affect the strings displayed at the beginning and end of the
2600
place-holder string. Set these strings to a value different than a commonly
2601
occurring sequence of characters.
2605
If you use the latin1 encoding and do not type in french, then you can set
2606
these strings to the \xab and \xbb characters (the french quotation
2612
g:Imap_DeleteEmptyPlaceHolders *ls_11_2_3* *ls_a_cW*
2613
*Imap_DeleteEmptyPlaceHolders*
2619
When set to one, non-descriptive or empty place-holders are deleted on pressing
2623
g:Imap_StickyPlaceHolders *ls_11_2_4* *ls_a_cX*
2624
*Imap_StickyPlaceHolders*
2630
When set to 1, in visual mode, <Ctrl-J> takes you to the next placeholder
2631
without deleting the current placeholder.
2633
--------------------------------------------------------------------------------
2634
Macro Customization *ls_11_3* *ls_a_cY*
2635
*customizing-macros*
2639
Tex_Env_name *ls_11_3_1* *ls_a_cZ*
2642
If you wish to wish to expand certain environments differently from the way
2643
Latex-Suite does it, you can define custom expansions using global variables of
2644
the form Tex_Env_{name} where name corresponds to the environment.
2646
For example, if you press <F5> after typing theorem, Latex-Suite will by default
2651
However, if you wish change this to >
2655
then define the following variable >
2656
let g:Tex_Env_theorem = "\\begin{theorem}\<CR><++>\<CR>\\end{theorem}"
2659
If the expansion uses special keys such as carriage return etc, then use
2660
double-quotes and use the "\<key>" notation for special keys. Backslashes have
2663
You could even use strings returned by functions as the expansion by using the
2664
IMAP_PutTextWithMovement() [|ls_a_ea|] function.
2666
If the name of the environment contains special characters (for example, the
2667
eqnarray* environment), then use the following form: >
2668
let g:Tex_Env_{'eqnarray*'} =
2669
\ "\\begin{eqnarray*}\<CR><++> &=& <++>\<CR>\\end{eqnarray*}<++>"
2670
This will make pressing <F5> after eqnarray* expand to >
2677
Tex_Com_name *ls_11_3_2* *ls_a_da*
2680
If you wish to define new expansions for fast command insertion as described
2681
here [|ls_a_bo|], or redefine expansions from the default values in Latex-Suite,
2682
you will need to define variables of the form g:Tex_Com_{name} where name is a
2683
command name. For example, with the setting >
2684
let g:Tex_Com_frac = "\\frac{<++>}{<++>}<++>"
2685
pressing <F7> after typing frac will change it to \frac{<++>}{<++>}<++>
2687
See Tex_Env_name [|ls_a_cZ|] for additional details on how to create this
2688
setting in various special circumstances.
2691
Enabling / disabling macros *ls_11_3_3* *ls_a_db*
2694
The following variables disable various parts of the macro functionality of
2695
Latex-Suite. See the links to the relevant sections to see what functionality
2696
setting each of the variables to zero will take away.
2698
*Tex_EnvironmentMaps* *ls_a_es*
2699
*Tex_EnvironmentMenus* *ls_a_et*
2700
*Tex_FontMaps* *ls_a_eu*
2701
*Tex_FontMenus* *ls_a_ev*
2702
*Tex_SectionMaps* *ls_a_ew*
2703
*Tex_SectionMenus* *ls_a_ex*
2704
Setting Link to relevant section Default Value~
2705
g:Tex_EnvironmentMaps Environment Mappings [|ls_a_bf|] 1
2706
g:Tex_EnvironmentMenus 1
2707
g:Tex_FontMaps Font Mappings [|ls_a_bs|] 1
2709
g:Tex_SectionMaps Section Mappings [|ls_a_bt|] 1
2710
g:Tex_SectionMenus 1
2713
g:Tex_UseMenuWizard *ls_11_3_4* *ls_a_dc*
2720
If this variable is set to 1, then when an environment is chosen from the menu
2721
then for selected environments, Latex-Suite asks a series of questions on the
2722
command line and inserts a template with the corresponding fields already filled
2723
in. Setting this to zero will insert a template with place-holders [|ls_a_eD|]
2724
marking off the places where fields need to be filled.
2727
g:Imap_FreezeImap *ls_11_3_5* *ls_a_dd*
2733
This option when set to 1, temporarily freezes Latex-Suite's macro expansion. It
2734
might be useful when you are using some other keymap which is causing excessive
2735
macro expansion. Use a buffer-local variable of the same name if you wish to
2736
affect just the present buffer.
2739
g:Tex_CatchVisMapErrors *ls_11_3_6* *ls_a_de*
2740
*Tex_CatchVisMapErrors*
2746
With so many visual maps, its helpful to have a way of catching typing errors
2747
made in visual mode. What this does is to prompt you to correct your visual mode
2748
mapping if you start out with and then type some illegal keys. It basically maps
2749
just the g:Tex_Leader character to a function.
2752
g:Tex_Diacritics *ls_11_3_7* *ls_a_df*
2759
Whether or not you want to use diacritics [|ls_a_bw|].
2762
g:Tex_Leader *ls_11_3_8* *ls_a_dg*
2769
The mappings in Latex-Suite are by default prefixed with the back-tick
2770
character. For example, `/ inserts \frac{<++>}{<++>}<++> etc. You can change the
2771
prefix with the following setting. ',', '/', '`' are preferred values. '' or '\'
2772
will lead to a _lot_ of trouble.
2774
g:Tex_Leader is also used for visual mode mappings for fonts.
2777
g:Tex_Leader2 *ls_11_3_9* *ls_a_dh*
2784
In order to avoid clashes between the large number of visual mode macros
2785
provided, the visual mode macros for environments [|ls_a_bm|] and sections start
2786
with a character different from g:Tex_Leader.
2789
g:Tex_PromptedEnvironments *ls_11_3_10* *ls_a_di*
2790
*Tex_PromptedEnvironments*
2794
Default Value 'eqnarray*,eqnarray,equation,equation*,\[,$$,align,align*'
2796
This string represents a comma separated list of fields corresponding to
2797
environments. Pressing <F5> in insert-mode in the body of the document asks you
2798
to choose from one of these environments to insert.
2800
Leaving this string empty will leave the <F5> key unmapped
2803
g:Tex_HotKeyMappings *ls_11_3_11* *ls_a_dj*
2804
*Tex_HotKeyMappings*
2808
Default Value 'eqnarray*,eqnarray,bmatrix'
2810
This string represents a comma separated list of environments which are mapped
2811
to <Shift-F-1> through <Shift-F-4>. For example, pressing <Shift-F-2> with this
2812
setting inserts the eqnarray environment.
2814
Leaving this string empty will leave <Shift-F-1> through <Shift-F-4> unmapped.
2816
NOTE: Only the first four fields of this list are used. The rest are silently
2822
g:Tex_PromptedCommands *ls_11_3_12* *ls_a_dk*
2823
*Tex_PromptedCommands*
2827
Default Value 'footnote,cite,pageref,label'
2829
This string represents a comma separated list of LaTeX commands which
2830
Latex-Suite uses for the <F7> and <S-F7> maps as described here [|ls_a_bo|].
2832
Leaving this string empty will leave the <F7> key unmapped.
2835
Tex_ItemStyle_environment *ls_11_3_13* *ls_a_dl*
2836
*Tex_ItemStyle_environment*
2838
This setting affects the style which Latex-Suite uses to insert an \item when
2839
<Alt-I> is pressed as described here [|ls_a_bE|]. By default Latex-Suite defines
2840
styles for the following environments:
2846
thebibliography \item[<+biblabel+>]{<+bibkey+>} <++>
2847
description \item[<+label+>] <++>
2849
Each style is defined by a variable of the form g:Tex_ItemStyle_{envname} where
2850
envname is the name of the environment for which the style is defined. For
2851
example, by default >
2852
g:Tex_ItemStyle_description = '\item[<+label+>] <++>'
2853
Redefining the style for a particular environment or defining a style for an
2854
entirely new environment is simply a matter of setting the value of a variable
2855
of the corresponding name.
2857
--------------------------------------------------------------------------------
2858
Smart Key Customization *ls_11_4* *ls_a_dm*
2859
*customizing-smart-keys*
2861
These settings affect the smart key functionality as described here [|ls_a_bz|].
2865
g:Tex_SmartKeyBS *ls_11_4_1* *ls_a_dn*
2872
Whether or not <Backspace> deletes diacritics.
2875
g:Tex_SmartKeyQuote *ls_11_4_2* *ls_a_do*
2882
Whether or not the smart quotes [|ls_a_bz|] functionality is available.
2884
If enabled, the quote characters can be customized by setting the following
2888
g:Tex_SmartQuoteOpen "``"
2889
g:Tex_SmartQuoteClose "''"
2891
Non-English users will want to change these settings to their locale. These
2892
global variables will be ignored if there are buffer-local variables (with the
2893
same name), which may be set in the language specific package files, such as
2894
$VIM/ftplugin/latex-suite/packages/german.
2896
--------------------------------------------------------------------------------
2897
Latex Completion Customization *ls_11_5* *ls_a_dp*
2898
*customizing-latex-completion*
2900
The following settings affect the completion [|ls_a_bR|] functionality in
2905
Window size settings *ls_11_5_1* *ls_a_dq*
2906
*completion-window-preferences*
2908
These three settings affect the aesthetics of the completion functionality.
2910
*Tex_ViewerCwindowHeight* *ls_a_ey*
2911
*Tex_ViewerPreviewHeight* *ls_a_ez*
2912
*Tex_ExplorerHeight* *ls_a_eA*
2913
*Tex_ImageDir* *ls_a_eB*
2914
Setting Explanation Default Value~
2915
g:Tex_ViewerCwindowHeight The height of the cwindow which 5
2916
displays the list of \labels
2918
g:Tex_ViewerPreviewHeight The height of the preview window 10
2919
which shows the context of a
2921
g:Tex_ExplorerHeight The height of the explorer 10
2922
window which lists the files
2923
from which to choose an image
2925
g:Tex_ImageDir The directory to scan for images ''
2928
g:Tex_BIBINPUTS *ls_11_5_2* *ls_a_dr*
2935
This string describes the directories which are scanned while trying to search
2936
for .bib and .bbl files. See the cite completion section [|ls_a_bU|] for more
2939
This string should be set in the syntax accepted by Vim's native 'path' setting.
2940
Do not include the present directory '.'. While searching for bibliography
2941
files, the present directory will be prepended to this variable.
2944
Tex_UseSimpleLabelSearch *ls_11_5_3* *ls_a_ds*
2945
*Tex_UseSimpleLabelSearch*
2947
When set to 1, Latex-Suite searches for \labels in all .tex files in the
2948
directory containing the file being edited when <F9> is pressed. See \ref
2949
completion [|ls_a_bT|] for details.
2952
g:Tex_ProjectSourceFiles *ls_11_5_4* *ls_a_dt*
2953
*Tex_ProjectSourceFiles*
2959
This setting is meant to be initialized on a per-project basis using the
2960
Latex-Suite master file [|ls_a_ct|] as described in Latex-Suite Project
2961
[|ls_a_cr|] section. It is a list of source files which are used in the project.
2962
If defined, then instead of using the logic described in
2963
Tex_UseSimpleLabelSearch [|ls_a_ds|] to search for files in which to search for
2964
\labels, we simply search for \labels in this list. This significantly reduces
2965
the time it takes to generate the list of possible completions for large
2968
The list is specified as a whitespace separated list of filenames relative to
2969
the location of the main file.
2972
g:Tex_RememberCiteSearch *ls_11_5_5* *ls_a_du*
2973
*Tex_RememberCiteSearch*
2979
When this variable is non-zero, then Latex-Suite will try to remember results
2980
from the \cite completion as described in this section [|ls_a_bV|].
2982
--------------------------------------------------------------------------------
2983
Compiler Customization *ls_11_6* *ls_a_dv*
2984
*customizing-compiling*
2986
The following settings affect Latex-Suite's compilation functionality
2990
g:Tex_DefaultTargetFormat *ls_11_6_1* *ls_a_dw*
2991
*Tex_DefaultTargetFormat*
2995
Default Value dvi for windows/*nix and pdf for mac
2997
Use this setting to choose the default target format. For example, setting this
2998
to pdf makes Latex-Suite compile a pdf file when you press \ll and fire up the
2999
pdf viewer on pressing \lv. Make sure that a rules for compiling and viewing
3000
have been defined for this target format as described here [|ls_a_dx|] and here
3004
g:Tex_CompileRule_<format> *ls_11_6_2* *ls_a_dx*
3005
*Tex_CompileRule_format*
3007
Here <format> refers to the target format for which this rule is defined.
3008
Latex-Suite supports compiling into dvi, ps and pdf by default. All these rules
3009
are strings defined by default as follows:
3012
g:Tex_CompileRule_dvi 'latex -interaction=nonstopmode $*'
3013
g:Tex_CompileRule_ps 'ps2pdf $*'
3014
g:Tex_CompileRule_pdf 'pdflatex -interaction=nonstopmode $*'
3016
If you desire forward and inverse searching via Latex-Suite, you will need to
3017
change g:Tex_CompileRule_dvi to include -src-specials. However, this has been
3018
known to cause problems with the output file. Therefore, use this with care.
3021
g:Tex_FormatDependency_<format> *ls_11_6_3* *ls_a_dy*
3026
By default, there are no format dependencies defined. Each definition is of the
3027
form above where <format> is a string such as 'dvi' etc.
3029
The value of each string is a comma separated string such as 'dvi,ps'. See the
3030
Compiler dependency [|ls_a_ca|] section to see how to use/specify this setting
3033
g:Tex_MultipleCompileFormats *ls_11_6_4* *ls_a_dz*
3034
*Tex_MultipleCompileFormats*
3039
This is a comma separated string of formats for which the compiler needs to be
3040
called multiple times in order to get cross-references, citations etc right. See
3041
the Compiling multiple times [|ls_a_cb|] section for details.
3044
g:Tex_IgnoredWarnings *ls_11_6_5* *ls_a_dA*
3045
*Tex_IgnoredWarnings*
3049
Default Value a new-line separated list of patterns as described below
3051
The default value of this setting is >
3054
\"specifier changed to\n".
3055
\"You have requested\n".
3056
\"Missing number, treated as zero.\n".
3057
\"There were undefined references\n"
3058
\"Citation %.%# undefined"
3059
This setting defines a set of patterns which will be filtered out when
3060
displaying the output from the latex compiler. This is to aid in filtering out
3061
very common warnings/errors.
3063
NOTE: Remember to check the value of g:Tex_IgnoreLevel [|ls_a_dB|] when you
3064
change this setting. For example, if you append a new pattern which you
3065
would like to ignore by default, increase the value of g:Tex_IgnoreLevel.
3070
g:Tex_IgnoreLevel *ls_11_6_6* *ls_a_dB*
3077
This setting defines a "filter level" or an "ignore level". A value of 7 for
3078
instance means that any warning/error matching with any of the first 7 fields of
3079
g:Tex_IgnoredWarnings [|ls_a_dA|] will be ignored. Setting this value to zero
3080
will mean that no error/warning is ignored. However, even with a value of zero,
3081
Latex-Suite will filter out most of the text which a LaTeX compiler typically
3084
from within Vim in order to see all the lines from the compiler's output.
3087
Tex_UseMakefile *ls_11_6_7* *ls_a_dC*
3093
When set to 1, then if a makefile or Makefile is present in the current
3094
directory, then Latex-Suite sets the makeprg option to just "make <target>",
3095
where <target> is the target format chosen using the TCTarget or TTarget
3098
When set to 0, then Latex-Suite will set the makeprg setting to whatever is
3099
defined by the g:Tex_CompileRule_target [|ls_a_dx|] setting.
3102
g:Tex_GotoError *ls_11_6_8* *ls_a_dD*
3109
If set to 1, then pressing \ll will take you to the location of the first
3110
warning/error, otherwise you will remain in the original location but the
3111
errors/warnings will be listed in the preview window.
3113
--------------------------------------------------------------------------------
3114
Viewer Customization *ls_11_7* *ls_a_dE*
3115
*customizing-viewing*
3117
The following settings affect how Latex-Suite will display compiled files.
3121
g:Tex_ViewRule_<format> *ls_11_7_1* *ls_a_dF*
3122
*Tex_ViewRule_format*
3124
Here <format> refers to a format such as dvi, ps, etc. This variable defines the
3125
program which will be called to display a file of that format.
3127
By default, Latex-Suite defines viewer programs for viewing DVI, PS and PDF
3131
g:Tex_ViewRule_dvi 'yap -1' 'xdvi'
3132
g:Tex_ViewRule_ps 'gsview32' 'ghostview'
3133
g:Tex_ViewRule_pdf 'AcroRd32' 'xpdf'
3135
For Macintosh systems, these strings are left empty by default. This lets the
3136
system pick the program for each format. If you define these variables for Mac,
3137
the system choice will be over-ridden.
3139
Latex-Suite appends file.format to the above settings while calling the external
3140
programs. For example, with >
3141
let g:Tex_ViewRule_dvi = 'yap -1'
3143
!start yap -1 file.dvi
3144
from within Vim. (The initial start is used on Windows platforms is to make yap
3145
start as a separate process.) If you find the way Latex-Suite constructs the
3146
command line too restrictive, you can use the Tex_ViewRuleComplete_format
3147
[|ls_a_dG|] setting for more complete control on how the command line is
3148
constructed while calling the external program for viewing.
3150
NOTE: For windows, you will need to set the $PATH variable to include the paths
3151
to yap, AcroRd32, gsview32 and any other programs. See your system
3152
documentation for how to do this.
3155
NOTE: Default Viewing Format
3156
----------------------
3157
To change the default format for viewing files, set the
3158
g:Tex_DefaultTargetFormat [|ls_a_dw|] variable.
3163
Tex_ViewRuleComplete_<format> *ls_11_7_2* *ls_a_dG*
3164
*Tex_ViewRuleComplete_format*
3166
Here <format> refers to the extension of a output format such as dvi, html etc.
3168
Tex_ViewRuleComplete_format takes precedence over Tex_ViewRule_format if both
3169
are specified. By default, Latex-Suite does not define values for
3170
Tex_ViewRuleComplete_format for any format. Unlike in the case of
3171
Tex_ViewRule_format, Latex-Suite does not modify Tex_ViewRuleComplete_format at
3172
all in constructing the command line. The only modification is to substitute
3173
'$*' everywhere in the string with the name of the file being viewed (without
3178
Make sure you make the process go into the background otherwise vim will
3179
wait for the viewer to terminate before letting you edit the file again.
3181
To make a process go into the background on a *nix platform, use a
3182
trailing & in the setting. On Windows, use start at the beginning of the
3183
setting. Example: Suppose you have a latex->html converter which converts
3184
a file say foo.tex to a file foo/index.html. Then you would use: >
3186
let g:Tex_ViewRuleComplete_html = 'MozillaFirebird $*/index.html &'
3187
" On windows platform
3188
let g:Tex_ViewRuleComplete_html = 'start MozillaFirebird $*/index.html'
3193
--------------------------------------------------------------------------------
3194
Menu Customization *ls_11_8* *ls_a_dH*
3197
In addition to using the variables defined in this section to affect the
3198
menu-layout permanently (i.e, the layout Latex-Suite will start with), you can
3199
also use the TeX-Suite > Configure Menu menu to dynamically configure the menu
3200
layout after Latex-Suite has started.
3204
g:Tex_Menus *ls_11_8_1* *ls_a_dI*
3211
If set to 0, Latex-Suite will suppress showing all menus. Useful if you mostly
3215
g:Tex_MainMenuLocation *ls_11_8_2* *ls_a_dJ*
3216
*Tex_MainMenuLocation*
3222
This setting decides the location of the first top-level Latex-Suite menu. You
3223
can for example shift all the menus created by Latex-Suite to the very end by
3224
setting this value to a large number like 990.
3227
g:Tex_MathMenus *ls_11_8_3* *ls_a_dK*
3234
The Tex-Math menu consists of hundreds of mathematical symbols used in LaTeX.
3235
This menu comprises about 75% of the menus.
3238
g:Tex_NestElementMenus *ls_11_8_4* *ls_a_dL*
3239
*Tex_NestElementMenus*
3245
This setting controls the "compactness" of the menus. If set to 1, then the
3246
Font, Counter and Dimensioning menus are collected together in a single menu
3247
called Tex-Elements, otherwise, they will each get a separate menu.
3250
g:Tex_PackagesMenu *ls_11_8_5* *ls_a_dM*
3257
Setting this to zero will stop Latex-Suite from automatically creating the
3258
TeX-Suite > Packages > Supported menu at startup. You can still create the menu
3259
after startup by going to TeX-Suite > Configure Menu.
3262
g:Tex_NestPackagesMenu *ls_11_8_6* *ls_a_dN*
3263
*Tex_NestPackagesMenu*
3267
Default Value 'TeX-'
3269
This string is the prefix added to all the menus created by Latex-Suite. If you
3270
define this variable with a dot ('.') as the last character, then all the menus
3271
created by Latex-Suite will be nested under a single master menu. For example,
3272
set this to '&LaTeX-Suite.' to nest all menus under a menu called &LaTeX-Suite.
3275
g:Tex_UseUtfMenus *ls_11_8_7* *ls_a_dO*
3282
This setting controls whether Latex-Suite uses utf-8 symbols to display some of
3283
the mathematical symbols in the TeX-Math menu. It is necessary for your
3284
system/GUI to support utf-8. Setting this to 1 has the side-effect of setting
3285
the 'encoding' option of Vim to 'utf-8'.
3287
--------------------------------------------------------------------------------
3288
Folding Customization *ls_11_9* *ls_a_dP*
3289
*customizing-folding*
3291
The following settings control the folding [|ls_a_ci|] functionality of
3296
g:Tex_Folding *ls_11_9_1* *ls_a_dQ*
3303
Setting this to zero completely disables Latex-Suite's folding functionality.
3304
However, the TexFoldTextFunction() is still available in case you want to use
3305
another folding scheme but still want to continue using the fold text function.
3308
g:Tex_AutoFolding *ls_11_9_2* *ls_a_dR*
3315
This setting controls whether Latex-Suite automatically creates manual folds for
3316
a file when it is opened. You can still use the \rf mapping to refresh/create
3317
folds even when this variable is set to zero.
3319
--------------------------------------------------------------------------------
3320
Package Handling Customization *ls_11_10* *ls_a_dS*
3321
*customizing-packages*
3323
These settings affect the custom packages [|ls_a_bN|] functionality in
3328
g:Tex_TEXINPUTS *ls_11_10_1* *ls_a_dT*
3335
This setting describes the directories scanned by Latex-Suite while searching
3336
for custom user packages as described in the custom packages [|ls_a_bN|]
3337
section. Do not include the present directory in this setting. The present
3338
directory is always scanned for custom packages.
3340
This string should be set in the syntax accepted by Vim's native 'path' setting.
3342
================================================================================
3343
Credits *ls_12* *ls_a_dU*
3344
*latex-suite-credits*
3348
And finally, the credits:
3351
Artur R. Czechowski maintains the BSD package of Latex-Suite. Lots of valuable
3353
Lubomir Host provided the diacritics and also helped in development.
3354
Alexander Wagner valuable suggestions during development.
3355
Luc Hermitte his variation of Stephen Riehm's bracketing system is used
3357
Gergely Kontra the clever little JumpFunc() in imaps.vim is due to him.
3358
The implementation of the templates also borrows from
3359
mu-template.vim by him.
3360
Dimitri Antoniou author of ltags and also provided the nice tip about
3361
forward / reverse search on DVI documents.
3362
Stephen Riehm the extremely helpful bracketing system is from him.
3363
Alan Schmitt provided macros/folding elements. Continued feedback,
3365
Hari Krishna Dara for ExecMap(), the clever little function which makes
3366
typing visual mode mappings so much easier and error-free.
3367
Alan G Isac for the comprehensive BibT() function for entering bibtex
3369
Gontran Baerts for libList.vim
3370
Peter Heslin useful discussion and also a lot of bug fixes. the
3371
%%fakesection in folding.vim.
3372
Zhang Lin-bo lots of very useful additions to folding. The code for
3373
customizing the folding scheme is due to him.
3375
A large number of functions in Latex-Suite come from various other people. Some
3376
of those people might have been missed here. Each function should however have
3377
the author's name/e-mail above it. Thats the more authoritative place to check
3378
out who has done what.
3380
*latex-suite-maintainer* *ls_a_eC*
3381
The current maintainer(s) of Latex-Suite is(are)
3384
Srinath Avadhanula <srinath@fastmail.fm>
3386
Mikolaj Machowski <mikmach@wp.pl>
3388
Benji Fisher <benji@member.AMS.org>
3390
================================================================================
3391
URLs used in this file
3393
*ls_u_1* : http://vim-latex.sourceforge.net
3394
*ls_u_2* : http://vim-latex.sourceforge.net/index.php?subject=download
3395
*ls_u_3* : http://www.cygwin.com
3396
*ls_u_4* : http://www.google.com/search?q=windows%20gnu%20grep
3398
================================================================================
3401
This file was created automatically from its XML variant using db2vim. db2vim is
3402
a python script which understands a very limited subset of the Docbook XML 4.2
3403
DTD and outputs a plain text file in vim help format.
3405
db2vim can be obtained via anonymous CVS from sourceforge.net. Use
3407
cvs -d:pserver:anonymous@cvs.vim-latex.sf.net:/cvsroot/vim-latex co db2vim
3409
Or you can visit the web-interface to sourceforge CVS at:
3410
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vim-latex/db2vim/
3412
The following modelines should nicely fold up this help manual.
3414
vim:ft=help:fdm=expr:nowrap
3415
vim:foldexpr=getline(v\:lnum-1)=~'-\\{80}'?'>2'\:getline(v\:lnum-1)=~'=\\{80}'?'>1'\:getline(v\:lnum)=~'=\\{80}'?'0'\:getline(v\:lnum)=~'-\\{80}'?'1'\:'='
3416
vim:foldtext=substitute(v\:folddashes.substitute(getline(v\:foldstart),'\\s*\\*.*',"",""),'^--','\ \ \ \ \ \ ','')
3417
================================================================================