Initial import of my home directory
[home/.git] / .vim / doc / latex-suite.txt
1                               Latex-Suite Reference
2                                 *latex-suite.txt*
3                  Srinath Avadhanula <srinath AT fastmail DOT fm>
4                     Mikolaj Machowski <mikmach AT wp DOT pl>
5                                         
6
7
8                                     Abstract
9                                     ========
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
15 have helped.
16
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.
21
22 Homepage: http://vim-latex.sourceforge.net |ls_u_1|
23
24
25
26                                                            *latex-suite.txt-toc*
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
36     |ls_3_7| Diacritics
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
63 |ls_8| Latex Folding
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
84 |ls_12| Credits
85
86 ================================================================================
87 Viewing this file
88
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.
93
94 See |usr_28.txt| for an introduction to folding and |fold-commands| for key
95 sequences and commands to work with folds.
96
97 ================================================================================
98 Installation and recommended Settings                           *ls_1* *ls_a_bc*
99                                                           *recommended-settings*
100
101
102
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|.
106
107 Make sure that you create a few necessary settings in your ~/.vimrc.  >
108     
109     " REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
110     filetype plugin on
111     
112     " IMPORTANT: win32 users will need to have 'shellslash' set so that latex
113     " can be called correctly.
114     set shellslash
115     
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\ $*
120     
121     " OPTIONAL: This enables automatic indentation as you type.
122     filetype indent on
123     
124
125
126 In addition, the following settings could go in your ~/.vim/ftplugin/tex.vim
127 file:  >
128     " this is mostly a matter of taste. but LaTeX looks good with just a bit
129     " of indentation.
130     set sw=2
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!
134     set iskeyword+=:
135     
136
137
138 ================================================================================
139 Inserting Templates                                             *ls_2* *ls_a_bd*
140                                                          *latex-suite-templates*
141
142
143
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.
146
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.
151
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.
156
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.
161
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
166       one of them.
167       
168       
169
170 ================================================================================
171 Latex-Suite Macros                                              *ls_3* *ls_a_be*
172                                                                   *latex-macros*
173
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
180 |ls_3_7| Diacritics
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()
186
187
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.
190
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.
198       
199       
200                                                         *place-holder* *ls_a_dV*
201                                                        *place-holders* *ls_a_eD*
202 NOTE: Place Holders
203       -------------
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:  >
209           \begin{figure}[h]
210               \centerline{\psfig{figure=<+eps file+>}}
211               \caption{<+caption text+>}
212               \label{fig:<+label+>}
213           \end{figure}<++>
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.
220       
221       
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.
229       
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')
238 <     
239       
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|.
243             
244             
245       
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
252       the current buffer.
253       
254       
255 The following sections describe the various editing macros provided by
256 Latex-Suite.
257
258
259 --------------------------------------------------------------------------------
260 Environment Mappings                                          *ls_3_1* *ls_a_bf*
261                                                           *environment-mappings*
262
263 Latex-Suite provides a rich set of mappings to insert, enclose and modify LaTeX
264 environments, i.e, \begin{...} ... \end{...} pairs.
265
266 Inserting Environments                                      *ls_3_1_1* *ls_a_bg*
267                                                         *inserting-environments*
268
269 Latex-Suite provides the following ways to insert environments
270
271
272
273 Method 1: Pressing <F5>                                   *ls_3_1_1_1* *ls_a_bh*
274                                                               *inserting-env-f5*
275
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.
281
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.
284
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
287 [|ls_a_di|] setting.
288
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|]
291
292
293 Method 2: Using <S-F1>-<S-F4>                             *ls_3_1_1_2* *ls_a_bi*
294                                                         *inserting-env-shift-f1*
295
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.
299
300
301 Method 3: Using three letter sequences                    *ls_3_1_1_3* *ls_a_bj*
302                                                      *inserting-env-threeletter*
303
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
306 following rules:
307
308
309 1. All environment mappings begin with E
310
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
313    words. Example:  >
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
321 <  
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.
330
331
332 Enclosing in Environments                                   *ls_3_1_2* *ls_a_bk*
333                                                         *enclosing-environments*
334
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.
337
338
339
340 Method 1: Pressing <F5>                                   *ls_3_1_2_1* *ls_a_bl*
341                                                               *enclosing-env-f5*
342
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
348 chosen environment.
349
350
351 Method 2: Using three letter mappings                     *ls_3_1_2_2* *ls_a_bm*
352                                                      *enclosing-env-threeletter*
353
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:
359
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:  >
367     \begin{center}
368         line
369     \end{center}
370
371
372
373 Changing Environments                                       *ls_3_1_3* *ls_a_bn*
374                                                          *changing-environments*
375
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:  >
379     \begin{eqnarray}
380       \begin{array}{ccc}
381         2 & 3 & 4
382       \end{array}
383     \end{eqnarray}
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.
390
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.
393
394 --------------------------------------------------------------------------------
395 Command Mappings                                              *ls_3_2* *ls_a_bo*
396                                                             *latex-command-maps*
397
398 Latex-Suite provides a rich set of mappings to insert, enclose and modify LaTeX
399 commands.
400
401 Inserting LaTeX commands                                    *ls_3_2_1* *ls_a_bp*
402                                                             *inserting-commands*
403
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.
408
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|].
415
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.
422
423
424 Enclosing in a command                                      *ls_3_2_2* *ls_a_bq*
425                                                             *enclosing-commands*
426
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.
432
433
434 Changing commands                                           *ls_3_2_3* *ls_a_br*
435                                                              *changing-commands*
436
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.
440
441 --------------------------------------------------------------------------------
442 Font Mappings                                     *ls_3_3* *ls_a_bs* *font-maps*
443
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).
446
447 Mnemonic:
448 1. first letter is always F (F for font)
449
450 2. next 2 letters are the 2 letters describing the font.
451
452 Example: Typing FEM in insert-mode expands to \emph{<++>}<++>.
453
454 Just like environment mappings, you can visually select an area and press `sf to
455 have it enclosed in: \textsf{word} or  >
456     {\sffamily
457     line
458     }
459 depending on character-wise or line-wise selection.
460
461 --------------------------------------------------------------------------------
462 Section Mappings                                              *ls_3_4* *ls_a_bt*
463                                                               *section-mappings*
464
465 These maps insert LaTeX sections such as:  >
466     \section{<++>}<++>
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
469 selection.
470
471 Mnemonic: (make your own!)  >
472     SPA for part
473     SCH for chapter
474     SSE for section
475     SSS for subsection
476     SS2 for subsubsection
477     SPG for paragraph
478     SSP for subparagraph
479
480
481 Example: SSE in insert mode inserts  >
482     \section{<++>}<++>
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.
489
490 --------------------------------------------------------------------------------
491 Greek Letter Mappings                                         *ls_3_5* *ls_a_bu*
492                                                          *greek-letter-mappings*
493
494 Lower case
495
496 `a through `z expand to \alpha through \zeta.Upper case:
497
498   >
499     `D = \Delta
500     `F = \Phi
501     `G = \Gamma
502     `Q = \Theta
503     `L = \Lambda
504     `X = \Xi
505     `Y = \Psi
506     `S = \Sigma
507     `U = \Upsilon
508     `W = \Omega
509 NOTE: LaTeX does not support upper case for all greek alphabets.
510       
511       
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.
514
515 --------------------------------------------------------------------------------
516 Auc-Tex Key Bindings                                          *ls_3_6* *ls_a_bv*
517                                                               *auc-tex-mappings*
518
519 These are simple 2 key expansions for some very commonly used LaTeX elements:
520
521   >
522     `^   Expands To   \Hat{<++>}<++>
523     `_   expands to   \bar{<++>}<++>
524     `6   expands to   \partial
525     `8   expands to   \infty
526     `/   expands to   \frac{<++>}{<++>}<++>
527     `%   expands to   \frac{<++>}{<++>}<++>
528     `@   expands to   \circ
529     `0   expands to   ^\circ
530     `=   expands to   \equiv
531     `\   expands to   \setminus
532     `.   expands to   \cdot
533     `*   expands to   \times
534     `&   expands to   \wedge
535     `-   expands to   \bigcap
536     `+   expands to   \bigcup
537     `(   expands to   \subset
538     `)   expands to   \supset
539     `<   expands to   \le
540     `>   expands to   \ge
541     `,   expands to   \nonumber
542     `~   expands to   \tilde{<++>}<++>
543     `;   expands to   \dot{<++>}<++>
544     `:   expands to   \ddot{<++>}<++>
545     `2   expands to   \sqrt{<++>}<++>
546     `|   expands to   \Big|
547     `I   expands to   \int_{<++>}^{<++>}<++>
548 (again, notice the convenient place-holders)
549
550 In addition the visual mode macros are provided:
551
552   >
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
557                                           linewise selection
558
559
560 --------------------------------------------------------------------------------
561 Diacritics                                                    *ls_3_7* *ls_a_bw*
562                                                             *diacritic-mappings*
563
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.
569
570   >
571     +}       expands to \"{a}
572     +:       expands to \^{o}
573 Latex-Suite also ships with smart backspacing [|ls_a_dZ|] functionality which
574 provides another convenience while editing languages with diacritics.
575
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
580       diacritics.
581       
582       Set the g:Tex_Diacritics [|ls_a_df|] variable to enable diacritics.
583       
584       
585
586 --------------------------------------------------------------------------------
587 BibTeX Shortcuts                                              *ls_3_8* *ls_a_bx*
588                                                                *bibtex-bindings*
589
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
594 entry.
595
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:  >
599     @BOOK{<+key+>,
600         author = {<++>},
601         editor = {<++>},
602         title = {<++>},
603         publisher = {<++>},
604         year = {<++>},
605         otherinfo = {<++>}
606     }<++>
607
608
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.
612
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.
617
618 NOTE: Mnemonic
619       --------
620       B for Bibliographic entry, L for Large entry, H for Huge entry, and X
621       stands for all eXtras.
622       
623       
624
625
626 Customizing Bib-TeX fields                                  *ls_3_8_1* *ls_a_by*
627                                                             *adding-bib-options*
628
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  >
631     g:Bib_{type}_options
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
634 following table
635
636 Character    Field Type~
637 w            address
638 a            author
639 b            booktitle
640 c            chapter
641 d            edition
642 e            editor
643 h            howpublished
644 i            institution
645 k            isbn
646 j            journal
647 m            month
648 z            note
649 n            number
650 o            organization
651 p            pages
652 q            publisher
653 r            school
654 s            series
655 t            title
656 u            type
657 v            volume
658 y            year
659
660 For example, by default, choosing 'article' via BBB inserts the following
661 template by default  >
662     @ARTICLE{<+key+>,
663         author = {<++>},
664         title = {<++>},
665         journal = {<++>},
666         year = {<++>},
667         otherinfo = {<++>}
668     }<++>
669 However, if g:Bib_article_options is defined as 'mnp', then 'article' will
670 insert the following template  >
671     @ARTICLE{<+key+>,
672         author = {<++>},
673         title = {<++>},
674         journal = {<++>},
675         year = {<++>},
676         month = {<++>},
677         number = {<++>},
678         pages = {<++>},
679         otherinfo = {<++>}
680     }<++>
681
682
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  >
689     crossref = {<++>},
690     abstract = {<++>},
691
692
693 NOTE: You will need to define Bib_* settings in your
694       $VIMRUNTIME/ftplugin/bib.vim file.
695       
696       
697
698 --------------------------------------------------------------------------------
699 Smart Key Mappings                                            *ls_3_9* *ls_a_bz*
700                                                                     *smart-keys*
701
702 Latex-Suite ships with the following smart keys:
703
704 Smart Backspace
705 ---------------
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.
710
711 Smart Quotes
712 ------------
713 Pressing " (English double quote) will insert `` or '' by making an intelligent
714 guess about whether we intended to open or close a quote.
715
716 Smart Space
717 -----------
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.
722
723 Smart Dots
724 ----------
725 Pressing ... (3 dots) results in \ldots outside math mode and \cdots in math
726 mode.
727
728 --------------------------------------------------------------------------------
729 Alt Key Macros                                               *ls_3_10* *ls_a_bA*
730                                                                *altkey-mappings*
731
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.
735
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  >
739           set winaltkeys=no
740 <     in your $VIM/ftplugin/tex.vim in order to use these maps.
741       
742       
743 NOTE: Customizing the maps
744       --------------------
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
748       [|ls_a_cx|].
749       
750       
751
752
753 <Alt-L>                                            *ls_3_10_1* *ls_a_bB* *Alt-L*
754
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.
757
758 Character before cursor    Expansion~
759 (                          \left( <++> \right)
760 [                          \left[ <++> \right]
761 |                          \left| <++> \right|
762 {                          \left\{ <++> \right\}
763 <                          \langle <++> \rangle
764 q                          \lefteqn{<++>}<++>
765
766 If the character before the cursor is none of the above, then it will simply
767 insert a \label{<++>}<++>.
768
769
770 <Alt-B>                                            *ls_3_10_2* *ls_a_bC* *Alt-B*
771
772 This insert-mode mapping encloses the previous character in \mathbf{}.
773
774
775 <Alt-C>                                            *ls_3_10_3* *ls_a_bD* *Alt-C*
776
777 In insert mode, this key is polymorphic as follows:
778
779
780 1. If the previous character is a letter or number, then capitalize it and
781    enclose it in \mathcal{}.
782
783 2. otherwise insert \cite{}.
784 In visual mode, it will simply enclose the selection in \mathcal{}
785
786
787 <Alt-I>                                            *ls_3_10_4* *ls_a_bE* *Alt-I*
788
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:
793
794 Environment        Style~
795 itemize            \item
796 enumerate          \item
797 theindex           \item
798 thebibliography    \item[<+biblabel+>]{<+bibkey+>} <++>
799 description        \item[<+label+>] <++>
800
801 <Alt-I> is intelligent enough to account for nested environments. For example,  >
802     \begin{itemize}
803         \item first item
804         \item second item
805               \begin{description}
806                   \item[label1] first desc
807                   \item[label2] second
808                   % <Alt-I> will insert "\item[<+label+>] <++>" if
809                   % used here
810               \end{description}
811         \item third item
812         % <Alt-I> will insert "\item " when if used here.
813     \end{itemize}
814     % <Alt-I> will insert nothing ("") if used here
815 <
816
817 The style used by <Alt-I> can be customized using the
818 g:Tex_ItemStyle_environment [|ls_a_dl|] variable.
819
820 --------------------------------------------------------------------------------
821 Custom Macros                                                *ls_3_11* *ls_a_bF*
822                                                             *custom-macros-menu*
823
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.
826
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.
831
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
837 choose one of them).
838
839 There are some other tools provided in this menu, namely:
840
841
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.
853
854 --------------------------------------------------------------------------------
855 Making your own Macros via IMAP()                            *ls_3_12* *ls_a_bG*
856                                                                  *ls-new-macros*
857
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()
866 command.
867
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.  >
873     augroup MyIMAPs
874         au!
875         au VimEnter * call IMAP('Foo', 'foo', '')
876     augroup END
877
878
879
880
881 Why use IMAP()                                             *ls_3_12_1* *ls_a_bH*
882                                                                       *why-IMAP*
883
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.
888
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.
891
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
894    mappings.
895
896
897 IMAP() syntax                                              *ls_3_12_2* *ls_a_bI*
898                                                                *ls-imaps-syntax*
899
900 Formally, the syntax which is used for the IMAP function is:  >
901     call IMAP (lhs, rhs, ft [, phs, phe])
902
903
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.
908             
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
914             "something else".
915             
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.
924             
925             
926 rhs         The "right-hand-side" of the mapping. This is the expansion you will
927             get when you type lhs.
928             
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.
937             
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:
946             
947               >
948                 call IMAP('FOO', "\<C-r>=AskVimFunc()\<CR>", 'vim')
949                 " Askvimfunc: Asks For Function Name And Sets Up Template 
950                 " Description: 
951                 function! AskVimFunc()
952                     let name = input('Name of the function : ')
953                     if name == ''
954                         let name = "<+Function Name+>"
955                     end
956                     let islocal = input('Is this function scriptlocal ? [y]/n : ', 'y')
957                     if islocal == 'y'
958                         let sidstr = '<SID>'
959                     else
960                         let sidstr = ''
961                     endif
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>" . 
967                         \ "endfunction \" "
968                         \ )
969                 endfunction
970 <           
971             
972             
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.
976             
977             
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.
982             
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.
988             
989             
990
991 ================================================================================
992 Package Handling                                                *ls_4* *ls_a_bJ*
993                                                                 *latex-packages*
994
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
999
1000
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.
1004
1005
1006 --------------------------------------------------------------------------------
1007 Inserting package commands                                    *ls_4_1* *ls_a_bK*
1008                                                             *inserting-packages*
1009
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.
1018
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.
1025
1026 You can also use the TPackage [|ls_a_cD|] to insert the \usepackage line.
1027
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|].
1030
1031 --------------------------------------------------------------------------------
1032 Actions taken for supported packages                          *ls_4_2* *ls_a_bL*
1033                                                                *package-actions*
1034
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|].
1038
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
1042
1043 TeX-Suite > Packages > <package> Commands
1044
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.
1048
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
1052       that location.
1053       
1054       
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
1059 from that file.
1060
1061 For example, the SIUnits package has a custom dictionary.
1062
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
1071
1072 Update
1073 ------
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
1076 options is created.
1077
1078 Update All
1079 ----------
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.
1083
1084
1085 --------------------------------------------------------------------------------
1086 Automatic Package detection                                   *ls_4_3* *ls_a_bM*
1087                                                    *automatic-package-detection*
1088
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.
1092
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.
1096
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|].
1099
1100
1101
1102 Custom Packages                                             *ls_4_3_1* *ls_a_bN*
1103                                                                *custom-packages*
1104
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.
1113
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.
1117
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
1121 from within Vim.
1122
1123 Therefore the value of g:Tex_TEXINPUTS will most probably be different from
1124 $TEXINPUTS which your native LaTeX distribution uses.
1125
1126 Example:  >
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.
1130
1131 NOTE: The present directory '.' is always searched. You need not include that in
1132       g:Tex_TEXINPUTS.
1133       
1134       
1135
1136 --------------------------------------------------------------------------------
1137 Writing supporting for a package                              *ls_4_4* *ls_a_bO*
1138                                                            *supporting-packages*
1139
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.
1145
1146
1147
1148 g:Tex_package_option_<package>                              *ls_4_4_1* *ls_a_bP*
1149
1150 This setting is a string containing a comma separated list of options supported
1151 by this package.
1152
1153 Example:  >
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.
1158
1159
1160 g:Tex_package_<package>                                     *ls_4_4_2* *ls_a_bQ*
1161
1162   >
1163     
1164         g:TeX_package_<package> = "pre:Command,pre:Command1"
1165     More detailed example is in latex-suite/packages/exmpl file (slightly
1166     outdated).
1167     Here is short summary of prefixes which can be used in package files:
1168     (x - place with cursor, <++> - |placeholder|)
1169     
1170     {env:command}  Environment: creates simple environment template
1171                 \begin{command}
1172                     x
1173                 \end{command}<++>
1174     {eno:command}  Environment with option:
1175                 \begin[x]{command}
1176                     <++>
1177                 \end{command}<++>
1178     {ens:command[<<option>>]...}  Environment special:
1179                 \begin[<<option>>]...{command}
1180                     <++>
1181                 \end{command}<++>
1182     {bra:command} Brackets:
1183                 \command{x}<++>
1184     {brd:command} Brackets double:
1185                 \command{x}{<++>}<++>
1186     {brs:command[<<option>>]...} Brackets special (as environment special:
1187                 \command[<+x+>]{<++>}{<++>}<++>
1188     {nor:command} Normal:
1189                 \command<Space
1190     {noo:command} Normal with option:
1191                 \command[x]<++>
1192     {nob:command} Normal with option and brackets:
1193                 \command[x]{<++>}<++>
1194     {pla:command} Plain:
1195                 command<Space
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.
1201     
1202     Command can be also given without prefix:. The result is
1203                \command
1204               
1205
1206
1207 ================================================================================
1208 Latex Completion                                                *ls_5* *ls_a_bR*
1209                                                               *latex-completion*
1210
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
1216
1217
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
1228 choose a filename.
1229
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
1242       of GNU grep).
1243       
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\ $*
1249 <     
1250       
1251       
1252
1253 --------------------------------------------------------------------------------
1254 Latex-Suite completion example                                *ls_5_1* *ls_a_bS*
1255                                                            *ls-completion-usage*
1256
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.  >
1262     
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---------------------
1266          17
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-----
1270          33
1271          34 This is a reference to \ref{eqn:}<++>
1272          35
1273          36
1274          37 \end{document}
1275          38
1276     ~
1277     ~
1278     ~
1279     newfile.tex                                                   34,32          Bot
1280     newfile.tex|11| \label{eqn:euler}
1281     newfile.tex|15| \label{eqn:einstein}
1282     ~
1283     [Error List]                                                  1,1            All
1284           7
1285           8 These are a couple of equations:
1286           9 \begin{eqnarray}
1287          10   e^{j\pi} + 1 &=& 0
1288          11   \label{eqn:euler}
1289          12 \end{eqnarray}
1290          13 \begin{equation}
1291          14   E = m c^2
1292          15   \label{eqn:einstein}
1293          16 \end{equation}
1294     newfile.tex [Preview]                                         11,3           21%
1295       
1296
1297
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.
1305
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.
1310
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:.
1317
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.
1320
1321 --------------------------------------------------------------------------------
1322 Latex-Suite \ref completion                                   *ls_5_2* *ls_a_bT*
1323                                                              *ls-completion-ref*
1324
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:  >
1331     
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-------------
1336         
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:  >
1341     
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
1346                    eqn:wingnormal-pos
1347                      \nhat =  T_z(\theta_2) T_y(\theta_y)T_x(\theta_x)\nhat_0,
1348                    eqn:T-1
1349                      T_1(\theta_2) &=& T_z(\theta_2)
1350         
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.
1356
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.
1365       
1366       
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
1369       manner.
1370       
1371       
1372 NOTE: Requirements
1373       ------------
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.
1378       
1379       
1380
1381 --------------------------------------------------------------------------------
1382 Latex-Suite \cite completion                                  *ls_5_3* *ls_a_bU*
1383                                                          *latex-completion-cite*
1384
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:  >
1391     
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
1395        In Science, 1999
1396     
1397     Article [ellington:84:part1]
1398        "The Aerodynamics of Hovering Insect Flight. I. The Quasi-Steady Analysis"
1399        Ellington, C P
1400        In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984
1401     
1402     Article [ellington:84:part2]
1403        "The Aerodynamics of Hovering Insect Flight. II. Morphological Parameters"
1404        Ellington, C P
1405        In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984
1406         
1407
1408
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).
1411
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:  >
1414     
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]:
1420         
1421 At the prompt, type  >
1422     a ellington
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.
1428
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.
1433
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
1436       etc.
1437
1438
1439 The following logic is applied to find out which bibliographic entries are
1440 included in the completion.
1441
1442
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
1445    the current file.
1446
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.
1456    
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.
1459
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.
1463
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.
1468
1469
1470 Caching the \cite completion results                        *ls_5_3_1* *ls_a_bV*
1471                                                            *cite-search-caching*
1472
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,
1481 issue the command  >
1482     TClearCiteHist
1483 This will redo the completion list next time you use <F9>.
1484
1485 --------------------------------------------------------------------------------
1486 Latex-Suite filename completion                               *ls_5_4* *ls_a_bW*
1487                                                         *ls-filename-completion*
1488
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.
1494
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.
1499
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.
1503
1504 command                    hide pattern~
1505 \bibliography              '^\.,\.[^b]..$'
1506 \include \includeonly      '^\.,\.[^t]..$'
1507 \includegraphics \psfig    '^\.,\.tex$,\.bib$,\.bbl$,\.zip$,\.gz$'
1508 \input                     ''
1509
1510 --------------------------------------------------------------------------------
1511 Custom command completion                                     *ls_5_5* *ls_a_bX*
1512                                                           *ls-completion-custom*
1513
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.
1519
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.
1528
1529 ================================================================================
1530 LaTeX Compiling                                                 *ls_6* *ls_a_bY*
1531                                                                *latex-compiling*
1532
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
1538
1539
1540 This functionality, available via the TeX-Suite menu, provides various tools to
1541 compile and debug LaTeX files from within Vim.
1542
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.
1554
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.
1561
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.
1564
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|].
1568
1569
1570 --------------------------------------------------------------------------------
1571 Setting Compilation rules                                     *ls_6_1* *ls_a_bZ*
1572                                                                 *compiler-rules*
1573
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.
1581
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 $*'
1585
1586
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.
1589
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.
1593       
1594       
1595
1596 --------------------------------------------------------------------------------
1597 Handling dependencies in compilation                          *ls_6_2* *ls_a_ca*
1598                                                            *compiler-dependency*
1599
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):  >
1607     
1608     let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf'
1609     
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.
1615
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.
1620       
1621       
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
1625 use:  >
1626     
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'
1630
1631
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
1634       independently.
1635       
1636       
1637
1638 --------------------------------------------------------------------------------
1639 Compiling multiple times                                      *ls_6_3* *ls_a_cb*
1640                                                             *compiling-multiple*
1641
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.
1649
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
1652 above setting.
1653
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.
1658
1659 1. If there was a .idx file, then remember its contents.
1660
1661 2. Run latex.
1662
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.
1665
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.
1668    
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.
1673
1674 5. If the .bbl file changes because of this, then remember to rerun latex again.
1675
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
1678    to rerun LaTeX.
1679
1680 7. If we found we had to rerun latex, then we repeat the steps above but not
1681    running makeindex or bibtex again.
1682
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.
1686
1687 --------------------------------------------------------------------------------
1688 Customizing the compiler output                               *ls_6_4* *ls_a_cc*
1689                                                  *compiler-output-customization*
1690
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
1696 concisely.
1697
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
1704 default value.
1705
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.
1709
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:  >
1713     TCLevel 3
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.
1717
1718 When TCLevel is called with the unquoted string strict as follows:  >
1719     TClevel strict
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.
1723
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
1726 Latex-Suite
1727
1728 --------------------------------------------------------------------------------
1729 Compiling parts of a file                                     *ls_6_5* *ls_a_cd*
1730                                                                 *part-compiling*
1731
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.
1734
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.
1740
1741 Pressing \lv while viewing the temporary file will view the output file
1742 generated from the temporary file, not the original file
1743
1744 Two commands |TPartComp| and |TPartView| are provided to be able to get this
1745 functionality via the command line.
1746
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.
1752
1753 ================================================================================
1754 Latex Viewing and Searching                                     *ls_7* *ls_a_ce*
1755                                                                  *latex-viewing*
1756
1757 |ls_7_1| Setting Viewing rules
1758 |ls_7_2| Forward Searching DVI documents
1759 |ls_7_3| Inverse Searching
1760
1761
1762
1763 --------------------------------------------------------------------------------
1764 Setting Viewing rules                                         *ls_7_1* *ls_a_cf*
1765                                                            *latex-viewing-rules*
1766
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.
1774
1775 NOTE: The viewing function also takes the *.latexmain [|ls_a_ct|] file into
1776       account to decide which file to show.
1777       
1778       
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
1782 your system.
1783
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.
1789
1790 --------------------------------------------------------------------------------
1791 Forward Searching DVI documents                               *ls_7_2* *ls_a_cg*
1792                                                              *forward-searching*
1793
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
1798 placed.
1799
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.
1808       
1809       
1810
1811 --------------------------------------------------------------------------------
1812 Inverse Searching                                             *ls_7_3* *ls_a_ch*
1813                                                              *inverse-searching*
1814
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.
1817
1818 You will need to enable searching [|ls_a_ed|] in order to use this
1819 functionality.
1820
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.
1827
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.
1831
1832 ================================================================================
1833 Latex Folding                                                   *ls_8* *ls_a_ci*
1834                                                                  *latex-folding*
1835
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
1839
1840
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).
1847
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").
1851
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  >
1857     \begin{figure}[h]
1858         \centerline{\psfig{figure=slidercrank.eps,height=6cm}}
1859         \caption{The Slider Crank Mechanism.}
1860         \label{fig:slidercrank}
1861     \end{figure}
1862     % a LaTeX comment.
1863     \begin{eqnarray}
1864         \sin(\pi) = 0
1865     \end{eqnarray}
1866
1867
1868 will be shown as:  >
1869     +---  5 lines: figure (fig:slidercrank) : The Slider Crank Mechanism. -----
1870     % a LaTeX comment.
1871     +---  3 lines: eqnarray () : \sin(\pi) = 0 --------------------------------
1872
1873
1874
1875 --------------------------------------------------------------------------------
1876 Default Folding Scheme in Latex-Suite                         *ls_8_1* *ls_a_cj*
1877                                                                *default-folding*
1878
1879 By default Latex-Suite creates folds in the following manner:
1880
1881   >
1882     \chapter
1883     \section
1884     %%fakesection
1885         \subsection
1886             \subsubsection
1887                 \item
1888                     \equation
1889                     \eqnarray
1890                     \figure
1891                     \table
1892                     \footnote
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.
1895
1896 --------------------------------------------------------------------------------
1897 Customizing what to fold                                      *ls_8_2* *ls_a_ck*
1898                                                       *customizing-what-to-fold*
1899
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.
1902
1903
1904
1905 Tex_FoldedSections                                          *ls_8_2_1* *ls_a_cl*
1906                                                             *Tex_FoldedSections*
1907
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.
1917
1918 See also advanced fold settings [|ls_a_cp|].
1919
1920
1921 Tex_FoldedEnvironments                                      *ls_8_2_2* *ls_a_cm*
1922                                                         *Tex_FoldedEnvironments*
1923
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
1926 is  >
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}".
1935
1936 See also advanced fold settings [|ls_a_cp|].
1937
1938
1939 Tex_FoldedCommands                                          *ls_8_2_3* *ls_a_cn*
1940                                                             *Tex_FoldedCommands*
1941
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|]
1947 variable.
1948
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.
1953       
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
1957       the lines  >
1958           \mycommand{This is a line
1959           and some more text on the next line
1960           }
1961 <     will be folded, but the lines  >
1962           \mycommand{This is a \textbf{line}
1963           and some more text
1964           }
1965 <     will not be folded. This is a bug which is very difficult to fix.
1966       
1967       
1968 See also advanced fold settings [|ls_a_cp|].
1969
1970
1971 Tex_FoldedMisc                                              *ls_8_2_4* *ls_a_co*
1972                                                                 *Tex_FoldedMisc*
1973
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:  >
1977     item,preamble,<<<
1978 NOTE: Unlike the other Tex_FoldedXXXX variables, the words in this setting are
1979       limited to take values from the following list:
1980       
1981       Value       Meaning~
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
1987                   as fold-markers.
1988       
1989       Any other words in the Tex_FoldedMisc setting are silently ignored.
1990       
1991       
1992
1993 See also advanced fold settings [|ls_a_cp|].
1994
1995
1996 Advanced Fold setting details                               *ls_8_2_5* *ls_a_cp*
1997                                                          *fold-setting-advanced*
1998
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"
2008
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
2018 it.
2019
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.
2027
2028 --------------------------------------------------------------------------------
2029 Editing the folding.vim file directly                         *ls_8_3* *ls_a_cq*
2030                                                                *editing-folding*
2031
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
2040 follows:  >
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:
2044
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
2049              actually start
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.
2058              
2059              For example, suppose we define a \itemize fold as follows:  >
2060                   =  '^\s*\\item',
2061                   = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}',
2062                   = 0,
2063                   = -1
2064 <            
2065              
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.
2069              
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:  >
2074                  \begin{itemize}
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...
2078                  \item Hello  
2079                  \end{itemize}                           <----- ... instead of here.
2080                  \item Next item of the parent itemize  
2081                  \end{itemize}
2082 <            
2083              
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
2088              folds.
2089
2090 NOTE: Example 1
2091       ---------
2092       A syntax fold region for the latex section is defined with the following
2093       arguments to AddSyntaxFoldItem:  >
2094           startpat = "\\section{"
2095           endpat   = "\\section{"
2096           startoff = 0
2097           endoff   = -1
2098           startskip = ''
2099           endskip = ''
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
2102       the next starts.
2103       
2104       
2105 NOTE: Example 2
2106       ---------
2107       A syntax fold region for the \itemize environment is:  >
2108           startpat = '^\s*\\item',
2109           endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}',
2110           startoff = 0,
2111           endoff = -1,
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.
2115       
2116       
2117
2118 ================================================================================
2119 Multiple file LaTeX projects                                    *ls_9* *ls_a_cr*
2120                                                                  *latex-project*
2121
2122 |ls_9_1| Latex-Suite project settings
2123 |ls_9_2| Specifying which file to compile
2124
2125
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
2129 the following
2130
2131   >
2132     thesis/
2133         main.tex
2134         abstract.tex
2135         intro/
2136             intro.tex
2137             figures/
2138                 fig1.eps
2139                 fig2.eps
2140         chapter1/
2141             chap1.tex
2142             figures/
2143                 fig1.eps
2144         conclusion/
2145             conclusion.tex
2146             figures/
2147
2148
2149 In the above case, main.tex will typically look like
2150
2151   >
2152     % file: main.tex
2153     \documentclass{report}
2154     \begin{document}
2155     
2156     \input{abstract.tex}
2157     \input{intro/intro.tex}
2158     \input{chapter1/chap1.tex}
2159     \input{conclusion/conclusion.tex}
2160     
2161     \end{document}
2162
2163
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.
2170
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.
2174       
2175       
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
2182 above.
2183
2184
2185 --------------------------------------------------------------------------------
2186 Latex-Suite project settings                                  *ls_9_1* *ls_a_cs*
2187                                                         *latex-project-settings*
2188
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.
2192
2193 Some typical per-project settings which are best put in the master file are
2194 Tex_ProjectSourceFiles [|ls_a_dt|]
2195
2196 --------------------------------------------------------------------------------
2197 Specifying which file to compile                              *ls_9_2* *ls_a_ct*
2198                                                              *latex-master-file*
2199
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.
2207
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
2214 file.  >
2215     let g:Tex_MainFileExpression = 'MainFile(modifier)'
2216     function! MainFile(fmod)
2217         if glob('*.latexmain') != ''
2218             return fnamemodify(glob('*.latexmain'), a:fmod)
2219         else
2220             return ''
2221         endif
2222     endif
2223
2224
2225 ================================================================================
2226 Latex-Suite Commands and Maps                                  *ls_10* *ls_a_cu*
2227                                                      *latex-suite-commands-maps*
2228
2229 |ls_10_1| Latex-Suite Maps
2230 |ls_10_2| Latex Suite Commands
2231
2232
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.
2235
2236
2237 --------------------------------------------------------------------------------
2238 Latex-Suite Maps                                             *ls_10_1* *ls_a_cv*
2239                                                               *latex-suite-maps*
2240
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
2251 your ~/.vimrc.  >
2252     imap <C-space> <Plug>IMAP_JumpForward
2253
2254
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.
2260       
2261       
2262
2263
2264 IMAP mappings                                              *ls_10_1_1* *ls_a_cw*
2265                                                            *customize-imap-maps*
2266
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.
2270
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)
2280
2281 <Plug>IMAP_JumpForward takes you to the location of the next place-holder
2282 [|ls_a_eD|].
2283
2284 <Plug>IMAP_JumpBack takes you to the previous place-holder [|ls_a_eD|].
2285
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
2290 [|ls_a_cX|]
2291
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
2296 [|ls_a_cX|]
2297
2298
2299 Alt-Key mappings                                           *ls_10_1_2* *ls_a_cx*
2300                                                         *customize-alt-key-maps*
2301
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
2304 remap keys.
2305
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>
2315
2316 --------------------------------------------------------------------------------
2317 Latex Suite Commands                                         *ls_10_2* *ls_a_cy*
2318                                                           *latex-suite-commands*
2319
2320
2321
2322 :TMacro [{macro}]                                 *ls_10_2_1* *ls_a_cz* *TMacro*
2323
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).
2329
2330
2331 :TMacroEdit [{macro}]                                      *ls_10_2_2* *ls_a_cA*
2332                                                                     *TMacroEdit*
2333
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).
2341
2342
2343 :TMacroNew                                                 *ls_10_2_3* *ls_a_cB*
2344                                                                      *TMacroNew*
2345
2346 Splits window to write new macro. Directory in new buffer is locally changed to
2347 Latex-Suite/macros/.
2348
2349
2350 :TMacroDelete [{macro}]                                    *ls_10_2_4* *ls_a_cC*
2351                                                                   *TMacroDelete*
2352
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)
2359
2360
2361 :TPackage [{package, ...}]                                 *ls_10_2_5* *ls_a_cD*
2362                                                                       *TPackage*
2363
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
2369 will insert a  >
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.
2375
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
2378 [|ls_a_bL|].
2379
2380
2381 :TPackageUpdate                                            *ls_10_2_6* *ls_a_cE*
2382                                                                 *TPackageUpdate*
2383
2384 This command `reads' name of package under cursor and turns on possible support.
2385
2386
2387 :TPackageUpdateAll                                         *ls_10_2_7* *ls_a_cF*
2388                                                              *TPackageUpdateAll*
2389
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.
2393
2394
2395 :TTemplate [{template}]                                    *ls_10_2_8* *ls_a_cG*
2396                                                                      *TTemplate*
2397
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)
2403
2404
2405 :TSection [{argument}]                                     *ls_10_2_9* *ls_a_cH*
2406                                                                       *TSection*
2407
2408 Used without any arguments inserts last section type (|latex-sectioning|).
2409 Accepts arguments: n> inserts section name in <n> logical level. Levels are:
2410 0    part
2411 1    chapter
2412 2    section
2413 3    subsection
2414 4    subsubsection
2415 5    paragraph
2416 6    subparagraph
2417
2418
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
2422         to +1).
2423 ++      inserts section name two logical levels below the last used command (equal
2424         to +2).
2425 -       inserts section name one logical level over the last used command (equal
2426         to -1).
2427 --      inserts section name two logical levels over the last used command (equal
2428         to -2).
2429
2430
2431
2432 Command accepts also latexSuite mappings (|latex-macros|) without preceding S
2433 and in lowercase:  >
2434     :TSection pa
2435 will result in \part{}. It is possible to use full names of sections: :TSection
2436 part
2437
2438
2439 :TSectionAdvanced                                         *ls_10_2_10* *ls_a_cI*
2440                                                               *TSectionAdvanced*
2441
2442 Accepts the same arguments as |TSection| but leads to a couple of questions
2443 (whether you want to include the section in the table of contents, whether there
2444 is a shorter name for the table of contents) and then creates a more intelligent
2445 template.
2446
2447
2448 :TLook                                            *ls_10_2_11* *ls_a_cJ* *TLook*
2449
2450 Accepts one argument. Will look through .tex files in directory of edited file
2451 for argument. It can be regexp. You don't have to enclose argument in "". <cr>
2452 takes you to location. Other keys work as described in |latex-viewer|. Note:
2453 TLook uses :grep command and is using 'grepprg'. Its regular expressions can be
2454 different from those of Vim.
2455
2456
2457 :TLookBib                                                 *ls_10_2_12* *ls_a_cK*
2458                                                                       *TLookBib*
2459
2460 Accepts one argument. Will look through .bib files in directory of edited file
2461 for argument. It can be regexp. You don't have to enclose argument in "". <cr>
2462 takes you to location. Other keys work as described in |latex-viewer|.
2463
2464 NOTE: TLookBib uses :grep command and is using 'grepprg'. Its regular
2465       expressions can be different from those of Vim.
2466       
2467       
2468
2469
2470 :TLookAll                                                 *ls_10_2_13* *ls_a_cL*
2471                                                                       *TLookAll*
2472
2473 Accepts one argument. Will look through all files in directory of edited file
2474 for argument. It can be regexp. You don't have to enclose argument in "". <cr>
2475 takes you to location. Other keys work as described in |latex-viewer|. Note:
2476 TLook uses :grep command and is using 'grepprg'. Its regular expressions can be
2477 different from those of Vim.
2478
2479
2480 :TPartComp                                                *ls_10_2_14* *ls_a_cM*
2481                                                                      *TPartComp*
2482
2483 No argument allowed but accepts range in all formats. Define fragment of
2484 interest with :'a,'b, :/a/,/b/, :'<,'> or :20,30. All other rules of compilation
2485 apply.
2486
2487
2488 :TPartView                                                *ls_10_2_15* *ls_a_cN*
2489                                                                      *TPartView*
2490
2491 Show last compiled fragment. All rules of viewing apply but |latex-searching|.
2492
2493
2494 :Tshortcuts [{arg}]                                       *ls_10_2_16* *ls_a_cO*
2495                                                                     *Tshortcuts*
2496
2497 Show shortcuts in terminal (not using menu). Without {arg} you will see simple
2498 menu prompting for one of them. Possible arguments:
2499 g    General shortcuts
2500 e    Environment shortcuts
2501 f    Font shortcuts
2502 s    Section shortcuts
2503 m    Math shortcuts
2504 a    All shortcuts
2505
2506 ================================================================================
2507 Customizing Latex-Suite                                        *ls_11* *ls_a_cP*
2508                                                        *customizing-latex-suite*
2509
2510 |ls_11_1| General Settings
2511 |ls_11_2| Place-Holder Customization
2512 |ls_11_3| Macro Customization
2513 |ls_11_4| Smart Key Customization
2514 |ls_11_5| Latex Completion Customization
2515 |ls_11_6| Compiler Customization
2516 |ls_11_7| Viewer Customization
2517 |ls_11_8| Menu Customization
2518 |ls_11_9| Folding Customization
2519 |ls_11_10| Package Handling Customization
2520
2521
2522 Customizing Latex-Suite is done by defining certain global variables in
2523 $VIM/ftplugin/tex.vim, where $VIM corresponds to ~/.vim for *nix machines and
2524 ~/vimfiles for windows machines. This file is not part of the Latex-Suite
2525 distribution. You will need to create this file yourself (or modify it if it
2526 exists) if you need to change any default settings. Since this file is not
2527 included as part of the Latex-Suite distribution, it will not be over-written in
2528 subsequent updates.
2529
2530 The default settings in Latex-Suite are defined in
2531 $VIM/ftplugin/latex-suite/texrc. Please take a look at this file if you find
2532 this documentation incomplete or confusing. That file is also well documented.
2533
2534 This chapter describes the various settings which effect Latex-Suite and their
2535 default values. The settings are broken up into sections according to the
2536 behavior which they influence.
2537
2538
2539 --------------------------------------------------------------------------------
2540 General Settings                                             *ls_11_1* *ls_a_cQ*
2541                                                    *ls-general-purpose-settings*
2542
2543
2544
2545 Tex_Debug                                                  *ls_11_1_1* *ls_a_cR*
2546                                                                      *Tex_Debug*
2547
2548 Type             boolean
2549 Default Value    0
2550
2551 If set to 1, then Latex-Suite will create certain global debug statements which
2552 can be printed by doing  >
2553     :call Tex_PrintDebug()
2554
2555
2556
2557 Tex_UsePython                                              *ls_11_1_2* *ls_a_cS*
2558                                                                  *Tex_UsePython*
2559
2560 Type             boolean
2561 Default Value    1
2562
2563 If Latex-Suite detects that your vim is python enabled (using has('python')),
2564 then it tries to use python in certain places to speed things up. If this
2565 misbehaves, you can set this to zero, in which case, Latex-Suite will use
2566 vimscript to accomplish the same.
2567
2568 --------------------------------------------------------------------------------
2569 Place-Holder Customization                                   *ls_11_2* *ls_a_cT*
2570                                                      *customizing-place-holders*
2571
2572 Latex-Suite uses place-holders [|ls_a_eD|] to minimize using the movement keys
2573 while typing. The following settings affect how place-holders are used.
2574
2575 NOTE: These setting need to be set in your ~/.vimrc, not $VIM/ftplugin/tex.vim
2576       because these settings affect the behavior of imaps.vim, which is a global
2577       plugin, not a file-type plugin.
2578       
2579       
2580
2581
2582 g:Imap_UsePlaceHolders                                     *ls_11_2_1* *ls_a_cU*
2583                                                           *Imap_UsePlaceHolders*
2584
2585
2586 Type             Boolean
2587 Default Value    1
2588
2589 Setting this to zero completely disables using place-holders.
2590
2591
2592 g:Imap_PlaceHolderStart & g:Imap_PlaceHolderEnd            *ls_11_2_2* *ls_a_cV*
2593                                                          *Imap_PlaceHolderStart*
2594
2595                                                  *Imap_PlaceHolderEnd* *ls_a_er*
2596 Setting                  Type      Value~
2597 Imap_PlaceHolderStart    String    '<+'
2598 Imap_PlaceHolderEnd      String    '+>'
2599
2600 These settings affect the strings displayed at the beginning and end of the
2601 place-holder string. Set these strings to a value different than a commonly
2602 occurring sequence of characters.
2603
2604 NOTE: TIP
2605       ---
2606       If you use the latin1 encoding and do not type in french, then you can set
2607       these strings to the \xab and \xbb characters (the french quotation
2608       marks).
2609       
2610       
2611
2612
2613 g:Imap_DeleteEmptyPlaceHolders                             *ls_11_2_3* *ls_a_cW*
2614                                                   *Imap_DeleteEmptyPlaceHolders*
2615
2616
2617 Type             Boolean
2618 Default Value    1
2619
2620 When set to one, non-descriptive or empty place-holders are deleted on pressing
2621 <Ctrl-J>.
2622
2623
2624 g:Imap_StickyPlaceHolders                                  *ls_11_2_4* *ls_a_cX*
2625                                                        *Imap_StickyPlaceHolders*
2626
2627
2628 Type             Boolean
2629 Default Value    1
2630
2631 When set to 1, in visual mode, <Ctrl-J> takes you to the next placeholder
2632 without deleting the current placeholder.
2633
2634 --------------------------------------------------------------------------------
2635 Macro Customization                                          *ls_11_3* *ls_a_cY*
2636                                                             *customizing-macros*
2637
2638
2639
2640 Tex_Env_name                                               *ls_11_3_1* *ls_a_cZ*
2641                                                                   *Tex_Env_name*
2642
2643 If you wish to wish to expand certain environments differently from the way
2644 Latex-Suite does it, you can define custom expansions using global variables of
2645 the form Tex_Env_{name} where name corresponds to the environment.
2646
2647 For example, if you press <F5> after typing theorem, Latex-Suite will by default
2648 expand it to  >
2649     \begin{theorem}
2650          \label{<++>}<++>
2651     \end{theorem}<++>
2652 However, if you wish change this to  >
2653     \begin{theorem}
2654          <++>
2655     \end{theorem}<++>
2656 then define the following variable  >
2657     let g:Tex_Env_theorem = "\\begin{theorem}\<CR><++>\<CR>\\end{theorem}"
2658 <   
2659
2660 If the expansion uses special keys such as carriage return etc, then use
2661 double-quotes and use the "\<key>" notation for special keys. Backslashes have
2662 to be doubled.
2663
2664 You could even use strings returned by functions as the expansion by using the
2665 IMAP_PutTextWithMovement() [|ls_a_ea|] function.
2666
2667 If the name of the environment contains special characters (for example, the
2668 eqnarray* environment), then use the following form:  >
2669     let g:Tex_Env_{'eqnarray*'} = 
2670             \ "\\begin{eqnarray*}\<CR><++> &=& <++>\<CR>\\end{eqnarray*}<++>"
2671 This will make pressing <F5> after eqnarray* expand to  >
2672     \begin{eqnarray*}
2673         <++> &=& <++>
2674     \end{eqnarray*}<++>
2675
2676
2677
2678 Tex_Com_name                                               *ls_11_3_2* *ls_a_da*
2679                                                                   *Tex_Com_name*
2680
2681 If you wish to define new expansions for fast command insertion as described
2682 here [|ls_a_bo|], or redefine expansions from the default values in Latex-Suite,
2683 you will need to define variables of the form g:Tex_Com_{name} where name is a
2684 command name. For example, with the setting  >
2685     let g:Tex_Com_frac = "\\frac{<++>}{<++>}<++>"
2686 pressing <F7> after typing frac will change it to \frac{<++>}{<++>}<++>
2687
2688 See Tex_Env_name [|ls_a_cZ|] for additional details on how to create this
2689 setting in various special circumstances.
2690
2691
2692 Enabling / disabling macros                                *ls_11_3_3* *ls_a_db*
2693                                                                 *macro-enabling*
2694
2695 The following variables disable various parts of the macro functionality of
2696 Latex-Suite. See the links to the relevant sections to see what functionality
2697 setting each of the variables to zero will take away.
2698
2699                                                  *Tex_EnvironmentMaps* *ls_a_es*
2700                                                 *Tex_EnvironmentMenus* *ls_a_et*
2701                                                         *Tex_FontMaps* *ls_a_eu*
2702                                                        *Tex_FontMenus* *ls_a_ev*
2703                                                      *Tex_SectionMaps* *ls_a_ew*
2704                                                     *Tex_SectionMenus* *ls_a_ex*
2705 Setting                   Link to relevant section            Default Value~
2706 g:Tex_EnvironmentMaps     Environment Mappings [|ls_a_bf|]    1
2707 g:Tex_EnvironmentMenus                                        1
2708 g:Tex_FontMaps            Font Mappings [|ls_a_bs|]           1
2709 g:Tex_FontMenus                                               1
2710 g:Tex_SectionMaps         Section Mappings [|ls_a_bt|]        1
2711 g:Tex_SectionMenus                                            1
2712
2713
2714 g:Tex_UseMenuWizard                                        *ls_11_3_4* *ls_a_dc*
2715                                                              *Tex_UseMenuWizard*
2716
2717
2718 Type             Boolean
2719 Default Value    0
2720
2721 If this variable is set to 1, then when an environment is chosen from the menu
2722 then for selected environments, Latex-Suite asks a series of questions on the
2723 command line and inserts a template with the corresponding fields already filled
2724 in. Setting this to zero will insert a template with place-holders [|ls_a_eD|]
2725 marking off the places where fields need to be filled.
2726
2727
2728 g:Imap_FreezeImap                                          *ls_11_3_5* *ls_a_dd*
2729                                                                *Imap_FreezeImap*
2730
2731 Type             boolean
2732 Default Value    0
2733
2734 This option when set to 1, temporarily freezes Latex-Suite's macro expansion. It
2735 might be useful when you are using some other keymap which is causing excessive
2736 macro expansion. Use a buffer-local variable of the same name if you wish to
2737 affect just the present buffer.
2738
2739
2740 g:Tex_CatchVisMapErrors                                    *ls_11_3_6* *ls_a_de*
2741                                                          *Tex_CatchVisMapErrors*
2742
2743
2744 Type             Boolean
2745 Default Value    1
2746
2747 With so many visual maps, its helpful to have a way of catching typing errors
2748 made in visual mode. What this does is to prompt you to correct your visual mode
2749 mapping if you start out with and then type some illegal keys. It basically maps
2750 just the g:Tex_Leader character to a function.
2751
2752
2753 g:Tex_Diacritics                                           *ls_11_3_7* *ls_a_df*
2754                                                                 *Tex_Diacritics*
2755
2756
2757 Type             Boolean
2758 Default Value    0
2759
2760 Whether or not you want to use diacritics [|ls_a_bw|].
2761
2762
2763 g:Tex_Leader                                               *ls_11_3_8* *ls_a_dg*
2764                                                                     *Tex_Leader*
2765
2766
2767 Type             String
2768 Default Value    '`'
2769
2770 The mappings in Latex-Suite are by default prefixed with the back-tick
2771 character. For example, `/ inserts \frac{<++>}{<++>}<++> etc. You can change the
2772 prefix with the following setting. ',', '/', '`' are preferred values. '' or '\'
2773 will lead to a _lot_ of trouble.
2774
2775 g:Tex_Leader is also used for visual mode mappings for fonts.
2776
2777
2778 g:Tex_Leader2                                              *ls_11_3_9* *ls_a_dh*
2779                                                                    *Tex_Leader2*
2780
2781
2782 Type             String
2783 Default Value    ','
2784
2785 In order to avoid clashes between the large number of visual mode macros
2786 provided, the visual mode macros for environments [|ls_a_bm|] and sections start
2787 with a character different from g:Tex_Leader.
2788
2789
2790 g:Tex_PromptedEnvironments                                *ls_11_3_10* *ls_a_di*
2791                                                       *Tex_PromptedEnvironments*
2792
2793
2794 Type             String
2795 Default Value    'eqnarray*,eqnarray,equation,equation*,\[,$$,align,align*'
2796
2797 This string represents a comma separated list of fields corresponding to
2798 environments. Pressing <F5> in insert-mode in the body of the document asks you
2799 to choose from one of these environments to insert.
2800
2801 Leaving this string empty will leave the <F5> key unmapped
2802
2803
2804 g:Tex_HotKeyMappings                                      *ls_11_3_11* *ls_a_dj*
2805                                                             *Tex_HotKeyMappings*
2806
2807
2808 Type             String
2809 Default Value    'eqnarray*,eqnarray,bmatrix'
2810
2811 This string represents a comma separated list of environments which are mapped
2812 to <Shift-F-1> through <Shift-F-4>. For example, pressing <Shift-F-2> with this
2813 setting inserts the eqnarray environment.
2814
2815 Leaving this string empty will leave <Shift-F-1> through <Shift-F-4> unmapped.
2816
2817 NOTE: Only the first four fields of this list are used. The rest are silently
2818       ignored.
2819       
2820       
2821
2822
2823 g:Tex_PromptedCommands                                    *ls_11_3_12* *ls_a_dk*
2824                                                           *Tex_PromptedCommands*
2825
2826
2827 Type             String
2828 Default Value    'footnote,cite,pageref,label'
2829
2830 This string represents a comma separated list of LaTeX commands which
2831 Latex-Suite uses for the <F7> and <S-F7> maps as described here [|ls_a_bo|].
2832
2833 Leaving this string empty will leave the <F7> key unmapped.
2834
2835
2836 Tex_ItemStyle_environment                                 *ls_11_3_13* *ls_a_dl*
2837                                                      *Tex_ItemStyle_environment*
2838
2839 This setting affects the style which Latex-Suite uses to insert an \item when
2840 <Alt-I> is pressed as described here [|ls_a_bE|]. By default Latex-Suite defines
2841 styles for the following environments:
2842
2843 Environment        Style~
2844 itemize            \item
2845 enumerate          \item
2846 theindex           \item
2847 thebibliography    \item[<+biblabel+>]{<+bibkey+>} <++>
2848 description        \item[<+label+>] <++>
2849
2850 Each style is defined by a variable of the form g:Tex_ItemStyle_{envname} where
2851 envname is the name of the environment for which the style is defined. For
2852 example, by default  >
2853     g:Tex_ItemStyle_description = '\item[<+label+>] <++>'
2854 Redefining the style for a particular environment or defining a style for an
2855 entirely new environment is simply a matter of setting the value of a variable
2856 of the corresponding name.
2857
2858 --------------------------------------------------------------------------------
2859 Smart Key Customization                                      *ls_11_4* *ls_a_dm*
2860                                                         *customizing-smart-keys*
2861
2862 These settings affect the smart key functionality as described here [|ls_a_bz|].
2863
2864
2865
2866 g:Tex_SmartKeyBS                                           *ls_11_4_1* *ls_a_dn*
2867                                                                 *Tex_SmartKeyBS*
2868
2869
2870 Type             Boolean
2871 Default Value    1
2872
2873 Whether or not <Backspace> deletes diacritics.
2874
2875
2876 g:Tex_SmartKeyQuote                                        *ls_11_4_2* *ls_a_do*
2877                                                              *Tex_SmartKeyQuote*
2878
2879
2880 Type             Boolean
2881 Default Value    1
2882
2883 Whether or not the smart quotes [|ls_a_bz|] functionality is available.
2884
2885 If enabled, the quote characters can be customized by setting the following
2886 variables:
2887
2888 Setting                  Value~
2889 g:Tex_SmartQuoteOpen     "``"
2890 g:Tex_SmartQuoteClose    "''"
2891
2892 Non-English users will want to change these settings to their locale. These
2893 global variables will be ignored if there are buffer-local variables (with the
2894 same name), which may be set in the language specific package files, such as
2895 $VIM/ftplugin/latex-suite/packages/german.
2896
2897 --------------------------------------------------------------------------------
2898 Latex Completion Customization                               *ls_11_5* *ls_a_dp*
2899                                                   *customizing-latex-completion*
2900
2901 The following settings affect the completion [|ls_a_bR|] functionality in
2902 Latex-Suite.
2903
2904
2905
2906 Window size settings                                       *ls_11_5_1* *ls_a_dq*
2907                                                  *completion-window-preferences*
2908
2909 These three settings affect the aesthetics of the completion functionality.
2910
2911                                              *Tex_ViewerCwindowHeight* *ls_a_ey*
2912                                              *Tex_ViewerPreviewHeight* *ls_a_ez*
2913                                                   *Tex_ExplorerHeight* *ls_a_eA*
2914                                                         *Tex_ImageDir* *ls_a_eB*
2915 Setting                      Explanation                         Default Value~
2916 g:Tex_ViewerCwindowHeight    The height of the cwindow which     5
2917                              displays the list of \labels        
2918                              etc.                                
2919 g:Tex_ViewerPreviewHeight    The height of the preview window    10
2920                              which shows the context of a        
2921                              \label etc.                         
2922 g:Tex_ExplorerHeight         The height of the explorer          10
2923                              window which lists the files        
2924                              from which to choose an image       
2925                              file.                               
2926 g:Tex_ImageDir               The directory to scan for images    ''
2927
2928
2929 g:Tex_BIBINPUTS                                            *ls_11_5_2* *ls_a_dr*
2930                                                                  *Tex_BIBINPUTS*
2931
2932
2933 Type             string
2934 Default Value    ''
2935
2936 This string describes the directories which are scanned while trying to search
2937 for .bib and .bbl files. See the cite completion section [|ls_a_bU|] for more
2938 details.
2939
2940 This string should be set in the syntax accepted by Vim's native 'path' setting.
2941 Do not include the present directory '.'. While searching for bibliography
2942 files, the present directory will be prepended to this variable.
2943
2944
2945 Tex_UseSimpleLabelSearch                                   *ls_11_5_3* *ls_a_ds*
2946                                                       *Tex_UseSimpleLabelSearch*
2947
2948 When set to 1, Latex-Suite searches for \labels in all .tex files in the
2949 directory containing the file being edited when <F9> is pressed. See \ref
2950 completion [|ls_a_bT|] for details.
2951
2952
2953 g:Tex_ProjectSourceFiles                                   *ls_11_5_4* *ls_a_dt*
2954                                                         *Tex_ProjectSourceFiles*
2955
2956
2957 Type             String
2958 Default Value    ''
2959
2960 This setting is meant to be initialized on a per-project basis using the
2961 Latex-Suite master file [|ls_a_ct|] as described in Latex-Suite Project
2962 [|ls_a_cr|] section. It is a list of source files which are used in the project.
2963 If defined, then instead of using the logic described in
2964 Tex_UseSimpleLabelSearch [|ls_a_ds|] to search for files in which to search for
2965 \labels, we simply search for \labels in this list. This significantly reduces
2966 the time it takes to generate the list of possible completions for large
2967 projects.
2968
2969 The list is specified as a whitespace separated list of filenames relative to
2970 the location of the main file.
2971
2972
2973 g:Tex_RememberCiteSearch                                   *ls_11_5_5* *ls_a_du*
2974                                                         *Tex_RememberCiteSearch*
2975
2976
2977 Type             Boolean
2978 Default Value    0
2979
2980 When this variable is non-zero, then Latex-Suite will try to remember results
2981 from the \cite completion as described in this section [|ls_a_bV|].
2982
2983 --------------------------------------------------------------------------------
2984 Compiler Customization                                       *ls_11_6* *ls_a_dv*
2985                                                          *customizing-compiling*
2986
2987 The following settings affect Latex-Suite's compilation functionality
2988
2989
2990
2991 g:Tex_DefaultTargetFormat                                  *ls_11_6_1* *ls_a_dw*
2992                                                        *Tex_DefaultTargetFormat*
2993
2994
2995 Type             String
2996 Default Value    dvi for windows/*nix and pdf for mac
2997
2998 Use this setting to choose the default target format. For example, setting this
2999 to pdf makes Latex-Suite compile a pdf file when you press \ll and fire up the
3000 pdf viewer on pressing \lv. Make sure that a rules for compiling and viewing
3001 have been defined for this target format as described here [|ls_a_dx|] and here
3002 [|ls_a_dF|].
3003
3004
3005 g:Tex_CompileRule_<format>                                 *ls_11_6_2* *ls_a_dx*
3006                                                         *Tex_CompileRule_format*
3007
3008 Here <format> refers to the target format for which this rule is defined.
3009 Latex-Suite supports compiling into dvi, ps and pdf by default. All these rules
3010 are strings defined by default as follows:
3011
3012
3013 g:Tex_CompileRule_dvi    'latex -interaction=nonstopmode $*'
3014 g:Tex_CompileRule_ps     'ps2pdf $*'
3015 g:Tex_CompileRule_pdf    'pdflatex -interaction=nonstopmode $*'
3016
3017 If you desire forward and inverse searching via Latex-Suite, you will need to
3018 change g:Tex_CompileRule_dvi to include -src-specials. However, this has been
3019 known to cause problems with the output file. Therefore, use this with care.
3020
3021
3022 g:Tex_FormatDependency_<format>                            *ls_11_6_3* *ls_a_dy*
3023
3024 Type             string
3025 Default Value    ''
3026
3027 By default, there are no format dependencies defined. Each definition is of the
3028 form above where <format> is a string such as 'dvi' etc.
3029
3030 The value of each string is a comma separated string such as 'dvi,ps'. See the
3031 Compiler dependency [|ls_a_ca|] section to see how to use/specify this setting
3032
3033
3034 g:Tex_MultipleCompileFormats                               *ls_11_6_4* *ls_a_dz*
3035                                                     *Tex_MultipleCompileFormats*
3036
3037 Type             string
3038 Default Value    'dvi'
3039
3040 This is a comma separated string of formats for which the compiler needs to be
3041 called multiple times in order to get cross-references, citations etc right. See
3042 the Compiling multiple times [|ls_a_cb|] section for details.
3043
3044
3045 g:Tex_IgnoredWarnings                                      *ls_11_6_5* *ls_a_dA*
3046                                                            *Tex_IgnoredWarnings*
3047
3048
3049 Type             String
3050 Default Value    a new-line separated list of patterns as described below
3051
3052 The default value of this setting is  >
3053     \"Underfull\n".
3054     \"Overfull\n".
3055     \"specifier changed to\n".
3056     \"You have requested\n".
3057     \"Missing number, treated as zero.\n".
3058     \"There were undefined references\n"
3059     \"Citation %.%# undefined"
3060 This setting defines a set of patterns which will be filtered out when
3061 displaying the output from the latex compiler. This is to aid in filtering out
3062 very common warnings/errors.
3063
3064 NOTE: Remember to check the value of g:Tex_IgnoreLevel [|ls_a_dB|] when you
3065       change this setting. For example, if you append a new pattern which you
3066       would like to ignore by default, increase the value of g:Tex_IgnoreLevel.
3067       
3068       
3069
3070
3071 g:Tex_IgnoreLevel                                          *ls_11_6_6* *ls_a_dB*
3072                                                                *Tex_IgnoreLevel*
3073
3074
3075 Type             Integer
3076 Default Value    7
3077
3078 This setting defines a "filter level" or an "ignore level". A value of 7 for
3079 instance means that any warning/error matching with any of the first 7 fields of
3080 g:Tex_IgnoredWarnings [|ls_a_dA|] will be ignored. Setting this value to zero
3081 will mean that no error/warning is ignored. However, even with a value of zero,
3082 Latex-Suite will filter out most of the text which a LaTeX compiler typically
3083 produces. Use  >
3084     TCLevel strict
3085 from within Vim in order to see all the lines from the compiler's output.
3086
3087
3088 Tex_UseMakefile                                            *ls_11_6_7* *ls_a_dC*
3089                                                                *Tex_UseMakefile*
3090
3091 Type             boolean
3092 Default Value    1
3093
3094 When set to 1, then if a makefile or Makefile is present in the current
3095 directory, then Latex-Suite sets the makeprg option to just "make <target>",
3096 where <target> is the target format chosen using the TCTarget or TTarget
3097 commands.
3098
3099 When set to 0, then Latex-Suite will set the makeprg setting to whatever is
3100 defined by the g:Tex_CompileRule_target [|ls_a_dx|] setting.
3101
3102
3103 g:Tex_GotoError                                            *ls_11_6_8* *ls_a_dD*
3104                                                                  *Tex_GotoError*
3105
3106
3107 Type             boolean
3108 Default Value    1
3109
3110 If set to 1, then pressing \ll will take you to the location of the first
3111 warning/error, otherwise you will remain in the original location but the
3112 errors/warnings will be listed in the preview window.
3113
3114 --------------------------------------------------------------------------------
3115 Viewer Customization                                         *ls_11_7* *ls_a_dE*
3116                                                            *customizing-viewing*
3117
3118 The following settings affect how Latex-Suite will display compiled files.
3119
3120
3121
3122 g:Tex_ViewRule_<format>                                    *ls_11_7_1* *ls_a_dF*
3123                                                            *Tex_ViewRule_format*
3124
3125 Here <format> refers to a format such as dvi, ps, etc. This variable defines the
3126 program which will be called to display a file of that format.
3127
3128 By default, Latex-Suite defines viewer programs for viewing DVI, PS and PDF
3129 formats as follows:
3130
3131                       Windows       Unix~
3132 g:Tex_ViewRule_dvi    'yap -1'      'xdvi'
3133 g:Tex_ViewRule_ps     'gsview32'    'ghostview'
3134 g:Tex_ViewRule_pdf    'AcroRd32'    'xpdf'
3135
3136 For Macintosh systems, these strings are left empty by default. This lets the
3137 system pick the program for each format. If you define these variables for Mac,
3138 the system choice will be over-ridden.
3139
3140 Latex-Suite appends file.format to the above settings while calling the external
3141 programs. For example, with  >
3142     let g:Tex_ViewRule_dvi = 'yap -1'
3143 yap is called as  >
3144     !start yap -1 file.dvi
3145 from within Vim. (The initial start is used on Windows platforms is to make yap
3146 start as a separate process.) If you find the way Latex-Suite constructs the
3147 command line too restrictive, you can use the Tex_ViewRuleComplete_format
3148 [|ls_a_dG|] setting for more complete control on how the command line is
3149 constructed while calling the external program for viewing.
3150
3151 NOTE: For windows, you will need to set the $PATH variable to include the paths
3152       to yap, AcroRd32, gsview32 and any other programs. See your system
3153       documentation for how to do this.
3154       
3155       
3156 NOTE: Default Viewing Format
3157       ----------------------
3158       To change the default format for viewing files, set the
3159       g:Tex_DefaultTargetFormat [|ls_a_dw|] variable.
3160       
3161       
3162
3163
3164 Tex_ViewRuleComplete_<format>                              *ls_11_7_2* *ls_a_dG*
3165                                                    *Tex_ViewRuleComplete_format*
3166
3167 Here <format> refers to the extension of a output format such as dvi, html etc.
3168
3169 Tex_ViewRuleComplete_format takes precedence over Tex_ViewRule_format if both
3170 are specified. By default, Latex-Suite does not define values for
3171 Tex_ViewRuleComplete_format for any format. Unlike in the case of
3172 Tex_ViewRule_format, Latex-Suite does not modify Tex_ViewRuleComplete_format at
3173 all in constructing the command line. The only modification is to substitute
3174 '$*' everywhere in the string with the name of the file being viewed (without
3175 the extension).
3176
3177 NOTE: IMPORTANT
3178       ---------
3179       Make sure you make the process go into the background otherwise vim will
3180       wait for the viewer to terminate before letting you edit the file again.
3181       
3182       To make a process go into the background on a *nix platform, use a
3183       trailing & in the setting. On Windows, use start at the beginning of the
3184       setting. Example: Suppose you have a latex->html converter which converts
3185       a file say foo.tex to a file foo/index.html. Then you would use:  >
3186           " On *nix platform
3187           let g:Tex_ViewRuleComplete_html = 'MozillaFirebird $*/index.html &'
3188           " On windows platform
3189           let g:Tex_ViewRuleComplete_html = 'start MozillaFirebird $*/index.html'
3190 <     
3191       
3192       
3193
3194 --------------------------------------------------------------------------------
3195 Menu Customization                                           *ls_11_8* *ls_a_dH*
3196                                                              *customizing-menus*
3197
3198 In addition to using the variables defined in this section to affect the
3199 menu-layout permanently (i.e, the layout Latex-Suite will start with), you can
3200 also use the TeX-Suite > Configure Menu menu to dynamically configure the menu
3201 layout after Latex-Suite has started.
3202
3203
3204
3205 g:Tex_Menus                                                *ls_11_8_1* *ls_a_dI*
3206                                                                      *Tex_Menus*
3207
3208
3209 Type             Boolean
3210 Default Value    1
3211
3212 If set to 0, Latex-Suite will suppress showing all menus. Useful if you mostly
3213 work in terminals.
3214
3215
3216 g:Tex_MainMenuLocation                                     *ls_11_8_2* *ls_a_dJ*
3217                                                           *Tex_MainMenuLocation*
3218
3219
3220 Type             number
3221 Default Value    80
3222
3223 This setting decides the location of the first top-level Latex-Suite menu. You
3224 can for example shift all the menus created by Latex-Suite to the very end by
3225 setting this value to a large number like 990.
3226
3227
3228 g:Tex_MathMenus                                            *ls_11_8_3* *ls_a_dK*
3229                                                                  *Tex_MathMenus*
3230
3231
3232 Type             Boolean
3233 Default Value    1
3234
3235 The Tex-Math menu consists of hundreds of mathematical symbols used in LaTeX.
3236 This menu comprises about 75% of the menus.
3237
3238
3239 g:Tex_NestElementMenus                                     *ls_11_8_4* *ls_a_dL*
3240                                                           *Tex_NestElementMenus*
3241
3242
3243 Type             Boolean
3244 Default Value    1
3245
3246 This setting controls the "compactness" of the menus. If set to 1, then the
3247 Font, Counter and Dimensioning menus are collected together in a single menu
3248 called Tex-Elements, otherwise, they will each get a separate menu.
3249
3250
3251 g:Tex_PackagesMenu                                         *ls_11_8_5* *ls_a_dM*
3252                                                               *Tex_PackagesMenu*
3253
3254
3255 Type             Boolean
3256 Default Value    1
3257
3258 Setting this to zero will stop Latex-Suite from automatically creating the
3259 TeX-Suite > Packages > Supported menu at startup. You can still create the menu
3260 after startup by going to TeX-Suite > Configure Menu.
3261
3262
3263 g:Tex_NestPackagesMenu                                     *ls_11_8_6* *ls_a_dN*
3264                                                           *Tex_NestPackagesMenu*
3265
3266
3267 Type             String
3268 Default Value    'TeX-'
3269
3270 This string is the prefix added to all the menus created by Latex-Suite. If you
3271 define this variable with a dot ('.') as the last character, then all the menus
3272 created by Latex-Suite will be nested under a single master menu. For example,
3273 set this to '&LaTeX-Suite.' to nest all menus under a menu called &LaTeX-Suite.
3274
3275
3276 g:Tex_UseUtfMenus                                          *ls_11_8_7* *ls_a_dO*
3277                                                                *Tex_UseUtfMenus*
3278
3279
3280 Type             Boolean
3281 Default Value    0
3282
3283 This setting controls whether Latex-Suite uses utf-8 symbols to display some of
3284 the mathematical symbols in the TeX-Math menu. It is necessary for your
3285 system/GUI to support utf-8. Setting this to 1 has the side-effect of setting
3286 the 'encoding' option of Vim to 'utf-8'.
3287
3288 --------------------------------------------------------------------------------
3289 Folding Customization                                        *ls_11_9* *ls_a_dP*
3290                                                            *customizing-folding*
3291
3292 The following settings control the folding [|ls_a_ci|] functionality of
3293 Latex-Suite.
3294
3295
3296
3297 g:Tex_Folding                                              *ls_11_9_1* *ls_a_dQ*
3298                                                                    *Tex_Folding*
3299
3300
3301 Type             Boolean
3302 Default Value    1
3303
3304 Setting this to zero completely disables Latex-Suite's folding functionality.
3305 However, the TexFoldTextFunction() is still available in case you want to use
3306 another folding scheme but still want to continue using the fold text function.
3307
3308
3309 g:Tex_AutoFolding                                          *ls_11_9_2* *ls_a_dR*
3310                                                                *Tex_AutoFolding*
3311
3312
3313 Type             Boolean
3314 Default Value    1
3315
3316 This setting controls whether Latex-Suite automatically creates manual folds for
3317 a file when it is opened. You can still use the \rf mapping to refresh/create
3318 folds even when this variable is set to zero.
3319
3320 --------------------------------------------------------------------------------
3321 Package Handling Customization                              *ls_11_10* *ls_a_dS*
3322                                                           *customizing-packages*
3323
3324 These settings affect the custom packages [|ls_a_bN|] functionality in
3325 Latex-Suite
3326
3327
3328
3329 g:Tex_TEXINPUTS                                           *ls_11_10_1* *ls_a_dT*
3330                                                                  *Tex_TEXINPUTS*
3331
3332
3333 Type             string
3334 Default Value    ''
3335
3336 This setting describes the directories scanned by Latex-Suite while searching
3337 for custom user packages as described in the custom packages [|ls_a_bN|]
3338 section. Do not include the present directory in this setting. The present
3339 directory is always scanned for custom packages.
3340
3341 This string should be set in the syntax accepted by Vim's native 'path' setting.
3342
3343 ================================================================================
3344 Credits                                                        *ls_12* *ls_a_dU*
3345                                                            *latex-suite-credits*
3346
3347
3348
3349 And finally, the credits:
3350
3351
3352 Artur R. Czechowski    maintains the BSD package of Latex-Suite. Lots of valuable
3353                        feedback.
3354 Lubomir Host           provided the diacritics and also helped in development.
3355 Alexander Wagner       valuable suggestions during development.
3356 Luc Hermitte           his variation of Stephen Riehm's bracketing system is used
3357                        in Latex-Suite.
3358 Gergely Kontra         the clever little JumpFunc() in imaps.vim is due to him.
3359                        The implementation of the templates also borrows from
3360                        mu-template.vim by him.
3361 Dimitri Antoniou       author of ltags and also provided the nice tip about
3362                        forward / reverse search on DVI documents.
3363 Stephen Riehm          the extremely helpful bracketing system is from him.
3364 Alan Schmitt           provided macros/folding elements. Continued feedback,
3365                        bug-reports/fixes.
3366 Hari Krishna Dara      for ExecMap(), the clever little function which makes
3367                        typing visual mode mappings so much easier and error-free.
3368 Alan G Isac            for the comprehensive BibT() function for entering bibtex
3369                        entries.
3370 Gontran Baerts         for libList.vim
3371 Peter Heslin           useful discussion and also a lot of bug fixes. the
3372                        %%fakesection in folding.vim.
3373 Zhang Lin-bo           lots of very useful additions to folding. The code for
3374                        customizing the folding scheme is due to him.
3375
3376 A large number of functions in Latex-Suite come from various other people. Some
3377 of those people might have been missed here. Each function should however have
3378 the author's name/e-mail above it. Thats the more authoritative place to check
3379 out who has done what.
3380
3381                                               *latex-suite-maintainer* *ls_a_eC*
3382 The current maintainer(s) of Latex-Suite is(are)
3383
3384
3385 Srinath Avadhanula <srinath@fastmail.fm>
3386
3387 Mikolaj Machowski <mikmach@wp.pl>
3388
3389 Benji Fisher <benji@member.AMS.org>
3390
3391 ================================================================================
3392 URLs used in this file
3393
3394 *ls_u_1* : http://vim-latex.sourceforge.net
3395 *ls_u_2* : http://vim-latex.sourceforge.net/index.php?subject=download
3396 *ls_u_3* : http://www.cygwin.com
3397 *ls_u_4* : http://www.google.com/search?q=windows%20gnu%20grep
3398
3399 ================================================================================
3400 About this file
3401
3402 This file was created automatically from its XML variant using db2vim. db2vim is
3403 a python script which understands a very limited subset of the Docbook XML 4.2
3404 DTD and outputs a plain text file in vim help format.
3405
3406 db2vim can be obtained via anonymous CVS from sourceforge.net. Use
3407
3408 cvs -d:pserver:anonymous@cvs.vim-latex.sf.net:/cvsroot/vim-latex co db2vim
3409
3410 Or you can visit the web-interface to sourceforge CVS at:
3411 http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vim-latex/db2vim/
3412
3413 The following modelines should nicely fold up this help manual.
3414
3415 vim:ft=help:fdm=expr:nowrap
3416 vim:foldexpr=getline(v\:lnum-1)=~'-\\{80}'?'>2'\:getline(v\:lnum-1)=~'=\\{80}'?'>1'\:getline(v\:lnum)=~'=\\{80}'?'0'\:getline(v\:lnum)=~'-\\{80}'?'1'\:'='
3417 vim:foldtext=substitute(v\:folddashes.substitute(getline(v\:foldstart),'\\s*\\*.*',"",""),'^--','\ \ \ \ \ \ ','')
3418 ================================================================================