summaryrefslogtreecommitdiffstats
path: root/Aufgabe7/latexsupport.txt
blob: c58394f11d46acc9b6d9701cc4e338c3357b8b15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
*latexsupport.txt*           LATEX Support                         Mar 17 2006

LaTeX Support                                   *latex-support* *latexsupport*
                            Plugin version 1.6
                      for Vim version 6.0 and above
                     Fritz Mehner  <mehner@fh-swf.de>

Write and run LaTeX programs using menus.

 1.    Usage                                           |latexsupport-usage-gvim|        
 1.1    Menu 'Comments'                                |latexsupport-comm|
 1.1.1   Append aligned comments to consecutive lines  |latexsupport-comm-1|
 1.1.2   Code to comment                               |latexsupport-comm-2|
 1.1.3   Comment to code                               |latexsupport-comm-3|
 1.1.4   Frame comments, file header, ...              |latexsupport-comm-4|
 1.2    Menu 'LaTeX'                                   |latexsupport-latex|
 1.3    Menu 'Wizard'                                  |latexsupport-wizard|
 1.3.1   Menu 'Snippets'                               |latexsupport-snippets|
 1.4    Menu 'Run'                                     |latexsupport-run|
 1.4.1   Save and run                                  |latexsupport-run-1|
 1.4.2   Run lacheck                                   |latexsupport-run-2|
 1.4.3   Make clean                                    |latexsupport-run-3|
 1.4.4   Settings                                      |latexsupport-run-4|
 2.    Hotkeys                                         |latexsupport-hotkeys|           
 3.    Customization and configuration                 |latexsupport-custom|     
 3.1    Global variables                               |latexsupport-custom-1|
 4.    Template files and tags                         |latexsupport-tempfiles|    
 4.1    Template files                                 |latexsupport-tempfiles-1|    
 4.2    Tags                                           |latexsupport-tempfiles-2|
 5.    Dictionaries                                    |latexsupport-dictionary|        
 6.    Extend taglist.vim for LaTeX                    |latexsupport-taglist|     
 7.    Syntax based folding                            |latexsupport-folding|     
 8.    Release Notes                                   |latexsupport-release-notes|     

       How to add this help file to Vim's help         |add-local-help|             


==============================================================================
1.  USAGE WITH GUI  (gVim)                           *latexsupport-usage-gvim*
==============================================================================

If the gvim root menu entry 'LaTeX' is not visible call it with the entry 
"Load LaTeX Support" from the standard Tools-menu.
The entry "Load LaTeX Support" can also be used to unload the LaTeX-root menu.

------------------------------------------------------------------------------
1.1 MENU 'Comments'                                        *latexsupport-comm*
------------------------------------------------------------------------------

1.1.1 APPEND ALIGNED COMMENTS TO CONSECUTIVE LINES       *latexsupport-comm-1*

In NORMAL MODE the menu entry
 'Line End Comm.'
will append "<Tab><Tab><Tab>%<Space>" to the current line.

In VISUAL MODE these entries will append aligned comments to all marked lines.
Marking and commenting the first 3 lines

  \lstset{stepnumber=0}
  \lstset{framesep=2mm}
  \lstset{linewidth=160mm}
  \lstset{xleftmargin=6mm}

yield

  \lstset{stepnumber=0}     % 
  \lstset{framesep=2mm}     % 
  \lstset{linewidth=160mm}  % 
  \lstset{xleftmargin=6mm}

The cursor will be positioned at the end of the first line.

------------------------------------------------------------------------------

1.1.2 CODE TO COMMENT                                    *latexsupport-comm-2*

A marked block

xxxxxxxx
xxxxxxxx
xxxxxxxx

will be changed by the menu entry 'code->comment' into a multiline comment
(all (partially) marked lines):

%xxxxxxxx
%xxxxxxxx
%xxxxxxxx

------------------------------------------------------------------------------

1.1.3 COMMENT TO CODE                                    *latexsupport-comm-3*

If one or more commented lines are marked the entry 'comment->code' will 
them.

------------------------------------------------------------------------------

1.1.4 FRAME COMMENTS, FILE HEADER, ...                   *latexsupport-comm-4*

Frame comments and the file header comment are read as templates from the
appropriate files (see |latexsupport-tempfiles|).


------------------------------------------------------------------------------
1.2  MENU 'LaTeX'                                         *latexsupport-latex*
------------------------------------------------------------------------------

1.2.1  NORMAL MODE, INSERT MODE. 

An empty statement will be inserted. The entry 'environment->\figure{}' will 
insert an empty figure environment, change into insert mode and set the cursor
at the beginning of the 2. line:

\begin{figure}

\end{figure}


1.2.2  VISUAL MODE.

Many entries will set a marked region inside the chosen construct. The
highlighted area 

xxxxx
xxxxx

will be changed to

\begin{figure}
xxxxx
xxxxx
\end{figure}

by the entry 'environment->\figure{}' .

The entry '\ref' changes the marked text 'xxxxxx' in
  aaa xxxxxx bbbbbbbb
to
  aaa \ref{xxxxxx} bbbbbbbb

Some entries will double the marked text.  The entry '\index' changes the
marked text 'xxxxxx' in
  aaa xxxxxx bbbbbbbb
to
  aaa xxxxxx \index{xxxxxx}  bbbbbbbb


------------------------------------------------------------------------------
1.3  MENU 'Wizard'                                       *latexsupport-wizard*
------------------------------------------------------------------------------

1.3.1  CODE SNIPPETS                                   *latexsupport-snippets*

Code snippets are pieces of code which are kept in separate files in a special
directory (e.g. a few lines of code or a complete template for a Makefile).
File names are used to identify the snippets.  The snippet directory will be
created during the installation  ( $HOME/.vim/codesnippets-latex is the
default).  Snippets are managed with the 3 entries 

   LaTeX -> Snippets -> read  code snippet
   LaTeX -> Snippets -> write code snippet
   LaTeX -> Snippets -> edit  code snippet

from the Snippets submenu.

CREATING A NEW SNIPPET  
When nothing is marked, "write code snippet" will write the whole buffer 
to a snippet file, otherwise the marked area will be written to a file.

INSERT A SNIPPET
Select the appropriate file from the snippet directory ("read  code snippet").
The inserted lines will be indented.

EDIT A SNIPPET
This is a normal edit.


------------------------------------------------------------------------------
1.4  MENU 'Run'                                             *latexsupport-run*
------------------------------------------------------------------------------

1.4.1  SAVE AND RUN                                       *latexsupport-run-1*

Save the current buffer and run it through latex. Errors and warnings will be
shown in a quickfix error window. You can navigate using quickfix commands
(see |quickfix|).

1.4.2  RUN lacheck                                        *latexsupport-run-2*

Save the current buffer and run it through lacheck (consistency checker for
LaTeX documents). Errors and warnings will be shown in a quickfix error
window. You can navigate using quickfix commands (see |quickfix|).

1.4.3  MAKE CLEAN                                         *latexsupport-run-3*

This will remove the files with the following extension from the current
working directory:

  aux  bbl  blg  brf  dvi  idx  ilg  ind
  lof  log  lol  lot  out  pdf  ps   toc

This list of extensions is the default. The list can be changed by setting the
global variable  g:LATEX_Files_Clean .

1.4.4  SETTINGS                                           *latexsupport-run-4*

Show the actual settings (global variables, plugin tags, version).

==============================================================================
2.  HOTKEYS                                             *latexsupport-hotkeys*
==============================================================================

The following hot keys are defined in normal, visual and insert mode: 

   Alt-F9   call xdvi
  Ctrl-F9   compile with latex
 Shift-F9   rum make

The hot keys are defined in the file type plugin  tex.vim .


==============================================================================
3.  CUSTOMIZATION                                        *latexsupport-custom*
==============================================================================

------------------------------------------------------------------------------
3.1  GLOBAL VARIABLES                                  *latexsupport-custom-1*
------------------------------------------------------------------------------

Several global variables are checked by the script to customize it:

  ------------------------------------------------------------------------------
  GLOBAL VARIABLE             DEFAULT VALUE                    TAG (see below)
  ------------------------------------------------------------------------------
  g:LATEX_AuthorName          ""                               |AUTHOR|
  g:LATEX_AuthorRef           ""                               |AUTHORREF|
  g:LATEX_Email               ""                               |EMAIL|
  g:LATEX_Company             ""                               |COMPANY|   
  g:LATEX_Project             ""                               |PROJECT|
  g:LATEX_CopyrightHolder     ""                               |COPYRIGHTHOLDER|

  g:LATEX_Template_Directory  $HOME."/.vim/plugin/templates/"
  g:LATEX_File_Header         "tex-file-header"

  g:LATEX_CodeSnippets        $HOME."/.vim/codesnippets-latex/"
  g:LATEX_Dictionary_File     ""
  g:LATEX_LoadMenus           "yes"

  g:LATEX_File_Extension      "tex"  
  g:LATEX_dvi_viewer          "xdvi"
  g:LATEX_ps_viewer           "gv"
  g:LATEX_pdf_viewer          "acroread"
  g:LATEX_Files_Clean         'aux bbl blg brf dvi idx ilg ind lof log lol lot out pdf ps toc'

  ----------------------------------------------------------------------------

1. group: Defines the text which will be inserted for the tags when a template  
          is read in (see also |latexsupport-tempfiles| below).

          g:LATEX_AuthorName         : author name
          g:LATEX_AuthorRef          : author reference (e.g. acronym)
          g:LATEX_Email              : email address
          g:LATEX_Company            : name of the company / institution
          g:LATEX_Project            : project
          g:LATEX_CopyrightHolder    : the copyright holder

2. group: g:LATEX_Template_Directory : Sets the template directory and the names of the 
           ...                         template files (see |latexsupport-tempfiles|).

3. group: g:LATEX_CodeSnippets       : The name of the code snippet directory 
                                       (see |latexsupport-snippets|).
          g:LATEX_Dictionary_File    : The name(s) of the dictionary file(s) used for 
                                       word completion (see also |latexsupport-dictionary|)
          g:LATEX_LoadMenus          : Load menus and mappings ("yes", "no") at startup.

4. group: g:LATEX_File_Extension     : File extension for latex files (default: tex).
          g:LATEX_dvi_viewer         : The standard dvi viewer (default: xdvi).
          g:LATEX_ps_viewer          : The standard Postscript viewer (default: gv).
          g:LATEX_pdf_viewer         : The standard PDF viewer (default: acroread).
          g:LATEX_Files_Clean        : List of file extensions for files to be deleted
                                       (see |latexsupport-run-1|).
          
To override the defaults add appropriate assignments to .vimrc .
Here are my settings as an example:

  let g:LATEX_AuthorName      = "Dr.-Ing. Fritz Mehner"    
  let g:LATEX_AuthorRef       = "Mn"                       
  let g:LATEX_Email           = "mehner@fh-swf.de"         
  let g:LATEX_Company         = "FH Südwestfalen, Iserlohn"


==============================================================================
4.  TEMPLATE FILES AND TAGS                           *latexsupport-tempfiles*
==============================================================================

------------------------------------------------------------------------------
4.1  TEMPLATE FILES                                 *latexsupport-tempfiles-1*
------------------------------------------------------------------------------

Some menu entries generate comments or commented code. Four menu entries
generate block comments:

    Frame Comm. %%
    Frame Comm. ==
    Frame Comm. --
    File Prolog

The file prolog is inserted from a file:

+--------------------------+--------------------------------------------------------+
| menu entry               | global variable           | file (distribution set)    |
+--------------------------+---------------------------+----------------------------+
| LaTeX-file header        | g:LATEX_File_Header       | tex-file-header            |
|                          |                           |                            |
| < future extensions >    |                           |                            |
+--------------------------+--------------------------------------------------------+

The template files can be written or changed by the user to fulfill special
requirements (layout for a project or work group already exists, 
file headers / blocks have to be prepared for a documentation tool, ... ).
They can hold not only comments but a complete file skeleton if this is 
necessary. So you may want to lay out your own templates.


------------------------------------------------------------------------------
4.2  TAGS                                            *latexsupport-tempfiles-2*
------------------------------------------------------------------------------

The comments in these files do not have to be personalized but they can be.
The text can contain the following tags which are replaced by the appropriate
information when the file is read in:

    |AUTHOR|
    |AUTHORREF|
    |COMPANY|
    |COPYRIGHTHOLDER|
    |CURSOR|
    |DATE|
    |EMAIL|
    |FILENAME|
    |PROJECT|
    |TIME|
    |YEAR|

Each tag can occur more than once. The tag |CURSOR| may appear only once.
The tag |CURSOR| will be the cursor position after the block is read in.
There is no need to use any of these tags, some or all can be missing.
The template files can actually be links pointing to existing templates.


==============================================================================
5.  DICTIONARY                                       *latexsupport-dictionary*
==============================================================================

The file  

  wordlists/german.list

is a part of this plugin and can be used (together with your own lists) as
dictionary for automatic word completion. There is no default word list.  If
you want to use it with an additional list MyC.list put the following lines
into .vimrc :

  let g:Latex_Dictionary_File = $HOME."/.vim/wordlists/german.list,".
            \                   $HOME."/.vim/wordlists/MyC.list"
  
The right side is a comma separated list of files. Note the point at the end
of the first line (string concatenation) and the backslash in front of the 
second line (continuation line). 
You can use Vim's dictionary feature CTRL-X, CTRL-K (and CTRL-P, CTRL-N).


==============================================================================
6.  EXTEND taglist.vim FOR LaTeX                        *latexsupport-taglist*     
==============================================================================

The use of the Vim plugin taglist.vim (Author: Yegappan Lakshmanan) is highly
recommended. It uses the program ctags which generates tag files for 3 dozen 
languages (Exuberant Ctags, Darren Hiebert, http://ctags.sourceforge.net).
With the following extensions the structure of a LaTeX document and the list 
of targets in a makefile can be shown in the taglist window.

1) Append the file customization.ctags to the file $HOME/.ctags .  

2) Add the following lines (from customization.vimrc) to $HOME/.vimrc :

  "
  "-------------------------------------------------------------------
  " taglist.vim : define the title texts for LaTeX
  " taglist.vim : define the title texts for make
  "-------------------------------------------------------------------
   noremap <silent> <F11>  <Esc><Esc>:Tlist<CR>
  inoremap <silent> <F11>  <Esc><Esc>:Tlist<CR>
  
  let tlist_tex_settings   = 'latex;s:sections;g:graphics;l:labels'
  
  let tlist_make_settings  = 'make;m:makros;t:targets'


3) restart vim/gvim

The two maps will toggle the taglist window (hot key F11) in all editing modes.
The two assignments define the headings for the make sections in the taglist
window.  


==============================================================================
7.  SYNTAX BASED FOLDING                                *latexsupport-folding*
==============================================================================

The file syntax/tex.vim contains the basic settings for syntax based folding
(see also |folding|). The Vim variable foldlevel is set to 999 :
  set foldlevel=999
i.e. folding starts at block nesting level 999 (i.e. at first there is
no folding at all). 
This could be changed to an appropriate value, e.g. 5. Folding now would start
always at level 5.
The alternative is to keep the level 999 and start folding with the normal
mode command 'zM' (close all folds) and then open those folds needed.

To enable syntax based folding uncomment the last 3 lines in the file
syntax/tex.vim .


==============================================================================
8.  RELEASE NOTES                                 *latexsupport-release-notes*
==============================================================================

See file README.latexsupport .

==============================================================================
vim:tw=78:noet:ts=2:ft=help:norl: