vim-latex-cvs Mailing List for Vim-Latex (Page 8)
Brought to you by:
srinathava,
tmaas
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(82) |
Dec
(124) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(104) |
Feb
(3) |
Mar
(6) |
Apr
(48) |
May
(34) |
Jun
(62) |
Jul
(33) |
Aug
(24) |
Sep
(32) |
Oct
(16) |
Nov
(36) |
Dec
(39) |
2004 |
Jan
|
Feb
(3) |
Mar
(8) |
Apr
|
May
(29) |
Jun
(13) |
Jul
(4) |
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
(6) |
Dec
(9) |
2006 |
Jan
(9) |
Feb
(2) |
Mar
(16) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(1) |
Jul
|
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(17) |
Sep
(3) |
Oct
(4) |
Nov
(1) |
Dec
(3) |
2010 |
Jan
(25) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(8) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(10) |
Oct
(1) |
Nov
|
Dec
(1) |
2012 |
Jan
(5) |
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(4) |
Nov
(1) |
Dec
|
2013 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(15) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
From: <sri...@us...> - 2006-03-20 09:01:11
|
Revision: 995 Author: srinathava Date: 2006-03-20 01:00:55 -0800 (Mon, 20 Mar 2006) ViewCVS: http://svn.sourceforge.net/vim-latex/?rev=995&view=rev Log Message: ----------- New: First stab at documenting the improved \ref and \cite completion. Modified Paths: -------------- trunk/vimfiles/doc/latex-suite.txt trunk/vimfiles/doc/latex-suite.xml Modified: trunk/vimfiles/doc/latex-suite.txt =================================================================== (Binary files differ) Modified: trunk/vimfiles/doc/latex-suite.xml =================================================================== --- trunk/vimfiles/doc/latex-suite.xml 2006-03-20 08:35:08 UTC (rev 994) +++ trunk/vimfiles/doc/latex-suite.xml 2006-03-20 09:00:55 UTC (rev 995) @@ -1445,13 +1445,15 @@ <section id="latex-completion"> <title>Latex Completion</title> <para> - This module provides an easy way to insert references to labels and - bibliographic entries. Although the completion capabilities are very - diverse, &ls; only uses a single key (<literal><F9></literal> by - default) to do all of it. Pressing the <literal><F9></literal> key - does different things based on where you are located. &ls; tries to - guess what you might be trying to complete at the location where you - pressed <literal><F9></literal>. For example, pressing + &ls; provides an easy way to insert references to labels and + bibliographic entries and also provide filename arguments to commands + such as <literal>\includegraphics</literal>. Although the completion + capabilities are very diverse, &ls; only uses a single key + (<literal><F9></literal> by default) to do all of it. Pressing the + <literal><F9></literal> key does different things based on where + you are located. &ls; tries to guess what you might be trying to + complete at the location where you pressed + <literal><F9></literal>. For example, pressing <literal><F9></literal> when you are within a <literal>\ref</literal> command will try to list the <literal>\label</literal>'s in the present directory. Pressing it when @@ -1571,79 +1573,148 @@ <section id="ls-completion-ref"> <title>&ls; \ref completion</title> <para> - If you press <F9> in insert mode when the cursor is positioned - just after the string "<literal>\ref{pre</literal>", then &ls; will - present you with a list of all the <literal>\label</literal>s which - begin with the prefix "pre". If you press <F9> after - <literal>\ref{</literal>, then &ls; will present you with a list of - <emphasis>all</emphasis> labels. See <link - linkend="ls-completion-usage">here</link> for an example. + Pressing <literal><F9></literal> when you are within a partially + completed <literal>\ref</literal> command will split open a window + (named <literal>__OUTLINE__</literal>) which contains a nicely + formatted list of all the <literal>\label</literal>s found in the + present project. The <literal>\label</literal>s are heirarchically + arranged according to which <literal>\section</literal>, + <literal>\subsection</literal> etc of the overall document structure + they are present in. For example, when you first press + <literal><F9></literal> after typing <literal>\ref{</literal>, + you should see something like: + <programlisting> ++-- 54 lines: 2. Kinematics-------------------------------- ++-- 98 lines: 3. Aerodynamics of the MFI thorax------------ ++-- 40 lines: 4. Jump Resonance in Fourbar Mechanisms------ ++-- 28 lines: 5. Design and Fabrication Issues------------- + </programlisting> + Each chapter is |fold|ed away so that you can quickly jump to the + correct section/subsection in which the relevant equation is defined. + This makes inserting references significantly faster for large projects + with hundreds of equations. You can then open some of the folds to see + for example: + <programlisting> ++-- 54 lines: 2. Kinematics-------------------------------- +3. Aerodynamics of the MFI thorax + 3.1. Aerodynamic modeling of the MFI wing forces + 3.1.1. Geometric Specification + eqn:wingnormal-pos + \nhat = T_z(\theta_2) T_y(\theta_y)T_x(\theta_x)\nhat_0, + eqn:T-1 + T_1(\theta_2) &=& T_z(\theta_2) + </programlisting> + The <literal><Tab></literal> key is mapped in this window to + toggle folds so that you can quickly open/close folds in order to + navigate the heirarchy faster. Once you are positioned on a + label, press <literal><Enter></literal>. This closes the + <literal>__OUTLINE__</literal> window, returns to the window in which + you pressed <literal><F9></literal> and inserts the reference + at the current cursor position. </para> + <note> + <title>Filtering labels by prefix</title> <para> - <orderedlist> - <listitem>If <link - linkend="Tex_UseSimpleLabelSearch">Tex_UseSimpleLabelSearch</link> - is set to 1, then &ls; will simply search for - <literal>\label</literal>s in all the <literal>.tex</literal> files - in the directory containing the current file</listitem>. - <listitem>If the <link - linkend="Tex_ProjectSourceFiles">Tex_ProjectSourceFiles</link> - setting is non-empty, then &ls; will search for all labels specified - in the list of files given by the setting above.</listitem> - <listitem>If Tex_UseSimpleLabelSearch is 0 and Tex_ProjectSourceFiles - is empty, then &ls; uses the following logic: - <orderedlist> - <listitem>First &ls; will determine if it can find a master-file - specification as described <link - linkend="latex-master-file-specification">here</link>.</listitem> - <listitem>If it can, then &ls; will search for - <literal>\label</literal>'s in that file first.</listitem> - <listitem>If the master file <literal>\include</literal>'s or - <literal>\input</literal>'s any other files, then &ls; will search - for <literal>\label</literal>'s in those files. The search for - <literal>\include</literal>'d and <literal>\input</literal>'ed files - is recursive, i.e, if an <literal>\include</literal>'d file - <literal>\include</literal>'s another file, then that will be - searched as well and so on.</listitem> - <listitem>If &ls; cannot find a master file specified for this file, - then it will simply search for <literal>\labels</literal> in the - present file.</listitem> - </orderedlist> - </listitem> - </orderedlist> + You can press <literal><F9></literal> after typing part of the + <literal>\label</literal>. In this case, &ls; only presents + <literal>\label</literal>s which begin with the already filled + characters. You can use this to choose between equations, figures, + tables etc. if you consistently label equations to begin with + <literal>eqn:</literal>, figures to begin with <literal>fig:</literal> + etc. For example, with this scheme, pressing + <literal><F9></literal> after typing + <literal>\ref{eqn:</literal> will only list equations. </para> + </note> + <note> <para> - Any command which contains the pattern <literal>ref</literal> in it is - treated as if it is a way to call <literal>\ref</literal> indirectly. - Thus pressing <literal><F9></literal> after something like - <literal>\pref{</literal> will also search for - <literal>\label</literal>'s. + &ls; works the same way if you press <literal><F9></literal> + after any command which contains the letters <literal>ref</literal>. + Thus you can complete <literal>\eqref</literal> in exactly the same + manner. </para> + </note> <note> - <title>HINT</title> + <title>Requirements</title> <para> - By prefixing your labels with eqn:, fig: etc, you can easily filter - out a lot of undesirable results. + This method of preseting the <literal>\label</literal>s depends on Vim + being compiled with python support. To check if you have this, see the + output of the <literal>:ver</literal> command. If you see something + like <literal>+python</literal>, you are all set. Failing this, you + will need to have <literal>python</literal> somewhere in your + <literal>$PATH</literal>. </para> </note> </section> <section id="latex-completion-cite"> <title>&ls; <literal>\cite</literal> completion</title> <para> - When you press <literal><F9></literal> in insert mode after - <literal>\cite{pre</literal>, &ls; will present a list of valid - bibliographic keys starting with <literal>"pre"</literal> and ask you - to choose from one of them. ("pre" can be left empty in which case all - valid bibliographic keys will be listed). The window setup is as - described in section <link linkend="ls-completion-usage" - endterm="ls-completion-usage.title"></link>. + &ls; provides an easy way to insert references to bibliographic + entries. Pressing <literal><F9></literal> when the cursor is + placed inside a partially completed <literal>\cite</literal> command + will split open a new window (named <literal>__OUTLINE__</literal>) + which contains a formatted and syntax highlighted list of all bibtex + entries found. For example, pressing <literal><F9></literal> + after typing <literal>\ref{</literal> should present you with a window + which looks something like this: + <programlisting> +Article [dickinson:science:99] + "Wing rotation and aerodynamic basis of insect flight" + M. H. Dickinson and F-O. Lehman and S. P. Sane + In Science, 1999 + +Article [ellington:84:part1] + "The Aerodynamics of Hovering Insect Flight. I. The Quasi-Steady Analysis" + Ellington, C P + In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984 + +Article [ellington:84:part2] + "The Aerodynamics of Hovering Insect Flight. II. Morphological Parameters" + Ellington, C P + In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984 + </programlisting> </para> <para> + You can easily jump from one entry to another using the + <literal>'n'</literal> and <literal>'p'</literal> keys (to go to the + next / previous entry respectively). + </para> + <para> + You can also filter out a subset of the bibtex entries by pressing + <literal>'f'</literal> while in this window. Doing this presents the + following prompt: + <programlisting> +Field acronyms: (`:let g:Tex_EchoBibFields = 0` to avoid this message) + [t] title [a] author [b] booktitle + [j] journal [y] year [p] bibtype + (you can also enter the complete field name) +Enter filter criterion [field<space>value]: + </programlisting> + At the prompt, type + <programlisting>a ellington</programlisting> + Notice that the letter a is an acronym for <literal>author</literal> + according to the prompt above. Therefore this filter only shows those + bibtex entries whose author field contains the text + <literal>ellington</literal>. You can keep narrowing your selection by + repeatedly filtering the results. If you would like to remove all the + filters and see all entries again, press 'a', which removes + all the filters. + </para> + <para> + You can also sort the bibtex entries based on a field. To do this, + press 's'. This will present you with a prompt like in the case of the + filter and you are asked to choose a field. In this case, you would + type in a single character. This sorts the entries according to that + field. + </para> + <note> + <para> <literal><F9></literal> will also work in a similar way after any command which contains the word <literal>cite</literal> in it. For example, pressing <literal><F9></literal> will also work with <literal>\citenum</literal> etc. </para> + </note> <para> The following logic is applied to find out which bibliographic entries are included in the completion. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sri...@us...> - 2006-03-19 04:29:52
|
Update of /cvsroot/vim-latex/vimfiles/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19268 Modified Files: imaps.vim Log Message: Bug: If there is an abbreviation like this: :iab zzz whatever then typing 'z<space>' triggers the abbreviation in the presence of latex-suite. (Cristian Rigamonti) Why: The reg-exp used to find out if a iab existed was faulty. Fix: Fix the regexp to use an exact match of the previous word. Index: imaps.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/plugin/imaps.vim,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** imaps.vim 30 May 2004 07:35:40 -0000 1.39 --- imaps.vim 19 Mar 2006 04:29:47 -0000 1.40 *************** *** 96,99 **** --- 96,103 ---- " }}} + " line continuation used here. + let s:save_cpo = &cpo + set cpo&vim + " ============================================================================== " Script Options / Variables *************** *** 234,237 **** --- 238,242 ---- if a:char !~ '\k' let lastword = matchstr(getline('.'), '\k\+$', '') + call IMAP_Debug('getting lastword = ['.lastword.']', 'imap') if lastword != '' " An extremeley wierd way to get around the fact that vim *************** *** 240,244 **** let _a = @a exec "redir @a | silent! iab ".lastword." | redir END" ! let abbreviationRHS = matchstr(@a."\n", "\n".'i\s\+'.lastword.'\+\s\+@\?\zs.*\ze'."\n") if @a =~ "No abbreviation found" || abbreviationRHS == "" --- 245,251 ---- let _a = @a exec "redir @a | silent! iab ".lastword." | redir END" ! let abbreviationRHS = matchstr(@a."\n", "\n".'i\s\+'.lastword.'\s\+@\?\zs.*\ze'."\n") ! ! call IMAP_Debug('getting abbreviationRHS = ['.abbreviationRHS.']', 'imap') if @a =~ "No abbreviation found" || abbreviationRHS == "" *************** *** 820,822 **** --- 827,831 ---- " }}} + let &cpo = s:save_cpo + " vim:ft=vim:ts=4:sw=4:noet:fdm=marker:commentstring=\"\ %s:nowrap |
From: <sri...@us...> - 2006-03-03 01:10:37
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7574 Modified Files: texviewer.vim texrc Added Files: bibtools.py Log Message: New: A major new addition to latex-suite. It basically allows for significantly better \cite completion: - a better formatted list of all the entries instead of just dumping the whole bibtex entry. - allows for filtering the results. - allows for sorting the results. --- NEW FILE: bibtools.py --- import re class Bibliography(dict): def __init__(self, txt, macros={}): """ txt: a string which represents the entire bibtex entry. A typical entry is of the form: @ARTICLE{ellington:84:part3, author = {Ellington, C P}, title = {The Aerodynamics of Hovering Insect Flight. III. Kinematics}, journal = {Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences}, year = {1984}, volume = {305}, pages = {41-78}, number = {1122}, owner = {Srinath}, pdf = {C:\srinath\research\papers\Ellington-3-Kinematics.pdf}, timestamp = {2006.01.02}, } """ if macros: for k, v in macros.iteritems(): txt = txt.replace(k, '{'+v+'}') m = re.match(r'\s*@(\w+){((\S+),)?(.*)}\s*', txt, re.MULTILINE | re.DOTALL) if not m: return None self['bibtype'] = m.group(1).capitalize() self['key'] = m.group(3) self['body'] = m.group(4) body = self['body'] self['bodytext'] = '' while 1: m = re.search(r'(\S+?)\s*=\s*(.)', body) if not m: break field = m.group(1) body = body[(m.start(2)+1):] if m.group(2) == '{': # search for the next closing brace. This is not simply a # matter of searching for the next closing brace since # braces can be nested. The following code basically goes # to the next } which has not already been closed by a # following {. mniter = re.finditer(r'{|}', body) count = 1 while 1: try: mn = mniter.next() except StopIteration: return None if mn.group(0) == '{': count += 1 else: count -= 1 if count == 0: value = body[:(mn.start(0))] break elif m.group(2) == '"': # search for the next unquoted double-quote. To be more # precise, a double quote which is preceded by an even # number of double quotes. mn = re.search(r'(?!\\)(\\\\)*"', body) if not mn: return None value = body[:(mn.start(0))] else: mn = re.match(r'\d+', body) if not mn: raise "Only completely numeral fields can be left unquoted" value = m.group(2) + mn.group(0) self[field] = re.sub(r'\s+', ' ', value) body = body[(mn.start(0)+1):] self['bodytext'] += (' %s: %s\n' % (field, value)) if self['bibtype'].lower() == 'string': self['macro'] = {field: value} self['bodytext'] = self['bodytext'].rstrip() def __getitem__(self, key): try: return dict.__getitem__(self, key) except KeyError: return '' def __str__(self): if self['bibtype'].lower() == 'string': return 'String: %(macro)s' % self elif self['bibtype'].lower() == 'article': return ('Article [%(key)s]\n' + 'TI "%(title)s"\n' + 'AU %(author)s\n' + 'IN In %(journal)s, %(year)s') % self elif self['bibtype'].lower() == 'conference': return ('Conference [%(key)s]\n' + 'TI "%(title)s"\n' + 'AU %(author)s\n' + 'IN In %(booktitle)s, %(year)s') % self elif self['bibtype'].lower() == 'mastersthesis': return ('Masters [%(key)s]\n' + 'TI "%(title)s"\n' + 'AU %(author)s\n' + 'IN In %(school)s, %(year)s') % self elif self['bibtype'].lower() == 'phdthesis': return ('PhD [%(key)s]\n' + 'TI "%(title)s"\n' + 'AU %(author)s\n' + 'IN In %(school)s, %(year)s') % self elif self['bibtype'].lower() == 'book': return ('Book [%(key)s]\n' + 'TI "%(title)s"\n' + 'AU %(author)s\n' + 'IN %(publisher)s, %(year)s') % self else: s = '%(bibtype)s [%(key)s]\n' % self if self['title']: s += 'TI "%(title)s"\n' % self if self['author']: s += 'AU %(author)s\n' % self for k, v in self.iteritems(): if k not in ['title', 'author', 'bibtype', 'key', 'id', 'file', 'body', 'bodytext']: s += 'MI %s: %s\n' % (k, v) return s.rstrip() def satisfies(self, filters): for field, regexp in filters: if not re.search(regexp, self[field], re.I): return False return True class BibFile: def __init__(self, filelist=''): self.bibentries = [] self.filters = [] self.macros = {} self.sortfields = [] if filelist: for f in filelist.splitlines(): self.addfile(f) def addfile(self, file): fields = open(file).read().split('@') for f in fields: if not (f and re.match('string', f, re.I)): continue b = Bibliography('@' + f) self.macros.update(b['macro']) for f in fields: if not f or re.match('string', f, re.I): continue b = Bibliography('@' + f, self.macros) if b: b['file'] = file b['id'] = len(self.bibentries) self.bibentries += [b] def addfilter(self, filterspec): self.filters += [filterspec.split()] def rmfilters(self): self.filters = [] def __str__(self): s = '' for b in self.bibentries: if b['key'] and b.satisfies(self.filters): s += '%s\n\n' % b return s def addsortfield(self, field): self.sortfields += [field] def rmsortfields(self): self.sortfields = [] def sort(self): def cmpfun(b1, b2): for f in self.sortfields: c = cmp(b1[f], b2[f]) if c: return c return 0 self.bibentries.sort(cmp=cmpfun) if __name__ == "__main__": import sys bf = BibFile(sys.argv[1]) print bf Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/texviewer.vim,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** texviewer.vim 3 Jan 2006 19:30:38 -0000 1.14 --- texviewer.vim 3 Mar 2006 01:10:32 -0000 1.15 *************** *** 60,64 **** " What to do after <F9> depending on context let s:curfile = expand("%:p") ! let s:curline = strpart(getline('.'), col('.') - 40, 40) let s:prefix = matchstr(s:curline, '.*{\zs.\{-}\(}\|$\)') " a command is of the type --- 60,64 ---- " What to do after <F9> depending on context let s:curfile = expand("%:p") ! let s:curline = strpart(getline('.'), 0, col('.')) let s:prefix = matchstr(s:curline, '.*{\zs.\{-}\(}\|$\)') " a command is of the type *************** *** 105,109 **** elseif exists("s:type") && s:type =~ 'cite' ! if Tex_GetVarValue('Tex_UseJabref') == 1 call Tex_CD(s:origdir) let g:Remote_WaitingForCite = 1 --- 105,119 ---- elseif exists("s:type") && s:type =~ 'cite' ! let s:prefix = matchstr(s:prefix, '\([^,]\+,\)*\zs\([^,]\+\)\ze$') ! call Tex_Debug(":Tex_Complete: using s:prefix = ".s:prefix, "view") ! ! if has('python') && Tex_GetVarValue('Tex_UsePython') ! \ && Tex_GetVarValue('Tex_UseCiteCompletionVer2') == 1 ! ! call Tex_CD(s:origdir) ! silent! call Tex_StartCiteCompletion() ! ! elseif Tex_GetVarValue('Tex_UseJabref') == 1 ! call Tex_CD(s:origdir) let g:Remote_WaitingForCite = 1 *************** *** 118,122 **** " TODO: Is there a way to clear the search-history w/o making a " useless, inefficient search? - let s:prefix = matchstr(s:prefix, '\([^,]\+,\)*\zs\([^,]\+\)\ze$') silent! grep! ____HIGHLY_IMPROBABLE___ % if g:Tex_RememberCiteSearch && exists('s:citeSearchHistory') --- 128,131 ---- *************** *** 548,552 **** call Tex_Debug('trying to search through ['.bibnames.']', 'view') ! let &path = '.,'.g:Tex_BIBINPUTS --- 557,561 ---- call Tex_Debug('trying to search through ['.bibnames.']', 'view') ! let &path = '.,'.g:Tex_BIBINPUTS *************** *** 823,826 **** --- 832,1065 ---- endfunction " }}} + " ============================================================================== + " Functions for presenting a nicer list of bibtex entries + " ============================================================================== + " Tex_FindBibFiles: finds all .bib files used by the main file {{{ + " Description: + function! Tex_FindBibFiles() + + let mainfname = Tex_GetMainFileName(':p') + wincmd n + exec ':e '.mainfname + + if search('\\\(no\)\?bibliography{', 'w') + + call Tex_Debug('Tex_FindBibFiles: found bibliography command in '.bufname('%'), 'view') + + " extract the bibliography filenames from the command. + let bibnames = matchstr(getline('.'), '\\\(no\)\?bibliography{\zs.\{-}\ze}') + let bibnames = substitute(bibnames, '\s', '', 'g') + + call Tex_Debug(':Tex_FindBibFiles: trying to search through ['.bibnames.']', 'view') + + let _path = &path + let &path = '.,'.g:Tex_BIBINPUTS + + let bibfiles = '' + let i = 1 + while Tex_Strntok(bibnames, ',', i) != '' + " split a new window so we do not screw with the current buffer. + split + let thisbufnum = bufnr('%') + + call Tex_Debug(':Tex_FindBibFiles: silent! find '.Tex_Strntok(bibnames, ',', i).'.bib', 'view') + exec 'silent! find '.Tex_Strntok(bibnames, ',', i).'.bib' + if bufnr('%') != thisbufnum + call Tex_Debug(':Tex_FindBibFiles: finding .bib file ['.bufname('%').']', 'view') + " use the appropriate syntax for the .bib file. + let bibfiles = bibfiles.expand('%:p')."\n" + endif + + q + + let i = i + 1 + endwhile + + call Tex_Debug(":Tex_FindBibFiles: returning [".bibfiles."]", "view") + let &path = _path + q + return bibfiles + + else + q + return '' + endif + + endfunction " }}} + " Tex_StartBibtexOutline: sets up an outline window {{{ + + " get the place where this plugin resides for setting cpt and dict options. + " these lines need to be outside the function. + if has('python') && Tex_GetVarValue('Tex_UsePython') + python import sys, re + exec "python sys.path += [r'". s:path . "']" + python import bibtools + endif + + function! Tex_StartCiteCompletion() + let mainfname = Tex_GetMainFileName(':p') + let bibfiles = Tex_FindBibFiles() + + bot split __OUTLINE__ + exec Tex_GetVarValue('Tex_OutlineWindowHeight', 15).' wincmd _' + + exec 'python Tex_BibFile = bibtools.BibFile("""'.bibfiles.'""")' + exec 'python Tex_BibFile.addfilter("key ^'.s:prefix.'")' + call Tex_DisplayBibList() + + nnoremap <Plug>Tex_JumpToNextBibEntry :call search('^\S.*\]$', 'W')<CR>:call Tex_EchoBibShortcuts()<CR>z. + nnoremap <Plug>Tex_JumpToPrevBibEntry :call search('^\S.*\]$', 'bW')<CR>:call Tex_EchoBibShortcuts()<CR>z. + nnoremap <Plug>Tex_FilterBibEntries :call Tex_HandleBibShortcuts('filter')<CR> + nnoremap <Plug>Tex_RemoveBibFilters :call Tex_HandleBibShortcuts('remove_filters')<CR> + nnoremap <Plug>Tex_SortBibEntries :call Tex_HandleBibShortcuts('sort')<CR> + nnoremap <Plug>Tex_CompleteCiteEntry :call Tex_CompleteCiteEntry()<CR> + + nmap <buffer> <silent> n <Plug>Tex_JumpToNextBibEntry + nmap <buffer> <silent> p <Plug>Tex_JumpToPrevBibEntry + nmap <buffer> <silent> f <Plug>Tex_FilterBibEntries + nmap <buffer> <silent> s <Plug>Tex_SortBibEntries + nmap <buffer> <silent> a <Plug>Tex_RemoveBibFilters + nmap <buffer> <silent> q :close<CR> + nmap <buffer> <silent> <CR> <Plug>Tex_CompleteCiteEntry + + endfunction " }}} + " Tex_DisplayBibList: displays the list of bibtex entries {{{ + " Description: + function! Tex_DisplayBibList() + " open the buffer + let _report = &report + let _cmdheight=&cmdheight + let _lazyredraw = &lazyredraw + set report=1000 + set cmdheight=1 + set lazyredraw + + setlocal modifiable + setlocal noswapfile + setlocal buftype=nowrite + setlocal bufhidden=delete + setlocal nowrap + setlocal foldmethod=marker + setlocal foldmarker=<<<,>>> + + + " delete everything in it to the blackhole + % d _ + + exec 'python Tex_CurBuf = vim.current.buffer' + exec 'python Tex_CurBuf[:] = str(Tex_BibFile).splitlines()' + + call Tex_SetupBibSyntax() + + 0 + call Tex_EchoBibShortcuts() + + " once the buffer is initialized, go back to the original settings. + setlocal nomodifiable + setlocal nomodified + let &report = _report + let &cmdheight = _cmdheight + let &lazyredraw = _lazyredraw + + endfunction " }}} + " Tex_EchoBibShortcuts: echos all the shortcuts in the status line {{{ + " Description: + function! Tex_EchoBibShortcuts() + echomsg '(a) all (f) filter (s) sort (n) next (p) previous (q) quit (<CR>) choose' + endfunction " }}} + " Tex_SetupBibSyntax: sets up the syntax items for the outline {{{ + " Description: + function! Tex_SetupBibSyntax() + syn match BibTitleHeader "^TI" contained + syn match BibAuthorHeader "^AU" contained + syn match BibLocationHeader "^IN" contained + syn match BibMiscHeader "^MI" contained + + syn match BibKeyLine '^\S.*\]$' contains=BibKey + syn match BibTitle "^TI .*" contains=BibTitleHeader + syn match BibAuthor "^AU .*" contains=BibAuthorHeader + syn match BibLocation "^IN .*" contains=BibLocationHeader + syn match BibMisc "^MI .*" contains=BibMiscHeader + + hi def link BibTitleHeader Ignore + hi def link BibAuthorHeader Ignore + hi def link BibLocationHeader Ignore + hi def link BibMiscHeader Ignore + + hi def link BibKeyLine Visual + hi def link BibTitle Type + hi def link BibAuthor Special + hi def link BibLocation Comment + hi def link BibMisc Comment + endfunction " }}} + " Tex_HandleBibShortcuts: handles user keypresses {{{ + " Description: + function! Tex_HandleBibShortcuts(command) + + if a:command == 'filter' || a:command == 'sort' + + let fieldprompt = + \ "Field acronyms: (`:let g:Tex_EchoBibFields = 0` to avoid this message)\n" . + \ " [t] title [a] author [b] booktitle \n" . + \ " [j] journal [y] year [p] bibtype \n" . + \ " (you can also enter the complete field name) \n" + + let fieldprompt = Tex_GetVarValue('Tex_BibFieldPrompt', fieldprompt) + + if Tex_GetVarValue('Tex_EchoBibFields', 1) == 1 + echo fieldprompt + endif + + let inp = input('Enter '.a:command.' criterion [field<space>value]: ') + + if inp != '' + " If the field is specified as a single character, then replace + " it with the corresponding 'full form'. + if inp =~ '^[a-z]\>' + if Tex_GetVarValue('Tex_BibAcronym_'.inp[0]) != '' + let inp = substitute(inp, '.', Tex_GetVarValue('Tex_BibAcronym_'.inp[0]), '') + elseif fieldprompt =~ '\['.inp[0].'\]' + let full = matchstr(fieldprompt, '\['.inp[0].'\] \zs\w\+\ze') + let inp = substitute(inp, '.', full, '') + endif + endif + call Tex_Debug(":Tex_HandleBibShortcuts: using inp = [".inp."]", "view") + if a:command == 'filter' + exec 'python Tex_BibFile.addfilter("'.inp.'")' + elseif a:command == 'sort' + exec "python Tex_BibFile.addsortfield(\"".inp."\")" + exec 'python Tex_BibFile.sort()' + endif + call Tex_DisplayBibList() + endif + + elseif a:command == 'remove_filters' + + exec 'python Tex_BibFile.rmfilters()' + exec 'python Tex_BibFile.addfilter("key '.s:prefix.'")' + call Tex_DisplayBibList() + + endif + + endfunction " }}} + " Tex_CompleteCiteEntry: completes cite entry {{{ + " Description: + function! Tex_CompleteCiteEntry() + normal! 0 + call search('\[\S\+\]$', 'W') + if getline('.') !~ '\[\S\+\]$' + call search('\[\S\+\]$', 'bW') + endif + + if getline('.') !~ '\[\S\+\]$' + return + endif + + let ref = matchstr(getline('.'), '\[\zs\S\+\ze\]$') + close + call Tex_Debug(":Tex_CompleteCiteEntry: completing with ".ref, "view") + call Tex_CompleteWord(strpart(ref, strlen(s:prefix))) + endfunction " }}} + com! -nargs=0 TClearCiteHist unlet! s:citeSearchHistory Index: texrc =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/texrc,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** texrc 18 Jun 2004 23:59:48 -0000 1.47 --- texrc 3 Mar 2006 01:10:32 -0000 1.48 *************** *** 551,572 **** " ============================================================================== " TeX Completion: {{{ ! " ! " Options for preview window for ref/cite completion. " Height of cwindow - " Default: 5 TexLet g:Tex_ViewerCwindowHeight = 5 " Height of preview window - " Default: 10 TexLet g:Tex_ViewerPreviewHeight = 10 " Options for explorer completion. " Height of explorer window - " Default: 10 TexLet g:Tex_ExplorerHeight = 10 " Directory for images. Read |latex-completion-explorer| before changing - " Default: '' TexLet g:Tex_ImageDir = '' " whether or not searches for \cite's are cached. TexLet g:Tex_RememberCiteSearch = 0 --- 551,642 ---- " ============================================================================== " TeX Completion: {{{ ! ! " Options for controlling the window sizes of the completion windows {{{ ! ! " The height of the window which contains the \label's (when completing a ! " \ref) or bibtex entries (when completing a \cite). This option is used in ! " the newer methods of completing \ref's and \cite's. ! TexLet g:Tex_OutlineWindowHeight = 15 ! ! " Options for preview window for ref/cite completion. The next two options ! " are used only when g:Tex_UseOutlineCompletion = 0 or ! " g:Tex_UseCiteCompletionVer2 = 0, i.e, when we use a classic method of ! " completing \refs and \cites. " Height of cwindow TexLet g:Tex_ViewerCwindowHeight = 5 " Height of preview window TexLet g:Tex_ViewerPreviewHeight = 10 " Options for explorer completion. " Height of explorer window TexLet g:Tex_ExplorerHeight = 10 " Directory for images. Read |latex-completion-explorer| before changing TexLet g:Tex_ImageDir = '' + " }}} + " Options for completing a \ref {{{ + + " Whether to use the "outline mode" for displaying the \label's while doing + " \ref completion. In this mode, each label is displayed within the + " document element it resides in. The entire thing is folded to ease + " navigation. Should be easier/faster than the classical mode. + TexLet g:Tex_UseOutlineCompletion = 1 + + " This option should be set via the .latexmain file. It should be a newline + " seperated list of files which make up all the "source" files in the + " current project. This enables latex-suite to skip the more complicated + " algorithm of finding the source files by recursively searching for + " \input'ed files from the |latex-master-file|. + " + " Only used when g:Tex_UseOutlineCompletion = 0. + TexLet g:Tex_ProjectSourceFiles = '' + + " Whether latex-suite simply searches for \\label's in all the .tex file + " found in the current directory or whether it will use a more complex + " algorithm. This is used only g:Tex_UseOutlineCompletion = 0 and + " g:Tex_ProjectSourceFiles = ''. + " See + " :help Tex_UseSimpleLabelSearch + " for more information + TexLet g:Tex_UseSimpleLabelSearch = 0 + + " }}} + " Options for completing a \cite'ation {{{ + + " If set to 1, then the newer way of presenting the bibtex entries is used. + " Instead of a |cwindow| showing just the keys and a synced |preview| + " window beneath, show a single window containing a nicely formatted list + " of bibtex entries. This should be faster and easier to use than the + " classic mode + TexLet g:Tex_UseCiteCompletionVer2 = 1 + + " This is a string which is displayed to the user when he wants to sort or + " filter the bibtex entries. This string also serves to define acronyms for + " the various fields of a bibtex entry. + TexLet g:Tex_BibFieldPrompt = + \ "Field acronyms: (`:let g:Tex_EchoBibFields = 0` to avoid this message)\n" . + \ " [t] title [a] author [b] booktitle \n" . + \ " [j] journal [y] year [p] bibtype \n" . + \ " (you can also enter the complete field name) \n" + + " Whether or not to display the string above to aid the user in choosing + " the field to filter/sort with. + TexLet g:Tex_EchoBibFields = 1 + + " A setting of this form defines the letter 'a' as standing for the field + " 'author'. Thus when the user types + " a ellington + " when asked to enter a filter, it is equivalent to the user specifying the + " filter + " author ellington + " TexLet g:Tex_BibAcronym_a = 'author' + + " Whether or not to use Jabref to complete citations + " See + " :help latex-suite-jabref + " for more infomration + TexLet g:Tex_UseJabref = 0 + " whether or not searches for \cite's are cached. TexLet g:Tex_RememberCiteSearch = 0 *************** *** 575,584 **** TexLet g:Tex_TEXINPUTS = '' ! " Whether latex-suite simply searches for \\label's in all the .tex file found ! " in the current directory or whether it will use a more complex algorithm. ! " See ! " :help Tex_UseSimpleLabelSearch ! " for more information ! TexLet g:Tex_UseSimpleLabelSearch = 0 " }}} --- 645,649 ---- TexLet g:Tex_TEXINPUTS = '' ! " }}} " }}} |
From: <sri...@us...> - 2006-02-05 17:53:11
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7831 Modified Files: main.vim Log Message: New: Use Vim7's readfile() function in Tex_CatFile() if available. Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** main.vim 20 Jan 2006 16:35:20 -0000 1.92 --- main.vim 5 Feb 2006 17:53:02 -0000 1.93 *************** *** 926,930 **** endif " }}} " Tex_CatFile: returns the contents of a file in a <NL> seperated string {{{ ! if has('python') && g:Tex_UsePython function! Tex_CatFile(filename) " catFile assigns a value to retval --- 926,934 ---- endif " }}} " Tex_CatFile: returns the contents of a file in a <NL> seperated string {{{ ! if has('*readfile') ! function! Tex_CatFile(filename) ! return join(readfile(filename), "\n") ! endfunction ! elseif has('python') && g:Tex_UsePython function! Tex_CatFile(filename) " catFile assigns a value to retval |
From: <sri...@us...> - 2006-02-02 00:20:39
|
Update of /cvsroot/vim-latex/vimfiles/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15596 Modified Files: imaps.txt latex-suite-quickstart.xml latex-suite.xml latexhelp.txt Log Message: Bug: several typos in the docs (Cristian Rigamonti) Fix: Use aspell ;) (Cristian Rigamonti) Index: imaps.txt =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/doc/imaps.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** imaps.txt 30 Jun 2003 01:20:00 -0000 1.2 --- imaps.txt 2 Feb 2006 00:20:30 -0000 1.3 *************** *** 1,116 **** ! IMAP -- A fluid replacement for :imap ! *imaps.txt* ! Srinath Avadhanula <srinath AT fastmail DOT fm> ! ! ! ! Abstract ! ======== ! This plugin provides a function IMAP() which emulates vims |:imap| function. The ! motivation for providing this plugin is that |:imap| sufffers from problems ! which get increasingly annoying with a large number of mappings. ! ! Consider an example. If you do > ! imap lhs something ! ! ! then a mapping is set up. However, there will be the following problems: ! 1. The 'ttimeout' option will generally limit how easily you can type the lhs. ! if you type the left hand side too slowly, then the mapping will not be ! activated. ! ! 2. If you mistype one of the letters of the lhs, then the mapping is deactivated ! as soon as you backspace to correct the mistake. ! ! 3. The characters in lhs are shown on top of each other. This is fairly ! distracting. This becomes a real annoyance when a lot of characters initiate ! mappings. ! ! This script provides a function IMAP() which does not suffer from these ! problems. ! ! ! ! *imaps.txt-toc* ! |im_1| Using IMAP ! ! ================================================================================ ! Viewing this file ! ! This file can be viewed with all the sections and subsections folded to ease ! navigation. By default, vim does not fold help documents. To create the folds, ! press za now. The folds are created via a foldexpr which can be seen in the ! last section of this file. ! ! See |usr_28.txt| for an introduction to folding and |fold-commands| for key ! sequences and commands to work with folds. ! ! ================================================================================ ! Using IMAP *im_1* *imaps-usage* ! ! ! ! Each call to IMAP is made using the sytax: > ! call IMAP (lhs, rhs, ft [, phs, phe]) ! ! ! This is equivalent to having <lhs> map to <rhs> for all files of type <ft>. ! ! Some characters in the <rhs> have special meaning which help in cursor placement ! as described in |imaps-placeholders|. The optional arguments define these ! special characters. ! ! Example One: > ! call IMAP ("bit`", "\\begin{itemize}\<cr>\\item <++>\<cr>\\end{itemize}<++>", "tex") ! ! ! This effectively sets up the map for "bit`" whenever you edit a latex file. When ! you type in this sequence of letters, the following text is inserted: > ! \begin{itemize} ! \item * ! \end{itemize}<++> ! ! where * shows the cursor position. The cursor position after inserting the text ! is decided by the position of the first "place-holder". Place holders are ! special characters which decide cursor placement and movement. In the example ! above, the place holder characters are <+ and +>. After you have typed in the ! item, press <C-j> and you will be taken to the next set of <++>'s. Therefore by ! placing the <++> characters appropriately, you can minimize the use of movement ! keys. ! ! Set g:Imap_UsePlaceHolders to 0 to disable placeholders altogether. ! ! Set g:Imap_PlaceHolderStart and g:Imap_PlaceHolderEnd to something else if you ! want different place holder characters. Also, b:Imap_PlaceHolderStart and ! b:Imap_PlaceHolderEnd override the values of g:Imap_PlaceHolderStart and ! g:Imap_PlaceHolderEnd respectively. This is useful for setting buffer specific ! place hoders. ! ! Example Two: You can use the <C-r> command to insert dynamic elements such as ! dates. > ! call IMAP ('date`', "\<c-r>=strftime('%b %d %Y')\<cr>", '') ! ! ! ! With this mapping, typing date` will insert the present date into the file. ! ! ================================================================================ ! About this file ! ! This file was created automatically from its XML variant using db2vim. db2vim is ! a python script which understands a very limited subset of the Docbook XML 4.2 ! DTD and outputs a plain text file in vim help format. ! ! db2vim can be obtained via anonymous CVS from sourceforge.net. Use ! ! cvs -d:pserver:ano...@cv...:/cvsroot/vim-latex co db2vim ! ! Or you can visit the web-interface to sourceforge CVS at: ! http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vim-latex/db2vim/ ! ! The following modelines should nicely fold up this help manual. ! ! vim:ft=help:fdm=expr:nowrap ! vim:foldexpr=getline(v\:lnum-1)=~'-\\{80}'?'>2'\:getline(v\:lnum-1)=~'=\\{80}'?'>1'\:getline(v\:lnum)=~'=\\{80}'?'0'\:getline(v\:lnum)=~'-\\{80}'?'1'\:'=' ! vim:foldtext=substitute(v\:folddashes.substitute(getline(v\:foldstart),'\\s*\\*.*',"",""),'^--','--\ \ \ \ ','') ! ================================================================================ --- 1,116 ---- ! IMAP -- A fluid replacement for :imap ! *imaps.txt* ! Srinath Avadhanula <srinath AT fastmail DOT fm> ! ! ! ! Abstract ! ======== ! This plugin provides a function IMAP() which emulates vims |:imap| function. The ! motivation for providing this plugin is that |:imap| suffers from problems ! which get increasingly annoying with a large number of mappings. ! ! Consider an example. If you do > ! imap lhs something ! ! ! then a mapping is set up. However, there will be the following problems: ! 1. The 'ttimeout' option will generally limit how easily you can type the lhs. ! if you type the left hand side too slowly, then the mapping will not be ! activated. ! ! 2. If you mistype one of the letters of the lhs, then the mapping is deactivated ! as soon as you backspace to correct the mistake. ! ! 3. The characters in lhs are shown on top of each other. This is fairly ! distracting. This becomes a real annoyance when a lot of characters initiate ! mappings. ! ! This script provides a function IMAP() which does not suffer from these ! problems. ! ! ! ! *imaps.txt-toc* ! |im_1| Using IMAP ! ! ================================================================================ ! Viewing this file ! ! This file can be viewed with all the sections and subsections folded to ease ! navigation. By default, vim does not fold help documents. To create the folds, ! press za now. The folds are created via a foldexpr which can be seen in the ! last section of this file. ! ! See |usr_28.txt| for an introduction to folding and |fold-commands| for key ! sequences and commands to work with folds. ! ! ================================================================================ ! Using IMAP *im_1* *imaps-usage* ! ! ! ! Each call to IMAP is made using the syntax: > ! call IMAP (lhs, rhs, ft [, phs, phe]) ! ! ! This is equivalent to having <lhs> map to <rhs> for all files of type <ft>. ! ! Some characters in the <rhs> have special meaning which help in cursor placement ! as described in |imaps-placeholders|. The optional arguments define these ! special characters. ! ! Example One: > ! call IMAP ("bit`", "\\begin{itemize}\<cr>\\item <++>\<cr>\\end{itemize}<++>", "tex") ! ! ! This effectively sets up the map for "bit`" whenever you edit a latex file. When ! you type in this sequence of letters, the following text is inserted: > ! \begin{itemize} ! \item * ! \end{itemize}<++> ! ! where * shows the cursor position. The cursor position after inserting the text ! is decided by the position of the first "place-holder". Place holders are ! special characters which decide cursor placement and movement. In the example ! above, the place holder characters are <+ and +>. After you have typed in the ! item, press <C-j> and you will be taken to the next set of <++>'s. Therefore by ! placing the <++> characters appropriately, you can minimize the use of movement ! keys. ! ! Set g:Imap_UsePlaceHolders to 0 to disable placeholders altogether. ! ! Set g:Imap_PlaceHolderStart and g:Imap_PlaceHolderEnd to something else if you ! want different place holder characters. Also, b:Imap_PlaceHolderStart and ! b:Imap_PlaceHolderEnd override the values of g:Imap_PlaceHolderStart and ! g:Imap_PlaceHolderEnd respectively. This is useful for setting buffer specific ! place holders. ! ! Example Two: You can use the <C-r> command to insert dynamic elements such as ! dates. > ! call IMAP ('date`', "\<c-r>=strftime('%b %d %Y')\<cr>", '') ! ! ! ! With this mapping, typing date` will insert the present date into the file. ! ! ================================================================================ ! About this file ! ! This file was created automatically from its XML variant using db2vim. db2vim is ! a python script which understands a very limited subset of the Docbook XML 4.2 ! DTD and outputs a plain text file in vim help format. ! ! db2vim can be obtained via anonymous CVS from sourceforge.net. Use ! ! cvs -d:pserver:ano...@cv...:/cvsroot/vim-latex co db2vim ! ! Or you can visit the web-interface to sourceforge CVS at: ! http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vim-latex/db2vim/ ! ! The following modelines should nicely fold up this help manual. ! ! vim:ft=help:fdm=expr:nowrap ! vim:foldexpr=getline(v\:lnum-1)=~'-\\{80}'?'>2'\:getline(v\:lnum-1)=~'=\\{80}'?'>1'\:getline(v\:lnum)=~'=\\{80}'?'0'\:getline(v\:lnum)=~'-\\{80}'?'1'\:'=' ! vim:foldtext=substitute(v\:folddashes.substitute(getline(v\:foldstart),'\\s*\\*.*',"",""),'^--','--\ \ \ \ ','') ! ================================================================================ Index: latex-suite-quickstart.xml =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/doc/latex-suite-quickstart.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** latex-suite-quickstart.xml 22 Jul 2004 00:41:17 -0000 1.2 --- latex-suite-quickstart.xml 2 Feb 2006 00:20:30 -0000 1.3 *************** *** 1,471 **** ! <?xml version='1.0' encoding='ISO-8859-1'?> ! ! <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" ! "docbook-xml/docbookx.dtd" ! [<!ENTITY dummy "dummy"> ! <!ENTITY date "$Date$"> ! <!ENTITY ls "Latex-Suite"> ! <!ENTITY latex "LaTeX"> ! <!ENTITY vim "Vim"> ! <!ENTITY ph "<++>"> ! ]> ! <article lang="en"> ! <articleinfo id="lsq-articleinfo"> ! ! <title id="lsq-articleinfo-title">A (very) quick introduction to Latex-Suite</title> ! ! <author> ! <firstname>Srinath</firstname> ! <surname>Avadhanula</surname> ! <affiliation> ! <address><email>srinath AT fastmail DOT fm</email></address> ! </affiliation> ! </author> ! ! <abstract> ! &ls; is a comprehensive set of scripts to aid in editing, compiling and ! viewing &latex; documents. A thorough explanation of the full ! capabilities of &ls; is described in the user manual. This guide on the ! other hand, provides a quick 30-45 minute running start to some of the ! more commonly used functionalities of &ls;. ! </abstract> ! ! <date>&date;</date> ! ! </articleinfo> ! <section id="lsq-using-tutorial"> ! <title id="using-tutorial">Using this tutorial</title> ! <para> ! This tutorial assumes that you have vim version 6.1+ installed on your ! machine. To check, open vim and type ! <programlisting>:ver</programlisting> ! You will see the version in the first line of the output. Get the latest ! vim version from <ulink url="http://vim.sf.net">http://vim.sf.net</ulink>. ! </para> ! <para> ! Assuming you have Vim 6.1+ already up and running, follow the ! instructions <ulink ! url="http://vim-latex.sourceforge.net/index.php?subject=download&title=Download">here</ulink> ! to set up Latex-Suite. Remember to make sure your ! <literal>'grepprg'</literal> setting of &vim; works. ! </para> ! <para> ! Good, now you are all set to start the tutorial. Since this tutorial ! aims to explain the newbie-friendly version of &ls;, it needs some GUI ! functionality. Therefore, at least for this tutorial, open the gui ! version of vim. (On MS windows, this is the default). Open up this help ! file in either the same gvim session in a split window or in a different ! session and follow the (friendly) instructions. ! </para> ! </section> ! <section id="lsq-inserting-template"> ! <title id="inserting-template-title">Inserting a template</title> ! <para> ! Start up gvim and begin editing a new file. ! <programlisting>e newfile.tex</programlisting> ! If the installation went well, you should see a new set of ! menus appear. Goto <literal>Tex-Suite > Templates</literal>. You will see ! a number of templates to choose from. For now, choose to insert a ! template for an article. You should get the following in the main ! vim window (after possibly a hit-enter prompt). ! <programlisting> ! 1 % File: sample.tex ! 2 % Created: Sun Jun 22 04:00 PM 2003 P ! 3 % Last Change: Sun Jun 22 04:00 PM 2003 P ! 4 % ! 5 \documentclass[a4paper]{article} ! 6 \begin{document} ! 7 ! 8 \end{document} ! 9 ! 10 ~ ! 11 ~ ! 12 ~ ! 13 ~ ! -- INSERT -- 7,1 All ! </programlisting> ! </para> ! <imageobject> ! <imagedata fileref="" format="png"></imagedata> ! </imageobject> ! <para> ! The cursor is left on line 7 (just after the ! <literal>\begin{document}</literal> line) from where you can start ! typing straight away. Trying to lessen movement is a recurring theme in ! Latex-Suite. ! </para> ! </section> ! <section id="lsq-lsq-inserting-package"> ! <title>Inserting a package</title> ! <para> ! Assume that we are writing a mathematical paper and we want to use the ! popular amsmath package. We will use some functionality which ! Latex-Suite provides specifically for including LaTeX packages, ! providing options etc. Navigate to before the ! <literal>\begin{document}</literal> line (The portion of the document ! before the <literal>\begin{document}</literal> is called the ! <emphasis>preamble</emphasis> in LaTeX). On an empty line in the ! preamble, type the single word <literal>amsmath</literal> and then press ! <literal><F5></literal> in normal mode. The line will change to ! <programlisting>\usepackage[]{amsmath}&ph;</programlisting> ! with the cursor positioned conviniently between the ! <literal>[]</literal>'s. For now, do not worry about the trailing ! <literal>&ph;</literal> at the end of this line. Assume we want to ! provide the <literal>sumlimits</literal> options to amsmath. You can ! either type in this option manually, or choose from a menu of package ! options which Latex-Suite automatically creates when you insert a ! package using <literal><F5></literal>. With the cursor still ! placed between the <literal>[]</literal>, goto <literal>TeX-Suite > ! Packages > amsmath Options</literal>. Choose the ! <literal>sumlimits</literal> option. The package line should get ! converted to: ! <programlisting>\usepackage[sumlimits,]{amsmath}&ph;</programlisting> ! </para> ! <para> ! with the cursor before <literal>]</literal>. Press ! <literal><C-j></literal> in insert mode. You will see the cursor ! jump to the end of the package line and the trailing ! <literal>&ph;</literal> will dissapear. What just happened?! You had ! your first taste of <emphasis>Placeholders</emphasis>. Read more about ! them (later) <ulink ! url="http://vim-latex.sourceforge.net/documentation/latex-suite/latex-macros.html">here</ulink>. ! In short, pressing <literal><C-j></literal> in insert mode takes ! you to the next <literal>&ph;</literal> in the text. ! </para> ! </section> ! <section id="lsq-insert-environment"> ! <title>Inserting an Environment</title> ! <para> ! Now let us type in a simple formula in LaTeX. Move back to the body of ! the document (The portion of the document between ! <literal>\begin{document}</literal> and ! <literal>\end{document}</literal> is called the body). Type in a few ! simple sentences and then on an empty line, type the single word ! <literal>eqnarray</literal>. Escape to normal mode and press ! <literal><F5></literal>. (Remember: ! <literal><F5></literal> is very useful!) This time, the line will ! change to: ! <programlisting>\begin{eqnarray} ! \label{}&ph; ! \end{eqnarray}&ph;</programlisting> ! with the cursor between the <literal>{}</literal>. Enter a label. We ! will use <literal>eqn:euler</literal>. After typing in ! <literal>eqn:euler</literal>, press <literal><C-j></literal>. This ! will take you outside the curly-braces. Another time you used a ! Placeholder! ! </para> ! </section> ! <section id="lsq-keyboard-shortcuts"> ! <title>A few keyboard shortcuts</title> ! <para> ! Now to type in the famous Euler formula. Our aim is to type ! <programlisting>e^{j\pi} + 1 &=& 0</programlisting> Instead ! of typing this blindly, let us use a few shortcuts to reduce ! movement. Start out by typing <literal>e^</literal>. Now instead of ! typing <literal>{</literal>, type another <literal>^</literal>. You ! will see the <literal>e^^</literal> change instantly to ! <literal>e^{}&ph;</literal> with the cursor between ! <literal>{}</literal>'s. (The <literal>^^</literal> changed to ! <literal>^{}&ph;</literal>.) Continue with the following sequence of ! letters: <literal>j`p</literal>. This will change instantly to ! <literal>j\pi</literal>. (The <literal>`p</literal> changed to ! <literal>\pi</literal>.) Having typed in all we need to type between ! the <literal>{}</literal>'s, press <literal><C-j></literal>. ! You will pop back out of the curly-braces. Continue typing the rest ! of the formula. You can use <literal>==</literal> as a shortcut for ! <literal>&=&</literal>. Latex-Suite provides a large number ! of such shortcuts which should making typing much more fun and fast ! if you get acquainted with them. A list is provided <ulink ! url="http://vim-latex.sourceforge.net/documentation/latex-suite/auc-tex-mappings.html">here</ulink>. Definitely spend some time getting a feel for ! them. Most of them are pretty intuitive like <literal>`/</literal> ! for <literal>\frac{}{}</literal>, <literal>`8</literal> for ! <literal>\infty</literal> etc. ! </para> ! <para> ! In order to understand the next section better, it will be helpful ! to have one more <literal>\label</literal>. Lets use the handy ! <literal><F5></literal> ! key to insert another equation. This time something simple like the ! following will do: ! <programlisting>\begin{eqnarray} ! \label{eqn:simple} ! 1 + 1 = 2 ! \end{eqnarray}</programlisting> ! </para> ! </section> ! <section id="lsq-folding"> ! <title>Folding in &ls;</title> ! <para> ! Okay, we have typed enough. At this stage, hopefully, your file is ! looking something like this: ! <programlisting> ! 1 % File: sample.tex ! 2 % Created: Sun Jun 22 04:00 PM 2003 P ! 3 % Last Change: Mon Dec 15 07:00 PM 2003 ! 4 % ! 5 \documentclass[a4paper]{article} ! 6 ! 7 \usepackage[sumlimits,]{amsmath} ! 8 ! 9 \begin{document} ! 10 \begin{eqnarray} ! 11 \label{eqn:euler} ! 12 e^{j\pi} + 1 &=& 0 ! 13 \end{eqnarray} ! 14 This is the famous euler equation. I ! 15 will type another equation, just as ! 16 true: ! 17 \begin{eqnarray} ! 18 \label{eqn:simple} ! 19 1 + 1 &=& 2 ! 20 \end{eqnarray} ! 21 This is my contribution to mathematics. ! 22 \end{document} ! </programlisting> ! In normal mode, press <literal>\rf</literal>. This will fold up the ! entire file and you should see the file looking as below: ! <programlisting> ! 1 % File: sample.tex ! 2 % Created: Sun Jun 22 04:00 PM 2003 P ! 3 % Last Change: Mon Dec 15 07:00 PM 2003 ! 4 % ! 5 +-- 4 lines: Preamble: \documentclass[a4paper]{article} ----- ! 9 \begin{document} ! 10 +-- 4 lines: eqnarray (eqn:euler) \label{eqn:euler} ----------- ! 14 This is the famous euler equation. I ! 15 will type another equation, just as ! 16 true: ! 10 +-- 4 lines: eqnarray (eqn:simple) \label{eqn:simple} --------- ! 21 This is my contribution to mathematics. ! 22 \end{document} ! </programlisting> ! What has happened is that &ls; folded away blocks of &latex; code into ! folded regions. You can open and close folds by using the command ! <literal>za</literal> in normal mode. ! </para> ! </section> ! <section id="lsq-inserting-reference"> ! <title>Inserting a Reference</title> ! <para> ! A necessary part of LaTeX editing is referencing equations, figures, ! bibliographic entries etc. This is done with the ! <literal>\ref</literal> and the <literal>\cite</literal> commands. ! Latex-Suite provides an easy way to do this. Somewhere in the body of ! the document, type in the following sentence ! <programlisting>This is a reference to (\ref{}).</programlisting> ! With the cursor between the <literal>{}</literal> press ! <literal><F9></literal> in insert mode. Your vim session will ! sprout two new windows and it should look like below: ! <programlisting> ! 9 \begin{document} ! 10 +-- 4 lines: eqnarray (eqn:euler) : \label{eqn:euler}----------------------- ! 14 This is the famous euler equation. I ! 15 will type another equation, just as ! 16 true: ! 17 +-- 4 lines: eqnarray (eqn:simple) : \label{eqn:simple}--------------------- ! 21 This is my contribution to mathematics. ! 22 This is a reference to (\ref{}<++>)<++> ! 23 \end{document} ! ~ ! ~ ! ~ ! test.tex [+] 22,29 Bot ! test.tex|11| \label{eqn:euler} ! test.tex|18| \label{eqn:simple} ! ~ ! ~ ! ~ ! [Error List] 1,1 All ! 7 \usepackage[sumlimits,]{amsmath} ! 8 ! 9 \begin{document} ! 10 \begin{eqnarray} ! 11 \label{eqn:euler} ! 12 e^{j\pi} + 1 &=& 0 ! 13 \end{eqnarray} ! 14 This is the famous euler equation. I ! 15 will type another equation, just as ! 16 true: ! test.tex [Preview][+] 11,2-5 46% ! </programlisting> ! </para> ! <imageobject> ! <imagedata fileref="" format=""></imagedata> ! </imageobject> ! <para> ! The cursor will relocate to the middle window which shows all ! <literal>\label</literal>s found in all the <literal>.tex</literal> file ! in the current directory. ! You can scroll up and down in the middle window till you reach the ! reference you want to insert. Notice how when you scroll in the ! middle window, the bottom "Preview" window scrolls automatically to ! show you the location of the current selection. This helps you ! identify the reference with greater ease because often times, ! <literal>\labels</literal> are not descriptive enough or there might be too ! many of them. To insert the reference, just position the cursor on ! the relevant line in the middle window and press ! <literal><enter></literal>. The line which you were editing will change ! to: ! <programlisting>This is a reference to (\ref{eqn:euler})</programlisting> ! and the bottom windows close automatically. ! </para> ! <para> ! The <literal><F9></literal> key also works for inserting ! <literal>\cite</literal> commands to reference bibliographich entries, ! inserting file names for the <literal>\inputgraphics</literal> command ! and just plain searching for words. Click <ulink ! url="http://vim-latex.sourceforge.net/documentation/latex-suite/latex-completion.html">here</ulink> ! for more information. ! </para> ! </section> ! <section id="lsq-compiling"> ! <title>Compiling a document</title> ! <para> ! Great! We have just created a small latex file. The next step is to ! make the latex compiler create a .dvi file from it. Compiling via ! latex-suite is simple. Goto normal mode and press <literal>\ll</literal> ! (replace <literal>\</literal> with whatever <literal>mapleader</literal> setting you ! have). This will call the latex compiler. If all goes well, then ! the focus should return to the vim window. ! </para> ! <para> ! Nothing happend? Ouch! You might need to do some additional settings as ! described <ulink ! url="http://vim-latex.sourceforge.net/index.php?subject=faq&title=FAQ#faq-2">here.</ulink> ! </para> ! <section id="lsq-debugging"> ! <title>Debugging LaTeX source files</title> ! <para> ! To illustrate the debugging procedure, let's create a few mistakes ! in the file. Insert the following ``mistakes'' in the file: ! <programlisting>This is a $\mistake$. ! And this is $\another$</programlisting> ! Now press <literal>\ll</literal> again. This time you will notice that ! after compilation finishes, the cursor automatically lands on ! <literal>$\mistake$</literal>. In addition, 2 new windows will appear ! as shown here: ! </para> ! <imageobject> ! <imagedata fileref="" format=""></imagedata> ! </imageobject> ! <para> ! The middle window is an <emphasis>Error List</emphasis> window ! showing you the errors which the latex compiler found. Th bottom ! window is a <emphasis>Log Preview</emphasis> window, which shows you ! the context of the error made by displaying the relevant portion of ! the <literal>.log</literal> file created during the latex ! compilation procedure. Jump to the <emphasis>Error List</emphasis> ! window and try scrolling around in it using either the <literal>j, ! k</literal> keys or the arrow keys. You will notice that the ! <emphasis>Log Preview</emphasis> window scrolls automatically to ! retain the context of the error you are currently located on. If you ! press <literal><enter></literal> on any line, you will see the ! cursor jump to the location of the error. Latex-Suite tries to guess ! the column location as best as it can so you can continue typing ! straight away. ! </para> ! </section> ! <para> ! Having got a taste for compiling, proceed by deleting the erroneous ! lines and re-compiling. ! </para> ! <para> ! The Latex-Suite compiler is capable of much more including ! selectively filtering out common errors which you might want to ! ignore for the moment, compiling parts of a document, setting ! levels of verbosity in the compiler output etc. See <ulink ! url="http://vim-latex.sourceforge.net/documentation/latex-suite/latex-compiling.html">here</ulink> ! for more. ! </para> ! </section> ! <section id="lsq-viewing-dvi"> ! <title>Viewing DVI files</title> ! <para> ! Now that you have compiled your first latex source, its time to ! view it. Again, this should be pretty simple. Press ! <literal>\lv</literal> in normal mode. Depending on your platform, a DVI ! viewer program should open up and display the dvi file generated in ! compilation step previously. ! </para> ! <para> ! Nothing happend? Ouch! You might need to do some additional settings as ! described <ulink ! url="http://vim-latex.sourceforge.net/index.php?subject=faq&title=FAQ#faq-3">here.</ulink> ! </para> ! <section id="lsq-quick-forward-searching"> ! <title>Performing forward searches</title> ! <para> ! If you are using a modern DVI viewer, then it is possible to do what ! is called forward and inverse searching. However, you will need to ! customize the standard Latex-Suite distribution in order to utilize ! this functionality. Type in the following on the command line: ! ! <programlisting>:let g:Tex_CompileRule_dvi = 'latex -src-specials -interaction=nonstopmode $*' ! :TCTarget dvi</programlisting> ! ! Now recompile the latex file by pressing <literal>\ll</literal>. ! This time, instead of pressing <literal>\lv</literal> to view the ! file, press <literal>\ls</literal> from within the tex file. If the ! DVI viewer supports forward searching (most of them do), then the ! viewer will actually display the portion of the DVI file ! corresponding to the location where you were editing the tex file. ! </para> ! <note> ! <para> ! The reason Latex-Suite does not have this setting by default is ! that on some systems this causes unpredictable results in the DVI ! output. If you find the DVI output satisfactory, then you can ! insert the first of the 2 lines above into your ! <literal>$VIM/ftplugin/tex.vim</literal> file. ! <literal>$VIM</literal> is <literal>~/vimfiles</literal> for ! windows and <literal>~/.vim</literal> for *nix machines. ! </para> ! </note> ! </section> ! <section id="lsq-quick-inverse-searching"> ! <title>Performing inverse searches</title> ! <para> ! Most DVI viewers also support inverse searching, whereby you can ! make the DVI viewer ask vim to display the tex source corresponding ! to the DVI file being shown. This is extremeley helpful while ! proofreading large documents. ! </para> ! ! <para> ! Simply double-click anywhere in the viewer window. If the viewer ! supports it, then it will attempt to open an editor window at the ! location corresponding to where you double-clicked. On *nix ! platforms, Latex-Suite attempts to start the viewer program in such ! a way that it already knows to use vim to open the tex source. Thus ! you should see a vim window open up showing the tex file. However, ! if there is an error, or some other program is used, you will need ! to tell the viewer program to use gvim as the editor. On windows ! platforms, if you use the commonly available <literal>yap</literal> ! viewer (available as part of the miktex distribution), then this ! option can be set from <literal>View > Options > Inverse ! Search</literal>. In the <literal>Command line:</literal> window, ! write ! <programlisting>"C:\Program Files\vim\vim61\gvim" -c ":RemoteOpen +%l %f"</programlisting> ! (Customize the path according to where you have installed gvim). ! If you double click in the view pane now, you will see gvim start ! up and take you to the relevant portion of the tex file. ! </para> ! </section> ! </section> ! <section id="lsq-conclusions"> ! <title>Conclusions</title> ! <para> ! Thats all folks! By now, you should know enough of the basic functions ! of latex-suite. Ofcourse, latex-suite is capable of much, much more such ! as compiling files multiple times to resolve changed labels, compiling ! dependencies, handling user packages and more. To get a feel for that, ! you will need to take a look at the <ulink ! url="http://vim-latex.sourceforge.net/index.php?subject=manual&title=Manual#user-manual">&ls; ! user manual.</ulink> ! </para> ! </section> ! </article> ! ! <!-- ! vim: et:sw=1:ts=1 ! --> --- 1,471 ---- ! <?xml version='1.0' encoding='ISO-8859-1'?> ! ! <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" ! "docbook-xml/docbookx.dtd" ! [<!ENTITY dummy "dummy"> ! <!ENTITY date "$Date$"> ! <!ENTITY ls "Latex-Suite"> ! <!ENTITY latex "LaTeX"> ! <!ENTITY vim "Vim"> ! <!ENTITY ph "<++>"> ! ]> ! <article lang="en"> ! <articleinfo id="lsq-articleinfo"> ! ! <title id="lsq-articleinfo-title">A (very) quick introduction to Latex-Suite</title> ! ! <author> ! <firstname>Srinath</firstname> ! <surname>Avadhanula</surname> ! <affiliation> ! <address><email>srinath AT fastmail DOT fm</email></address> ! </affiliation> ! </author> ! ! <abstract> ! &ls; is a comprehensive set of scripts to aid in editing, compiling and ! viewing &latex; documents. A thorough explanation of the full ! capabilities of &ls; is described in the user manual. This guide on the ! other hand, provides a quick 30-45 minute running start to some of the ! more commonly used functionalities of &ls;. ! </abstract> ! ! <date>&date;</date> ! ! </articleinfo> ! <section id="lsq-using-tutorial"> ! <title id="using-tutorial">Using this tutorial</title> ! <para> ! This tutorial assumes that you have vim version 6.1+ installed on your ! machine. To check, open vim and type ! <programlisting>:ver</programlisting> ! You will see the version in the first line of the output. Get the latest ! vim version from <ulink url="http://vim.sf.net">http://vim.sf.net</ulink>. ! </para> ! <para> ! Assuming you have Vim 6.1+ already up and running, follow the ! instructions <ulink ! url="http://vim-latex.sourceforge.net/index.php?subject=download&title=Download">here</ulink> ! to set up Latex-Suite. Remember to make sure your ! <literal>'grepprg'</literal> setting of &vim; works. ! </para> ! <para> ! Good, now you are all set to start the tutorial. Since this tutorial ! aims to explain the newbie-friendly version of &ls;, it needs some GUI ! functionality. Therefore, at least for this tutorial, open the gui ! version of vim. (On MS windows, this is the default). Open up this help ! file in either the same gvim session in a split window or in a different ! session and follow the (friendly) instructions. ! </para> ! </section> ! <section id="lsq-inserting-template"> ! <title id="inserting-template-title">Inserting a template</title> ! <para> ! Start up gvim and begin editing a new file. ! <programlisting>e newfile.tex</programlisting> ! If the installation went well, you should see a new set of ! menus appear. Goto <literal>Tex-Suite > Templates</literal>. You will see ! a number of templates to choose from. For now, choose to insert a ! template for an article. You should get the following in the main ! vim window (after possibly a hit-enter prompt). ! <programlisting> ! 1 % File: sample.tex ! 2 % Created: Sun Jun 22 04:00 PM 2003 P ! 3 % Last Change: Sun Jun 22 04:00 PM 2003 P ! 4 % ! 5 \documentclass[a4paper]{article} ! 6 \begin{document} ! 7 ! 8 \end{document} ! 9 ! 10 ~ ! 11 ~ ! 12 ~ ! 13 ~ ! -- INSERT -- 7,1 All ! </programlisting> ! </para> ! <imageobject> ! <imagedata fileref="" format="png"></imagedata> ! </imageobject> ! <para> ! The cursor is left on line 7 (just after the ! <literal>\begin{document}</literal> line) from where you can start ! typing straight away. Trying to lessen movement is a recurring theme in ! Latex-Suite. ! </para> ! </section> ! <section id="lsq-lsq-inserting-package"> ! <title>Inserting a package</title> ! <para> ! Assume that we are writing a mathematical paper and we want to use the ! popular amsmath package. We will use some functionality which ! Latex-Suite provides specifically for including LaTeX packages, ! providing options etc. Navigate to before the ! <literal>\begin{document}</literal> line (The portion of the document ! before the <literal>\begin{document}</literal> is called the ! <emphasis>preamble</emphasis> in LaTeX). On an empty line in the ! preamble, type the single word <literal>amsmath</literal> and then press ! <literal><F5></literal> in normal mode. The line will change to ! <programlisting>\usepackage[]{amsmath}&ph;</programlisting> ! with the cursor positioned conveniently between the ! <literal>[]</literal>'s. For now, do not worry about the trailing ! <literal>&ph;</literal> at the end of this line. Assume we want to ! provide the <literal>sumlimits</literal> options to amsmath. You can ! either type in this option manually, or choose from a menu of package ! options which Latex-Suite automatically creates when you insert a ! package using <literal><F5></literal>. With the cursor still ! placed between the <literal>[]</literal>, goto <literal>TeX-Suite > ! Packages > amsmath Options</literal>. Choose the ! <literal>sumlimits</literal> option. The package line should get ! converted to: ! <programlisting>\usepackage[sumlimits,]{amsmath}&ph;</programlisting> ! </para> ! <para> ! with the cursor before <literal>]</literal>. Press ! <literal><C-j></literal> in insert mode. You will see the cursor ! jump to the end of the package line and the trailing ! <literal>&ph;</literal> will disappear. What just happened?! You had ! your first taste of <emphasis>Placeholders</emphasis>. Read more about ! them (later) <ulink ! url="http://vim-latex.sourceforge.net/documentation/latex-suite/latex-macros.html">here</ulink>. ! In short, pressing <literal><C-j></literal> in insert mode takes ! you to the next <literal>&ph;</literal> in the text. ! </para> ! </section> ! <section id="lsq-insert-environment"> ! <title>Inserting an Environment</title> ! <para> ! Now let us type in a simple formula in LaTeX. Move back to the body of ! the document (The portion of the document between ! <literal>\begin{document}</literal> and ! <literal>\end{document}</literal> is called the body). Type in a few ! simple sentences and then on an empty line, type the single word ! <literal>eqnarray</literal>. Escape to normal mode and press ! <literal><F5></literal>. (Remember: ! <literal><F5></literal> is very useful!) This time, the line will ! change to: ! <programlisting>\begin{eqnarray} ! \label{}&ph; ! \end{eqnarray}&ph;</programlisting> ! with the cursor between the <literal>{}</literal>. Enter a label. We ! will use <literal>eqn:euler</literal>. After typing in ! <literal>eqn:euler</literal>, press <literal><C-j></literal>. This ! will take you outside the curly-braces. Another time you used a ! Placeholder! ! </para> ! </section> ! <section id="lsq-keyboard-shortcuts"> ! <title>A few keyboard shortcuts</title> ! <para> ! Now to type in the famous Euler formula. Our aim is to type ! <programlisting>e^{j\pi} + 1 &=& 0</programlisting> Instead ! of typing this blindly, let us use a few shortcuts to reduce ! movement. Start out by typing <literal>e^</literal>. Now instead of ! typing <literal>{</literal>, type another <literal>^</literal>. You ! will see the <literal>e^^</literal> change instantly to ! <literal>e^{}&ph;</literal> with the cursor between ! <literal>{}</literal>'s. (The <literal>^^</literal> changed to ! <literal>^{}&ph;</literal>.) Continue with the following sequence of ! letters: <literal>j`p</literal>. This will change instantly to ! <literal>j\pi</literal>. (The <literal>`p</literal> changed to ! <literal>\pi</literal>.) Having typed in all we need to type between ! the <literal>{}</literal>'s, press <literal><C-j></literal>. ! You will pop back out of the curly-braces. Continue typing the rest ! of the formula. You can use <literal>==</literal> as a shortcut for ! <literal>&=&</literal>. Latex-Suite provides a large number ! of such shortcuts which should making typing much more fun and fast ! if you get acquainted with them. A list is provided <ulink ! url="http://vim-latex.sourceforge.net/documentation/latex-suite/auc-tex-mappings.html">here</ulink>. Definitely spend some time getting a feel for ! them. Most of them are pretty intuitive like <literal>`/</literal> ! for <literal>\frac{}{}</literal>, <literal>`8</literal> for ! <literal>\infty</literal> etc. ! </para> ! <para> ! In order to understand the next section better, it will be helpful ! to have one more <literal>\label</literal>. Lets use the handy ! <literal><F5></literal> ! key to insert another equation. This time something simple like the ! following will do: ! <programlisting>\begin{eqnarray} ! \label{eqn:simple} ! 1 + 1 = 2 ! \end{eqnarray}</programlisting> ! </para> ! </section> ! <section id="lsq-folding"> ! <title>Folding in &ls;</title> ! <para> ! Okay, we have typed enough. At this stage, hopefully, your file is ! looking something like this: ! <programlisting> ! 1 % File: sample.tex ! 2 % Created: Sun Jun 22 04:00 PM 2003 P ! 3 % Last Change: Mon Dec 15 07:00 PM 2003 ! 4 % ! 5 \documentclass[a4paper]{article} ! 6 ! 7 \usepackage[sumlimits,]{amsmath} ! 8 ! 9 \begin{document} ! 10 \begin{eqnarray} ! 11 \label{eqn:euler} ! 12 e^{j\pi} + 1 &=& 0 ! 13 \end{eqnarray} ! 14 This is the famous euler equation. I ! 15 will type another equation, just as ! 16 true: ! 17 \begin{eqnarray} ! 18 \label{eqn:simple} ! 19 1 + 1 &=& 2 ! 20 \end{eqnarray} ! 21 This is my contribution to mathematics. ! 22 \end{document} ! </programlisting> ! In normal mode, press <literal>\rf</literal>. This will fold up the ! entire file and you should see the file looking as below: ! <programlisting> ! 1 % File: sample.tex ! 2 % Created: Sun Jun 22 04:00 PM 2003 P ! 3 % Last Change: Mon Dec 15 07:00 PM 2003 ! 4 % ! 5 +-- 4 lines: Preamble: \documentclass[a4paper]{article} ----- ! 9 \begin{document} ! 10 +-- 4 lines: eqnarray (eqn:euler) \label{eqn:euler} ----------- ! 14 This is the famous euler equation. I ! 15 will type another equation, just as ! 16 true: ! 10 +-- 4 lines: eqnarray (eqn:simple) \label{eqn:simple} --------- ! 21 This is my contribution to mathematics. ! 22 \end{document} ! </programlisting> ! What has happened is that &ls; folded away blocks of &latex; code into ! folded regions. You can open and close folds by using the command ! <literal>za</literal> in normal mode. ! </para> ! </section> ! <section id="lsq-inserting-reference"> ! <title>Inserting a Reference</title> ! <para> ! A necessary part of LaTeX editing is referencing equations, figures, ! bibliographic entries etc. This is done with the ! <literal>\ref</literal> and the <literal>\cite</literal> commands. ! Latex-Suite provides an easy way to do this. Somewhere in the body of ! the document, type in the following sentence ! <programlisting>This is a reference to (\ref{}).</programlisting> ! With the cursor between the <literal>{}</literal> press ! <literal><F9></literal> in insert mode. Your vim session will ! sprout two new windows and it should look like below: ! <programlisting> ! 9 \begin{document} ! 10 +-- 4 lines: eqnarray (eqn:euler) : \label{eqn:euler}----------------------- ! 14 This is the famous euler equation. I ! 15 will type another equation, just as ! 16 true: ! 17 +-- 4 lines: eqnarray (eqn:simple) : \label{eqn:simple}--------------------- ! 21 This is my contribution to mathematics. ! 22 This is a reference to (\ref{}<++>)<++> ! 23 \end{document} ! ~ ! ~ ! ~ ! test.tex [+] 22,29 Bot ! test.tex|11| \label{eqn:euler} ! test.tex|18| \label{eqn:simple} ! ~ ! ~ ! ~ ! [Error List] 1,1 All ! 7 \usepackage[sumlimits,]{amsmath} ! 8 ! 9 \begin{document} ! 10 \begin{eqnarray} ! 11 \label{eqn:euler} ! 12 e^{j\pi} + 1 &=& 0 ! 13 \end{eqnarray} ! 14 This is the famous euler equation. I ! 15 will type another equation, just as ! 16 true: ! test.tex [Preview][+] 11,2-5 46% ! </programlisting> ! </para> ! <imageobject> ! <imagedata fileref="" format=""></imagedata> ! </imageobject> ! <para> ! The cursor will relocate to the middle window which shows all ! <literal>\label</literal>s found in all the <literal>.tex</literal> file ! in the current directory. ! You can scroll up and down in the middle window till you reach the ! reference you want to insert. Notice how when you scroll in the ! middle window, the bottom "Preview" window scrolls automatically to ! show you the location of the current selection. This helps you ! identify the reference with greater ease because often times, ! <literal>\labels</literal> are not descriptive enough or there might be too ! many of them. To insert the reference, just position the cursor on ! the relevant line in the middle window and press ! <literal><enter></literal>. The line which you were editing will change ! to: ! <programlisting>This is a reference to (\ref{eqn:euler})</programlisting> ! and the bottom windows close automatically. ! </para> ! <para> ! The <literal><F9></literal> key also works for inserting ! <literal>\cite</literal> commands to reference bibliographic entries, ! inserting file names for the <literal>\inputgraphics</literal> command ! and just plain searching for words. Click <ulink ! url="http://vim-latex.sourceforge.net/documentation/latex-suite/latex-completion.html">here</ulink> ! for more information. ! </para> ! </section> ! <section id="lsq-compiling"> ! <title>Compiling a document</title> ! <para> ! Great! We have just created a small latex file. The next step is to ! make the latex compiler create a .dvi file from it. Compiling via ! latex-suite is simple. Goto normal mode and press <literal>\ll</literal> ! (replace <literal>\</literal> with whatever <literal>mapleader</literal> setting you ! have). This will call the latex compiler. If all goes well, then ! the focus should return to the vim window. ! </para> ! <para> ! Nothing happend? Ouch! You might need to do some additional settings as ! described <ulink ! url="http://vim-latex.sourceforge.net/index.php?subject=faq&title=FAQ#faq-2">here.</ulink> ! </para> ! <section id="lsq-debugging"> ! <title>Debugging LaTeX source files</title> ! <para> ! To illustrate the debugging procedure, let's create a few mistakes ! in the file. Insert the following ``mistakes'' in the file: ! <programlisting>This is a $\mistake$. ! And this is $\another$</programlisting> ! Now press <literal>\ll</literal> again. This time you will notice that ! after compilation finishes, the cursor automatically lands on ! <literal>$\mistake$</literal>. In addition, 2 new windows will appear ! as shown here: ! </para> ! <imageobject> ! <imagedata fileref="" format=""></imagedata> ! </imageobject> ! <para> ! The middle window is an <emphasis>Error List</emphasis> window ! showing you the errors which the latex compiler found. Th bottom ! window is a <emphasis>Log Preview</emphasis> window, which shows you ! the context of the error made by displaying the relevant portion of ! the <literal>.log</literal> file created during the latex ! compilation procedure. Jump to the <emphasis>Error List</emphasis> ! window and try scrolling around in it using either the <literal>j, ! k</literal> keys or the arrow keys. You will notice that the ! <emphasis>Log Preview</emphasis> window scrolls automatically to ! retain the context of the error you are currently located on. If you ! press <literal><enter></literal> on any line, you will see the ! cursor jump to the location of the error. Latex-Suite tries to guess ! the column location as best as it can so you can continue typing ! straight away. ! </para> ! </section> ! <para> ! Having got a taste for compiling, proceed by deleting the erroneous ! lines and re-compiling. ! </para> ! <para> ! The Latex-Suite compiler is capable of much more including ! selectively filtering out common errors which you might want to ! ignore for the moment, compiling parts of a document, setting ! levels of verbosity in the compiler output etc. See <ulink ! url="http://vim-latex.sourceforge.net/documentation/latex-suite/latex-compiling.html">here</ulink> ! for more. ! </para> ! </section> ! <section id="lsq-viewing-dvi"> ! <title>Viewing DVI files</title> ! <para> ! Now that you have compiled your first latex source, its time to ! view it. Again, this should be pretty simple. Press ! <literal>\lv</literal> in normal mode. Depending on your platform, a DVI ! viewer program should open up and display the dvi file generated in ! compilation step previously. ! </para> ! <para> ! Nothing happend? Ouch! You might need to do some additional settings as ! described <ulink ! url="http://vim-latex.sourceforge.net/index.php?subject=faq&title=FAQ#faq-3">here.</ulink> ! </para> ! <section id="lsq-quick-forward-searching"> ! <title>Performing forward searches</title> ! <para> ! If you are using a modern DVI viewer, then it is possible to do what ! is called forward and inverse searching. However, you will need to ! customize the standard Latex-Suite distribution in order to utilize ! this functionality. Type in the following on the command line: ! ! <programlisting>:let g:Tex_CompileRule_dvi = 'latex -src-specials -interaction=nonstopmode $*' ! :TCTarget dvi</programlisting> ! ! Now recompile the latex file by pressing <literal>\ll</literal>. ! This time, instead of pressing <literal>\lv</literal> to view the ! file, press <literal>\ls</literal> from within the tex file. If the ! DVI viewer supports forward searching (most of them do), then the ! viewer will actually display the portion of the DVI file ! corresponding to the location where you were editing the tex file. ! </para> ! <note> ! <para> ! The reason Latex-Suite does not have this setting by default is ! that on some systems this causes unpredictable results in the DVI ! output. If you find the DVI output satisfactory, then you can ! insert the first of the 2 lines above into your ! <literal>$VIM/ftplugin/tex.vim</literal> file. ! <literal>$VIM</literal> is <literal>~/vimfiles</literal> for ! windows and <literal>~/.vim</literal> for *nix machines. ! </para> ! </note> ! </section> ! <section id="lsq-quick-inverse-searching"> ! <title>Performing inverse searches</title> ! <para> ! Most DVI viewers also support inverse searching, whereby you can ! make the DVI viewer ask vim to display the tex source corresponding ! to the DVI file being shown. This is extremely helpful while ! proofreading large documents. ! </para> ! ! <para> ! Simply double-click anywhere in the viewer window. If the viewer ! supports it, then it will attempt to open an editor window at the ! location corresponding to where you double-clicked. On *nix ! platforms, Latex-Suite attempts to start the viewer program in such ! a way that it already knows to use vim to open the tex source. Thus ! you should see a vim window open up showing the tex file. However, ! if there is an error, or some other program is used, you will need ! to tell the viewer program to use gvim as the editor. On windows ! platforms, if you use the commonly available <literal>yap</literal> ! viewer (available as part of the miktex distribution), then this ! option can be set from <literal>View > Options > Inverse ! Search</literal>. In the <literal>Command line:</literal> window, ! write ! <programlisting>"C:\Program Files\vim\vim61\gvim" -c ":RemoteOpen +%l %f"</programlisting> ! (Customize the path according to where you have installed gvim). ! If you double click in the view pane now, you will see gvim start ! up and take you to the relevant portion of the tex file. ! </para> ! </section> ! </section> ! <section id="lsq-conclusions"> ! <title>Conclusions</title> ! <para> ! Thats all folks! By now, you should know enough of the basic functions ! of latex-suite. Ofcourse, latex-suite is capable of much, much more such ! as compiling files multiple times to resolve changed labels, compiling ! dependencies, handling user packages and more. To get a feel for that, ! you will need to take a look at the <ulink ! url="http://vim-latex.sourceforge.net/index.php?subject=manual&title=Manual#user-manual">&ls; ! user manual.</ulink> ! </para> ! </section> ! </article> ! ! <!-- ! vim: et:sw=1:ts=1 ! --> Index: latex-suite.xml =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/doc/latex-suite.xml,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** latex-suite.xml 24 Dec 2005 06:23:59 -0000 1.41 --- latex-suite.xml 2 Feb 2006 00:20:30 -0000 1.42 *************** *** 45,49 **** &ls; is released under the Vim charityware license. For license and conditions of use look at |copyright|. Replace all ! occurences of ``Vim'' with ``Latex-Suite''. The current copyright holders of &ls; are Srinath Avadhanula and Mikolaj Machowski. </para> --- 45,49 ---- &ls; is released under the Vim charityware license. For license and conditions of use look at |copyright|. Replace all ! occurrences of ``Vim'' with ``Latex-Suite''. The current copyright holders of &ls; are Srinath Avadhanula and Mikolaj Machowski. </para> *************** *** 75,79 **** " IMPORTANT: grep will sometimes skip displaying the file name if you " search in a singe file. This will confuse &ls;. Set your grep ! " program to alway generate a file-name. set grepprg=grep\ -nH\ $* --- 75,79 ---- " IMPORTANT: grep will sometimes skip displaying the file name if you " search in a singe file. This will confuse &ls;. Set your grep ! " program to always generate a file-name. set grepprg=grep\ -nH\ $* *************** *** 111,115 **** </para> <para> ! A template file can utlilize placeholders for initializing the cursor position when the template is read in and subsequent movement. In addition, template files can contain dynamic elements such as the --- 111,115 ---- </para> <para> ! A template file can utilize placeholders for initializing the cursor position when the template is read in and subsequent movement. In addition, template files can contain dynamic elements such as the *************** *** 259,263 **** </para> <para> ! In addition to this setting, &ls; also lists envionments found in custom packages as described in the section <link linkend="package-actions">Package actions.</link> --- 259,263 ---- </para> <para> ! In addition to this setting, &ls; also lists environments found in custom packages as described in the section <link linkend="package-actions">Package actions.</link> *************** *** 487,491 **** <programlisting>\section{&ph;}&ph;</programlisting> etc. Just as in the case of environments and fonts, can be enclosed with a ! visual selection. The enclosing is not sensetive to character or line-wise selection. </para> --- 487,491 ---- <programlisting>\section{&ph;}&ph;</programlisting> etc. Just as in the case of environments and fonts, can be enclosed with a ! visual selection. The enclosing is not sensitive to character or line-wise selection. </para> *************** *** 596,601 **** <para> &ls; also ships with <link linkend="smart-backspace">smart ! backspacing</link> functionality which provides another convinience while ! editing languages with diactritics. </para> <note> --- 596,601 ---- <para> &ls; also ships with <link linkend="smart-backspace">smart ! backspacing</link> functionality which provides another convenience while ! editing languages with diacritics. </para> <note> *************** *** 641,645 **** <literal>BBB</literal> inserts a template with only the fields mandatorily required for a given entry type. <literal>BBL</literal> ! inserts a template with commony used extra options. <literal>BBH</literal> inserts a template with more options which are not as commonly used. <literal>BBX</literal> inserts a template with --- 641,645 ---- <literal>BBB</literal> inserts a template with only the fields mandatorily required for a given entry type. <literal>BBL</literal> ! inserts a template with commonly used extra options. <literal>BBH</literal> inserts a template with more options which are not as commonly used. <literal>BBX</literal> inserts a template with *************** *** 729,733 **** which are not listed above, then you will have to use the <literal>Bib_{type}_extrafields</literal> option. This is a newline ! seperated string of complete field names which will be included in the template. For example, if you define <programlisting>let g:Bib_article_extrafields = "crossref\nabstract"</programlisting> --- 729,733 ---- which are not listed above, then you will have to use the <literal>Bib_{type}_extrafields</literal> option. This is a newline ! separated string of complete field names which will be included in the template. For example, if you define <programlisting>let g:Bib_article_extrafields = "crossref\nabstract"</programlisting> *************** *** 759,763 **** <formalpara> <title>Smart Quotes</title> ! Pressing <literal>"</literal> (english double quote) will insert <literal>``</literal> or <literal>''</literal> by making an intelligent guess about whether we intended to open or close a quote. --- 759,763 ---- <formalpara> <title>Smart Quotes</title> ! Pressing <literal>"</literal> (English double quote) will insert <literal>``</literal> or <literal>''</literal> by making an intelligent guess about whether we intended to open or close a quote. *************** *** 936,940 **** mode, you can use the |TMacro| command instead of choosing from the menu. This command takes the macro file name as an argument. When ! called without arguments (preferred usage), then a list of avaiable macro files is displayed and the user is prompted to choose one of them). --- 936,940 ---- mode, you can use the |TMacro| command instead of choosing from the menu. This command takes the macro file name as an argument. When ! called without arguments (preferred usage), then a list of available macro files is displayed and the user is prompted to choose one of them). *************** *** 1085,1089 **** <literal>"something"</literal>. This is t... [truncated message content] |
From: <sri...@us...> - 2006-01-25 04:16:37
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12876 Modified Files: envmacros.vim version.vim Log Message: Bug: Selecting a word visually and pressing <F7> does not enclose the word in the selected command (Javier Rojas) Why: Tex_DoCommand() never set s:isvisual. Fix: Never really like s:isvisual anyway. Now, Tex_DoCommand() just conveys whether its visual or not via another argument to Tex_PutCommand(). Bug: Pressing <F7> after foo* does not create \foo*{} (Javier Rojas) Why: We restrict the previous string of letters to end in a 'iskeyword' character. Fix: Instead of requiring that users extend the 'iskeyword' setting to include *, just allow for words like foo* because this is a very common thing in LaTeX Index: envmacros.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/envmacros.vim,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** envmacros.vim 1 Jan 2006 07:53:01 -0000 1.50 --- envmacros.vim 25 Jan 2006 04:16:28 -0000 1.51 *************** *** 989,993 **** let com = PromptForCommand('Choose a command to insert: ') if com != '' ! return Tex_PutCommand(com) else return '' --- 989,993 ---- let com = PromptForCommand('Choose a command to insert: ') if com != '' ! return Tex_PutCommand(com, a:isvisual) else return '' *************** *** 999,1004 **** let c = col('.') ! let wordbef = matchstr(strpart(presline, 0, c-1), '\k\+$') ! let wordaft = matchstr(strpart(presline, c-1), '^\k\+') let word = wordbef . wordaft --- 999,1004 ---- let c = col('.') ! let wordbef = matchstr(strpart(presline, 0, c-1), '\k\+\*\?$') ! let wordaft = matchstr(strpart(presline, c-1), '^\k\+\*\?') let word = wordbef . wordaft *************** *** 1010,1018 **** return substitute(wordbef, '.', "\<Left>", 'g') \ . substitute(word, '.', "\<Del>", 'g') ! \ . Tex_PutCommand(word) else let cmd = PromptForCommand('Choose a command to insert: ') if cmd != '' ! return Tex_PutCommand(cmd) else return '' --- 1010,1018 ---- return substitute(wordbef, '.', "\<Left>", 'g') \ . substitute(word, '.', "\<Del>", 'g') ! \ . Tex_PutCommand(word, a:isvisual) else let cmd = PromptForCommand('Choose a command to insert: ') if cmd != '' ! return Tex_PutCommand(cmd, a:isvisual) else return '' *************** *** 1024,1031 **** " Description: " Based on input argument, it calls various specialized functions. ! function! Tex_PutCommand(com) ! if exists("s:isvisual") && s:isvisual == "yes" ! let s:isvisual = 'no' ! if a:com == '$' return VEnclose('$', '$', '$', '$') --- 1024,1029 ---- " Description: " Based on input argument, it calls various specialized functions. ! function! Tex_PutCommand(com, isvisual) ! if a:isvisual == "yes" if a:com == '$' return VEnclose('$', '$', '$', '$') Index: version.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/version.vim,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** version.vim 20 Jan 2006 16:35:20 -0000 1.1 --- version.vim 25 Jan 2006 04:16:28 -0000 1.2 *************** *** 25,29 **** " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.8.06" endfunction --- 25,29 ---- " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.8.07" endfunction |
From: <sri...@us...> - 2006-01-20 16:35:29
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5854 Modified Files: main.vim Added Files: version.vim Log Message: Bug: Trying to internationalize Tex_GetErrorList() broke code because when there are no errors, we get "\nE42: No Errors". Therefore needed to match 'E42: '. Matching '^E42: ' does not work. New: moved Tex_Version() into a new file called version.vim so that we do not get fake commits on main.vim. It was getting hard to figure out whether a change in main.vim corresponded to changed code or just a version increment. --- NEW FILE: version.vim --- " Tex_Version: returns a string which gives the current version number of latex-suite " Description: " Each time a bug fix/addition is done in any source file in latex-suite, " not just this file, the number below has to be incremented by the author. " This will ensure that there is a single 'global' version number for all of " latex-suite. " " If a change is done in the doc/ directory, i.e an addition/change in the " documentation, then this number should NOT be incremented. " " Latex-suite will follow a 3-tier system of versioning just as Vim. A " version number will be of the form: " " X.Y.ZZ " " 'X' will only be incremented for a major over-haul or feature addition. " 'Y' will be incremented for significant changes which do not qualify " as major. " 'ZZ' will be incremented for bug-fixes and very trivial additions such " as adding an option etc. Once ZZ reaches 50, then Y will be " incremented and ZZ will be reset to 01. Each time we have a " version number of the form X.Y.01, then we'll make a release on " vim.sf.net and also create a cvs tag at that point. We'll try to " "stabilize" that version by releasing a few pre-releases and then " keep that as a stable point. function! Tex_Version() return "Latex-Suite: version 1.8.06" endfunction com! -nargs=0 TVersion echo Tex_Version() Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** main.vim 10 Jan 2006 01:59:11 -0000 1.91 --- main.vim 20 Jan 2006 16:35:20 -0000 1.92 *************** *** 571,575 **** let @a = _a ! if errlist =~ '^E42: ' let errlist = '' endif --- 571,575 ---- let @a = _a ! if errlist =~ 'E42: ' let errlist = '' endif *************** *** 612,647 **** return substitute(a:path, '[^\\]\(\\\\\)*\zs ', '\\ ', 'g') endfunction " }}} - " Tex_Version: returns a string which gives the current version number of latex-suite {{{ - " Description: - " Each time a bug fix/addition is done in any source file in latex-suite, - " not just this file, the number below has to be incremented by the author. - " This will ensure that there is a single 'global' version number for all of - " latex-suite. - " - " If a change is done in the doc/ directory, i.e an addition/change in the - " documentation, then this number should NOT be incremented. - " - " Latex-suite will follow a 3-tier system of versioning just as Vim. A - " version number will be of the form: - " - " X.Y.ZZ - " - " 'X' will only be incremented for a major over-haul or feature addition. - " 'Y' will be incremented for significant changes which do not qualify - " as major. - " 'ZZ' will be incremented for bug-fixes and very trivial additions such - " as adding an option etc. Once ZZ reaches 50, then Y will be - " incremented and ZZ will be reset to 01. Each time we have a - " version number of the form X.Y.01, then we'll make a release on - " vim.sf.net and also create a cvs tag at that point. We'll try to - " "stabilize" that version by releasing a few pre-releases and then - " keep that as a stable point. - function! Tex_Version() - return "Latex-Suite: version 1.8.05" - endfunction - - com! -nargs=0 TVersion echo Tex_Version() - - " }}} " ============================================================================== --- 612,615 ---- *************** *** 825,828 **** --- 793,797 ---- exe 'source '.s:path.'/texviewer.vim' + exe 'source '.s:path.'/version.vim' " ============================================================================== |
From: <sri...@us...> - 2006-01-18 09:21:02
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16811 Modified Files: outline.py Log Message: Bug: Bugs on all *nix and mac systems due to the new outline.py module (Christian Ebert) Why: stupidly imported stringio, which works on the windows version of python, but not on any unix system which is case sensitive :( Fix: use StringIO instead (Christian Ebert) Index: outline.py =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/outline.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** outline.py 2 Jan 2006 07:20:37 -0000 1.3 --- outline.py 18 Jan 2006 09:20:53 -0000 1.4 *************** *** 10,14 **** import os import sys ! import stringio # getFileContents {{{ --- 10,14 ---- import os import sys ! import StringIO # getFileContents {{{ *************** *** 60,64 **** inside_env = 0 prev_env = '' ! outstr = stringio.StringIO('') pres_depth = len(section_prefix) --- 60,64 ---- inside_env = 0 prev_env = '' ! outstr = StringIO.StringIO('') pres_depth = len(section_prefix) |
From: <sri...@us...> - 2006-01-10 01:59:21
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13441 Modified Files: main.vim Log Message: Bug: Multiple compilation chain is broken without any errors for non-english speaking locales (Javier Rojas) Why: We try to see ``errlist =~ 'E42: No errors'`` which for non-english locales fails because 'No errors' is translated to the current locale. Fix: Just check for `=~ '^E42: '`. This should be robust enough. Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** main.vim 3 Jan 2006 08:40:39 -0000 1.90 --- main.vim 10 Jan 2006 01:59:11 -0000 1.91 *************** *** 571,575 **** let @a = _a ! if errlist =~ 'E42: No Errors' let errlist = '' endif --- 571,575 ---- let @a = _a ! if errlist =~ '^E42: ' let errlist = '' endif *************** *** 638,642 **** " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.8.04" endfunction --- 638,642 ---- " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.8.05" endfunction |
From: <sri...@us...> - 2006-01-03 19:30:48
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7690 Modified Files: texviewer.vim Log Message: New: A preliminary attempt (not yet complete) at working with Jabref (http://jabref.sourceforge.net). Some information is still needed from Jabref developers on how to get Jabref to call external programs in a customizable manner. Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/texviewer.vim,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** texviewer.vim 1 Jan 2006 07:54:25 -0000 1.13 --- texviewer.vim 3 Jan 2006 19:30:38 -0000 1.14 *************** *** 104,126 **** elseif exists("s:type") && s:type =~ 'cite' ! " grep! nothing % ! " does _not_ clear the search history contrary to what the ! " help-docs say. This was expected. So use something improbable. ! " TODO: Is there a way to clear the search-history w/o making a ! " useless, inefficient search? ! let s:prefix = matchstr(s:prefix, '\([^,]\+,\)*\zs\([^,]\+\)\ze$') ! silent! grep! ____HIGHLY_IMPROBABLE___ % ! if g:Tex_RememberCiteSearch && exists('s:citeSearchHistory') ! call <SID>Tex_SetupCWindow(s:citeSearchHistory) else ! call Tex_GrepHelper(s:prefix, 'bib') ! redraw! ! call <SID>Tex_SetupCWindow() ! endif ! if g:Tex_RememberCiteSearch && &ft == 'qf' ! let _a = @a ! silent! normal! ggVG"ay ! let s:citeSearchHistory = @a ! let @a = _a endif --- 104,136 ---- elseif exists("s:type") && s:type =~ 'cite' ! ! if Tex_GetVarValue('Tex_UseJabref') == 1 ! call Tex_CD(s:origdir) ! let g:Remote_WaitingForCite = 1 ! let citation = input('Enter citation from jabref (<enter> to leave blank): ') ! let g:Remote_WaitingForCite = 0 ! call Tex_CompleteWord(citation) ! else ! " grep! nothing % ! " does _not_ clear the search history contrary to what the ! " help-docs say. This was expected. So use something improbable. ! " TODO: Is there a way to clear the search-history w/o making a ! " useless, inefficient search? ! let s:prefix = matchstr(s:prefix, '\([^,]\+,\)*\zs\([^,]\+\)\ze$') ! silent! grep! ____HIGHLY_IMPROBABLE___ % ! if g:Tex_RememberCiteSearch && exists('s:citeSearchHistory') ! call <SID>Tex_SetupCWindow(s:citeSearchHistory) ! else ! call Tex_GrepHelper(s:prefix, 'bib') ! redraw! ! call <SID>Tex_SetupCWindow() ! endif ! if g:Tex_RememberCiteSearch && &ft == 'qf' ! let _a = @a ! silent! normal! ggVG"ay ! let s:citeSearchHistory = @a ! let @a = _a ! endif endif |
From: <sri...@us...> - 2006-01-03 08:40:46
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11866 Modified Files: folding.vim main.vim Log Message: Bug: latex-suite doesn't create fold text for figure captions of the form \cpation[shortdesc]{fulldesc} (Boris Duek) Fix: Handle the case for \caption[shortdesc]{fulldesc} (Boris Duek). Index: folding.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/folding.vim,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** folding.vim 14 Dec 2003 07:20:26 -0000 1.25 --- folding.vim 3 Jan 2006 08:40:39 -0000 1.26 *************** *** 351,356 **** while i <= v:foldend if getline(i) =~ '\\caption' ! let caption = matchstr(getline(i), '\\caption{\zs.*') ! let caption = substitute(caption, '\zs}[^}]*$', '', '') elseif getline(i) =~ '\\label' let label = matchstr(getline(i), '\\label{\zs.*') --- 351,364 ---- while i <= v:foldend if getline(i) =~ '\\caption' ! " distinguish between ! " \caption{fulldesc} - fulldesc will be displayed ! " \caption[shortdesc]{fulldesc} - shortdesc will be displayed ! if getline(i) =~ '\\caption\[' ! let caption = matchstr(getline(i), '\\caption\[\zs[^\]]*') ! let caption = substitute(caption, '\zs\]{.*}[^}]*$', '', '') ! else ! let caption = matchstr(getline(i), '\\caption{\zs.*') ! let caption = substitute(caption, '\zs}[^}]*$', '', '') ! end elseif getline(i) =~ '\\label' let label = matchstr(getline(i), '\\label{\zs.*') Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** main.vim 1 Jan 2006 07:54:25 -0000 1.89 --- main.vim 3 Jan 2006 08:40:39 -0000 1.90 *************** *** 638,642 **** " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.8.03" endfunction --- 638,642 ---- " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.8.04" endfunction |
From: <sri...@us...> - 2006-01-02 07:20:47
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24716 Modified Files: outline.py Log Message: Change: A slightly improved algorithm for producing the outline which ensures that sections which do not contain matches are never printed. Index: outline.py =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/outline.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** outline.py 1 Jan 2006 07:54:25 -0000 1.2 --- outline.py 2 Jan 2006 07:20:37 -0000 1.3 *************** *** 22,26 **** fname = argin.group(3) ! contents = open(fname).read() # TODO what are all the ways in which a tex file can include another? --- 22,28 ---- fname = argin.group(3) ! # This longish thing is to make sure that all files are converted into ! # \n seperated lines. ! contents = '\n'.join(open(fname).read().splitlines()) # TODO what are all the ways in which a tex file can include another? *************** *** 31,80 **** # }}} ! # createOutline {{{ ! def createOutline(contents, prefix): ! """ ! Prints a formatted outline of the latex document on the standard ! output. The output is of the form: ! ! 1. Introduction ! 1.1 Introduction section ! > eqn:firsteqn ! : 2 == 2 ! > fig:figure1 ! : Caption for the figure ! 1.2 Second section name of introduction ! ! If ``prefix`` is given, then only labels which start with it are ! listed. ! """ ! # This is the hierarchical list of the sectioning of a latex document. ! outline_cmds = ['chapter', 'section', 'subsection', 'subsubsection'] ! outline_nums = {} ! for cmd in outline_cmds: ! outline_nums[cmd] = 0 ! pres_depth = 0 ! fname = '' prev_txt = '' inside_env = 0 prev_env = '' ! outstr = stringio.StringIO() ! ! for line in contents.splitlines(): ! # remember which file we are currently "in" ! if re.match('%==== FILENAME: ', line): ! fname = re.search('%==== FILENAME: (.*)', line).group(1) ! # throw away everything after the % ! line = re.sub('%.*', '', line) if not line: continue # throw away leading white-space ! line = line.lstrip() # we found a label! ! m = re.search(r'\\label{(%s.*?)}' % prefix, line) if m: # add the current line (except the \label command) to the text --- 33,79 ---- # }}} ! # stripComments {{{ ! def stripComments(contents): ! # remove all comments except those of the form ! # %%==== FILENAME: <filename.tex> ! uncomm = [re.sub('%(?!==== FILENAME: ).*', '', line) for line in contents.splitlines()] ! # also remove all only-whitespace lines. ! nonempty = [line for line in uncomm if line.strip()] ! return nonempty ! # }}} ! # addFileNameAndNumber {{{ ! def addFileNameAndNumber(lines): ! filename = '' ! retval = '' ! for line in lines: ! if re.match('%==== FILENAME: ', line): ! filename = line.split('%==== FILENAME: ')[1] ! else: ! retval += '<%s>%s\n' % (filename, line) ! return retval ! # }}} ! # getSectionLabels_Root {{{ ! def getSectionLabels_Root(lineinfo, section_prefix, label_prefix): prev_txt = '' inside_env = 0 prev_env = '' ! outstr = stringio.StringIO('') ! pres_depth = len(section_prefix) ! #print '+getSectionLabels_Root: lineinfo = [%s]' % lineinfo ! for line in lineinfo.splitlines(): if not line: continue # throw away leading white-space ! m = re.search('<(.*?)>(.*)', line) ! ! fname = m.group(1) ! line = m.group(2).lstrip() # we found a label! ! m = re.search(r'\\label{(%s.*?)}' % label_prefix, line) if m: # add the current line (except the \label command) to the text *************** *** 95,131 **** # # Use the current "section depth" for the leading indentation. ! print >>outstr, '>%s%s\t\t<%s>' % (' '*(2*pres_depth+6), m.group(1), fname) ! print >>outstr, ':%s%s' % (' '*(2*pres_depth+8), prev_txt) prev_txt = '' - # We found a TOC command, i.e one of \chapter, \section etc. - # We need to increase the numbering for the level which we just - # encoutered and reset all the nested levels to zero. Thus if we - # encounter a \section, the section number increments and the - # subsection numbers etc reset to 0. - ntot = len(outline_cmds) - sec_txt = '' - for i in range(ntot): - m = re.search(r'\\' + outline_cmds[i] + '{(.*?)}', line) - if m: - outline_nums[outline_cmds[i]] += 1 - for j in range(i+1, ntot): - outline_nums[outline_cmds[j]] = 0 - - # At the same time we form a string like - # - # 3.2.4 The section name - # - sec_txt = '' - for k in range(0, i+1): - sec_txt += '%d.' % outline_nums[outline_cmds[k]] - - sec_txt += (' ' + m.group(1)) - pres_depth = i - - print >>outstr, '%s%s\t<<<%d' % (' '*2*pres_depth, sec_txt, pres_depth+1) - break - # If we just encoutered the start or end of an environment or a # label, then do not remember this line. --- 94,102 ---- # # Use the current "section depth" for the leading indentation. ! print >>outstr, '>%s%s\t\t<%s>' % (' '*(2*pres_depth+2), m.group(1), fname) ! print >>outstr, ':%s%s' % (' '*(2*pres_depth+4), prev_txt) prev_txt = '' # If we just encoutered the start or end of an environment or a # label, then do not remember this line. *************** *** 155,163 **** return outstr.getvalue() # }}} ! # main(fname) {{{ ! def main(fname, prefix): [head, tail] = os.path.split(fname) if head: --- 126,169 ---- return outstr.getvalue() + + # }}} + # getSectionLabels {{{ + def getSectionLabels(lineinfo, + sectypes=['chapter', 'section', 'subsection', 'subsubsection'], + section_prefix='', label_prefix=''): + if not sectypes: + return getSectionLabels_Root(lineinfo, section_prefix, label_prefix) + ##print 'sectypes[0] = %s, section_prefix = [%s], lineinfo = [%s]' % ( + ## sectypes[0], section_prefix, lineinfo) + + sections = re.split(r'(<.*?>\\%s{.*})' % sectypes[0], lineinfo) + + # there will 1+2n sections, the first containing the "preamble" and the + # others containing the child sections as paris of [section_name, + # section_text] + + rettext = getSectionLabels(sections[0], sectypes[1:], section_prefix, label_prefix) + + for i in range(1,len(sections),2): + sec_num = (i+1)/2 + section_name = re.search(r'\\%s{(.*?)}' % sectypes[0], sections[i]).group(1) + section_label_text = getSectionLabels(sections[i] + sections[i+1], sectypes[1:], + section_prefix+('%d.' % sec_num), label_prefix) + + if section_label_text: + sec_heading = 2*' '*len(section_prefix) + section_prefix + sec_heading += '%d. %s' % (sec_num, section_name) + sec_heading += '<<<%d\n' % (len(section_prefix)/2+1) + + rettext += sec_heading + section_label_text + + return rettext + # }}} ! ! # main {{{ ! def main(fname, label_prefix): [head, tail] = os.path.split(fname) if head: *************** *** 166,173 **** [root, ext] = os.path.splitext(tail) contents = getFileContents(root, ext) ! outline = createOutline(contents, prefix) ! return outline ! # }}} --- 172,179 ---- [root, ext] = os.path.splitext(tail) contents = getFileContents(root, ext) ! nonempty = stripComments(contents) ! lineinfo = addFileNameAndNumber(nonempty) ! return getSectionLabels(lineinfo, label_prefix=label_prefix) # }}} *************** *** 180,182 **** --- 186,189 ---- print main(sys.argv[1], prefix) + # vim: fdm=marker |
From: <sri...@us...> - 2006-01-01 07:54:35
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24022 Modified Files: main.vim outline.py texviewer.vim Log Message: New: Instead of using outline.py as an external script, use vim's internal python interpreter if available. This makes things _much_ faster and it avoids the little "flash" when an external command is called. Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** main.vim 1 Jan 2006 07:53:01 -0000 1.88 --- main.vim 1 Jan 2006 07:54:25 -0000 1.89 *************** *** 638,642 **** " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.8.02" endfunction --- 638,642 ---- " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.8.03" endfunction Index: outline.py =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/outline.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** outline.py 28 Dec 2005 01:17:13 -0000 1.1 --- outline.py 1 Jan 2006 07:54:25 -0000 1.2 *************** *** 10,13 **** --- 10,14 ---- import os import sys + import stringio # getFileContents {{{ *************** *** 54,58 **** outline_nums[cmd] = 0 - pres_depth = 0 fname = '' --- 55,58 ---- *************** *** 60,63 **** --- 60,64 ---- inside_env = 0 prev_env = '' + outstr = stringio.StringIO() for line in contents.splitlines(): *************** *** 94,100 **** # # Use the current "section depth" for the leading indentation. ! print '>%s%s\t\t<%s>' % (' '*(2*pres_depth+6), m.group(1), fname) ! print ':%s%s' % (' '*(2*pres_depth+8), prev_txt) prev_txt = '' --- 95,101 ---- # # Use the current "section depth" for the leading indentation. ! print >>outstr, '>%s%s\t\t<%s>' % (' '*(2*pres_depth+6), m.group(1), fname) ! print >>outstr, ':%s%s' % (' '*(2*pres_depth+8), prev_txt) prev_txt = '' *************** *** 124,128 **** pres_depth = i ! print '%s%s\t<<<%d' % (' '*2*pres_depth, sec_txt, pres_depth+1) break --- 125,129 ---- pres_depth = i ! print >>outstr, '%s%s\t<<<%d' % (' '*2*pres_depth, sec_txt, pres_depth+1) break *************** *** 153,166 **** prev_txt = line - # }}} - - if __name__ == "__main__": - fname = sys.argv[1] - if len(sys.argv) > 2: - prefix = sys.argv[2] - else: - prefix = '' [head, tail] = os.path.split(fname) if head: --- 154,163 ---- prev_txt = line + return outstr.getvalue() + # }}} + # main(fname) {{{ + def main(fname, prefix): [head, tail] = os.path.split(fname) if head: *************** *** 169,174 **** [root, ext] = os.path.splitext(tail) contents = getFileContents(root, ext) ! createOutline(contents, prefix) # vim: fdm=marker --- 166,182 ---- [root, ext] = os.path.splitext(tail) contents = getFileContents(root, ext) + outline = createOutline(contents, prefix) ! return outline ! ! # }}} ! ! if __name__ == "__main__": ! if len(sys.argv) > 2: ! prefix = sys.argv[2] ! else: ! prefix = '' ! ! print main(sys.argv[1], prefix) # vim: fdm=marker Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/texviewer.vim,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** texviewer.vim 28 Dec 2005 01:17:13 -0000 1.12 --- texviewer.vim 1 Jan 2006 07:54:25 -0000 1.13 *************** *** 712,715 **** --- 712,720 ---- " these lines need to be outside the function. let s:path = expand('<sfile>:p:h') + if has('python') && Tex_GetVarValue('Tex_UsePython') + python import sys, re + exec "python sys.path += [r'". s:path . "']" + python import outline + endif function! Tex_StartOutlineCompletion() *************** *** 725,728 **** --- 730,734 ---- bot split __OUTLINE__ + exec Tex_GetVarValue('Tex_OutlineWindowHeight', 15).' wincmd _' setlocal modifiable *************** *** 736,741 **** " delete everything in it to the blackhole % d _ ! " read in the output of the outline command ! exec '0r!'.s:path.'/outline.py '.mainfname.' '.s:prefix 0 --- 742,759 ---- " delete everything in it to the blackhole % d _ ! ! if has('python') && Tex_GetVarValue('Tex_UsePython') ! exec 'python retval = outline.main(' ! \. 'r"' . fnamemodify(mainfname, ':p') . '", ' ! \. 'r"' . s:prefix . '")' ! ! " transfer variable from python to a local variable. ! python vim.command("""let retval = "%s" """ % re.sub(r'"|\\', r'\\\g<0>', retval)) ! ! 0put!=retval ! else ! exec '0r!'.s:path.'/outline.py '.mainfname.' '.s:prefix ! endif ! 0 *************** *** 755,758 **** --- 773,777 ---- let &cmdheight = _cmdheight let &lazyredraw = _lazyredraw + endfunction " }}} " Tex_SetupOutlineSyntax: sets up the syntax items for the outline {{{ |
From: <sri...@us...> - 2006-01-01 07:53:09
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23893 Modified Files: envmacros.vim main.vim Log Message: New: Make EFI mapping honor the Tex_Env_figure setting. Index: envmacros.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/envmacros.vim,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** envmacros.vim 19 Nov 2005 22:35:47 -0000 1.49 --- envmacros.vim 1 Jan 2006 07:53:01 -0000 1.50 *************** *** 262,266 **** " Miscellaneous {{{ call s:Tex_SpecialMacros('', '', '-sepenv1-', ' :', 0) ! call s:Tex_SpecialMacros('EFI', '', 'figure', "\<C-r>=Tex_figure('figure')\<CR>") call s:Tex_EnvMacros('', '', 'figure*') call s:Tex_EnvMacros('ELR', '', 'lrbox') --- 262,266 ---- " Miscellaneous {{{ call s:Tex_SpecialMacros('', '', '-sepenv1-', ' :', 0) ! call s:Tex_SpecialMacros('EFI', '', 'figure', "\<C-r>=Tex_PutEnvironment('figure')\<CR>") call s:Tex_EnvMacros('', '', 'figure*') call s:Tex_EnvMacros('ELR', '', 'lrbox') Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** main.vim 28 Dec 2005 01:17:12 -0000 1.87 --- main.vim 1 Jan 2006 07:53:01 -0000 1.88 *************** *** 371,375 **** " exists and if so, returns the corresponding value. If none exist, return " an empty string. ! function! Tex_GetVarValue(varname) if exists('w:'.a:varname) return w:{a:varname} --- 371,375 ---- " exists and if so, returns the corresponding value. If none exist, return " an empty string. ! function! Tex_GetVarValue(varname, ...) if exists('w:'.a:varname) return w:{a:varname} *************** *** 378,381 **** --- 378,383 ---- elseif exists('g:'.a:varname) return g:{a:varname} + elseif a:0 > 0 + return a:1 else return '' *************** *** 636,640 **** " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.8.01" endfunction --- 638,642 ---- " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.8.02" endfunction |
From: <sri...@us...> - 2005-12-28 01:17:27
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25857 Modified Files: main.vim texviewer.vim Added Files: outline.py Log Message: New: A major new feature for making \ref completion easier. Instead of a flat list of all the \label's which becomes almost impossible to use in large projects, present the list of \label's in a tree form according to the document sectioning. This makes it easier to logically "zoom" into the relevant \labels without having to wade through gobs and gobs of irrelevant results. outline.py is a new python script which needs to run in order to get this to work. The file should be an executable present in the same path as outline.vim. Since the file was added on a windows machine, its not clear how CVS will treat the permissions. New: The filenames are now completed relative to the master tex file location. This is how latex wants the filenames. --- NEW FILE: outline.py --- #!/usr/bin/python # Part of Latex-Suite # # Copyright: Srinath Avadhanula # Description: # This file implements a simple outline creation for latex documents. import re import os import sys # getFileContents {{{ def getFileContents(argin, ext=''): if type(argin) is str: fname = argin + ext else: if argin.group(2) == 'include': fname = argin.group(3) + ext else: fname = argin.group(3) contents = open(fname).read() # TODO what are all the ways in which a tex file can include another? pat = re.compile(r'^\\(@?)(include|input){(.*?)}', re.M) contents = re.sub(pat, lambda input: getFileContents(input, ext), contents) return ('%%==== FILENAME: %s' % fname) + '\n' + contents # }}} # createOutline {{{ def createOutline(contents, prefix): """ Prints a formatted outline of the latex document on the standard output. The output is of the form: 1. Introduction 1.1 Introduction section > eqn:firsteqn : 2 == 2 > fig:figure1 : Caption for the figure 1.2 Second section name of introduction If ``prefix`` is given, then only labels which start with it are listed. """ # This is the hierarchical list of the sectioning of a latex document. outline_cmds = ['chapter', 'section', 'subsection', 'subsubsection'] outline_nums = {} for cmd in outline_cmds: outline_nums[cmd] = 0 pres_depth = 0 fname = '' prev_txt = '' inside_env = 0 prev_env = '' for line in contents.splitlines(): # remember which file we are currently "in" if re.match('%==== FILENAME: ', line): fname = re.search('%==== FILENAME: (.*)', line).group(1) # throw away everything after the % line = re.sub('%.*', '', line) if not line: continue # throw away leading white-space line = line.lstrip() # we found a label! m = re.search(r'\\label{(%s.*?)}' % prefix, line) if m: # add the current line (except the \label command) to the text # which will be displayed below this label prev_txt += re.search(r'(^.*?)\\label{', line).group(1) # for the figure environment however, just display the caption. # instead of everything since the \begin command. if prev_env == 'figure': cm = re.search(r'\caption(\[.*?\]\s*)?{(.*?)}', prev_txt) if cm: prev_txt = cm.group(2) # print a nice formatted text entry like so # # > eqn:label # : e^{i\pi} + 1 = 0 # # Use the current "section depth" for the leading indentation. print '>%s%s\t\t<%s>' % (' '*(2*pres_depth+6), m.group(1), fname) print ':%s%s' % (' '*(2*pres_depth+8), prev_txt) prev_txt = '' # We found a TOC command, i.e one of \chapter, \section etc. # We need to increase the numbering for the level which we just # encoutered and reset all the nested levels to zero. Thus if we # encounter a \section, the section number increments and the # subsection numbers etc reset to 0. ntot = len(outline_cmds) sec_txt = '' for i in range(ntot): m = re.search(r'\\' + outline_cmds[i] + '{(.*?)}', line) if m: outline_nums[outline_cmds[i]] += 1 for j in range(i+1, ntot): outline_nums[outline_cmds[j]] = 0 # At the same time we form a string like # # 3.2.4 The section name # sec_txt = '' for k in range(0, i+1): sec_txt += '%d.' % outline_nums[outline_cmds[k]] sec_txt += (' ' + m.group(1)) pres_depth = i print '%s%s\t<<<%d' % (' '*2*pres_depth, sec_txt, pres_depth+1) break # If we just encoutered the start or end of an environment or a # label, then do not remember this line. # NOTE: This assumes that there is no equation text on the same # line as the \begin or \end command. The text on the same line as # the \label was already handled. if re.search(r'\\begin{(equation|eqnarray|align|figure)', line): prev_txt = '' prev_env = re.search(r'\\begin{(.*?)}', line).group(1) inside_env = 1 elif re.search(r'\\label', line): prev_txt = '' elif re.search(r'\\end{(equation|eqnarray|align|figure)', line): inside_env = 0 prev_env = '' else: # If we are inside an environment, then the text displayed with # the label is the complete text within the environment, # otherwise its just the previous line. if inside_env: prev_txt += line else: prev_txt = line # }}} if __name__ == "__main__": fname = sys.argv[1] if len(sys.argv) > 2: prefix = sys.argv[2] else: prefix = '' [head, tail] = os.path.split(fname) if head: os.chdir(head) [root, ext] = os.path.splitext(tail) contents = getFileContents(root, ext) createOutline(contents, prefix) # vim: fdm=marker Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** main.vim 22 Dec 2005 21:32:38 -0000 1.86 --- main.vim 28 Dec 2005 01:17:12 -0000 1.87 *************** *** 636,640 **** " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.7.01" endfunction --- 636,640 ---- " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.8.01" endfunction Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/texviewer.vim,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** texviewer.vim 22 Dec 2005 21:27:20 -0000 1.11 --- texviewer.vim 28 Dec 2005 01:17:13 -0000 1.12 *************** *** 8,12 **** " CVS: $Id$ " ============================================================================ - " Tex_SetTexViewerMaps: sets maps for this ftplugin {{{ function! Tex_SetTexViewerMaps() --- 8,11 ---- *************** *** 54,57 **** --- 53,60 ---- unlet! s:typeoption + if Tex_GetVarValue('Tex_WriteBeforeCompletion') == 1 + wall + endif + if a:where == "text" " What to do after <F9> depending on context *************** *** 75,93 **** if exists("s:type") && s:type =~ 'ref' ! if Tex_GetVarValue('Tex_UseSimpleLabelSearch') == 1 call Tex_Debug("Tex_Complete: searching for \\labels in all .tex files in the present directory", "view") call Tex_Debug("Tex_Complete: silent! grep! ".Tex_EscapeForGrep('\\label{'.s:prefix)." *.tex", 'view') call Tex_Grep('\\label{'.s:prefix, '*.tex') elseif Tex_GetVarValue('Tex_ProjectSourceFiles') != '' call Tex_Debug('Tex_Complete: searching for \\labels in all Tex_ProjectSourceFiles', 'view') call Tex_CD(Tex_GetMainFileName(':p:h')) call Tex_Grep('\\label{'.s:prefix, Tex_GetVarValue('Tex_ProjectSourceFiles')) else call Tex_Debug("Tex_Complete: calling Tex_GrepHelper", "view") silent! grep! ____HIGHLY_IMPROBABLE___ % call Tex_GrepHelper(s:prefix, 'label') endif redraw! - call <SID>Tex_SetupCWindow() elseif exists("s:type") && s:type =~ 'cite' --- 78,105 ---- if exists("s:type") && s:type =~ 'ref' ! if Tex_GetVarValue('Tex_UseOutlineCompletion') == 1 ! call Tex_Debug("Tex_Complete: using outline search method", "view") ! call Tex_StartOutlineCompletion() ! ! elseif Tex_GetVarValue('Tex_UseSimpleLabelSearch') == 1 call Tex_Debug("Tex_Complete: searching for \\labels in all .tex files in the present directory", "view") call Tex_Debug("Tex_Complete: silent! grep! ".Tex_EscapeForGrep('\\label{'.s:prefix)." *.tex", 'view') call Tex_Grep('\\label{'.s:prefix, '*.tex') + call <SID>Tex_SetupCWindow() + elseif Tex_GetVarValue('Tex_ProjectSourceFiles') != '' call Tex_Debug('Tex_Complete: searching for \\labels in all Tex_ProjectSourceFiles', 'view') call Tex_CD(Tex_GetMainFileName(':p:h')) call Tex_Grep('\\label{'.s:prefix, Tex_GetVarValue('Tex_ProjectSourceFiles')) + call <SID>Tex_SetupCWindow() + else call Tex_Debug("Tex_Complete: calling Tex_GrepHelper", "view") silent! grep! ____HIGHLY_IMPROBABLE___ % call Tex_GrepHelper(s:prefix, 'label') + call <SID>Tex_SetupCWindow() endif + redraw! elseif exists("s:type") && s:type =~ 'cite' *************** *** 216,226 **** " Description: function! Tex_CompleteFileName(filename, ext) ! call Tex_Debug('getting filename = '.a:filename, 'view') - let completeword = Tex_RelPath(a:filename, expand('%:p')) if a:ext == 'noext' ! let completeword = fnamemodify(completeword, ':r') endif call Tex_CompleteWord(completeword) endfunction " }}} --- 228,239 ---- " Description: function! Tex_CompleteFileName(filename, ext) ! call Tex_Debug('+Tex_CompleteFileName: getting filename '.a:filename, 'view') if a:ext == 'noext' ! let completeword = fnamemodify(a:filename, ':r') endif + let completeword = Tex_RelPath(completeword, Tex_GetMainFileName(':p:h')) + call Tex_Debug(":Tex_CompleteFileName: completing with ".completeword, "view") call Tex_CompleteWord(completeword) endfunction " }}} *************** *** 691,698 **** endfunction " }}} ! com! -nargs=0 TClearCiteHist unlet! s:citeSearchHistory ! " this statement has to be at the end. ! let s:doneOnce = 1 " vim:fdm=marker:nowrap:noet:ff=unix:ts=4:sw=4 --- 704,798 ---- endfunction " }}} ! " ============================================================================== ! " Functions for presenting an outlined version for completion ! " ============================================================================== ! " Tex_StartOutlineCompletion: sets up an outline window {{{ ! " get the place where this plugin resides for setting cpt and dict options. ! " these lines need to be outside the function. ! let s:path = expand('<sfile>:p:h') ! ! function! Tex_StartOutlineCompletion() ! let mainfname = Tex_GetMainFileName(':p') ! ! " open the buffer ! let _report = &report ! let _cmdheight=&cmdheight ! let _lazyredraw = &lazyredraw ! set report=1000 ! set cmdheight=1 ! set lazyredraw ! ! bot split __OUTLINE__ ! ! setlocal modifiable ! setlocal noswapfile ! setlocal buftype=nowrite ! setlocal bufhidden=delete ! setlocal nowrap ! setlocal foldmethod=marker ! setlocal foldmarker=<<<,>>> ! ! " delete everything in it to the blackhole ! % d _ ! " read in the output of the outline command ! exec '0r!'.s:path.'/outline.py '.mainfname.' '.s:prefix ! 0 ! ! call Tex_SetupOutlineSyntax() ! ! exec 'nnoremap <buffer> <cr> ' ! \ .':cd '.s:origdir.'<CR>' ! \ .':call Tex_FinishOutlineCompletion()<CR>' ! exec 'nnoremap <buffer> q ' ! \ .':cd '.s:origdir.'<CR>' ! \ .':close<CR>' ! ! " once the buffer is initialized, go back to the original settings. ! setlocal nomodifiable ! setlocal nomodified ! let &report = _report ! let &cmdheight = _cmdheight ! let &lazyredraw = _lazyredraw ! endfunction " }}} ! " Tex_SetupOutlineSyntax: sets up the syntax items for the outline {{{ ! " Description: ! function! Tex_SetupOutlineSyntax() ! syn match outlineFileName "<\f\+>$" contained ! syn match foldMarkers "<<<\d$" contained ! syn match firstSemiColon '^:' contained ! syn match firstAngle '^>' contained ! ! syn match sectionNames '\(\d\.\)\+ .*' contains=foldMarkers ! syn match previousLine '^:.*' contains=firstSemiColon ! syn match labelLine '^>.*' contains=firstAngle,outlineFileName ! ! hi def link outlineFileName Ignore ! hi def link foldMarkers Ignore ! hi def link firstSemiColon Ignore ! hi def link firstAngle Ignore ! ! hi def link sectionNames Type ! hi def link previousLine Special ! hi def link labelLine Comment ! endfunction " }}} ! " Tex_FinishOutlineCompletion: inserts the reference back in the text {{{ ! function! Tex_FinishOutlineCompletion() ! if getline('.') !~ '^[>:]' ! return ! endif ! ! if getline('.') =~ '^>' ! let ref_complete = matchstr(getline('.'), '^>\s\+\zs\S\+\ze') ! elseif getline('.') =~ '^:' ! let ref_complete = matchstr(getline(line('.')-1), '^>\s\+\zs\S\+\ze') ! endif ! ! let ref_remaining = strpart(ref_complete, strlen(s:prefix)) ! close ! call Tex_CompleteWord(ref_remaining) ! endfunction " }}} ! ! com! -nargs=0 TClearCiteHist unlet! s:citeSearchHistory " vim:fdm=marker:nowrap:noet:ff=unix:ts=4:sw=4 |
From: <sri...@us...> - 2005-12-28 00:38:12
|
Update of /cvsroot/vim-latex/vimfiles/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19717 Modified Files: remoteOpen.vim Log Message: Minor clarification of code. Index: remoteOpen.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/plugin/remoteOpen.vim,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** remoteOpen.vim 14 Mar 2004 19:39:29 -0000 1.4 --- remoteOpen.vim 28 Dec 2005 00:38:04 -0000 1.5 *************** *** 77,81 **** let i = 1 let server = s:Strntok(servers, "\n", i) ! let firstServer = v:servername while server != '' --- 77,81 ---- let i = 1 let server = s:Strntok(servers, "\n", i) ! let targetServer = v:servername while server != '' *************** *** 84,88 **** " g:Remote_Server will be set. if remote_expr(server, 'exists("g:Remote_Server")') ! let firstServer = server endif --- 84,88 ---- " g:Remote_Server will be set. if remote_expr(server, 'exists("g:Remote_Server")') ! let targetServer = server endif *************** *** 94,108 **** " set a variable g:Remote_Server to indicate that this server " session has at least one file opened via RemoteOpen ! call remote_send(server, ! \ "\<C-\>\<C-n>". ! \ ":let g:Remote_Server = 1\<CR>". ! \ ":drop ".filename."\<CR>". ! \ ":".linenum."\<CR>zv" ! \ ) ! call remote_foreground(server) ! " quit this vim session ! q ! " Is this necessary? :) ! return end --- 94,99 ---- " set a variable g:Remote_Server to indicate that this server " session has at least one file opened via RemoteOpen ! let targetServer = server ! break end *************** *** 110,114 **** let server = s:Strntok(servers, "\n", i) endwhile - call Tex_Debug("no server has file open, but firstServer = ".firstServer, "ropen") " If none of the servers have the file open, then open this file in the --- 101,104 ---- *************** *** 116,120 **** " multiple vims, then at least they will all be opened by the same gvim " server. ! call remote_send(firstServer, \ "\<C-\>\<C-n>". \ ":let g:Remote_Server = 1\<CR>". --- 106,110 ---- " multiple vims, then at least they will all be opened by the same gvim " server. ! call remote_send(targetServer, \ "\<C-\>\<C-n>". \ ":let g:Remote_Server = 1\<CR>". *************** *** 122,128 **** \ ":".linenum."\<CR>zv" \ ) ! call remote_foreground(firstServer) " quit this vim session ! if v:servername != firstServer q endif --- 112,118 ---- \ ":".linenum."\<CR>zv" \ ) ! call remote_foreground(targetServer) " quit this vim session ! if v:servername != targetServer q endif |
From: <sri...@us...> - 2005-12-24 06:24:13
|
Update of /cvsroot/vim-latex/vimfiles/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32589 Modified Files: latex-suite.txt latex-suite.xml Log Message: Further clarifications in the environment and command macro sections. Index: latex-suite.txt =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/doc/latex-suite.txt,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** latex-suite.txt 23 Dec 2005 07:54:25 -0000 1.60 --- latex-suite.txt 24 Dec 2005 06:23:58 -0000 1.61 *************** *** 12,16 **** macros to speed up editing LaTeX documents to functions for forward searching .dvi documents. Latex-Suite has been possible because of the contributions of ! many people. Please see latex-suite-credits [|ls_a_dQ|] for a list of people who have helped. --- 12,16 ---- macros to speed up editing LaTeX documents to functions for forward searching .dvi documents. Latex-Suite has been possible because of the contributions of ! many people. Please see latex-suite-credits [|ls_a_dU|] for a list of people who have helped. [...3014 lines suppressed...] --- 3279,3283 ---- ================================================================================ ! Credits *ls_12* *ls_a_dU* *latex-suite-credits* *************** *** 3307,3311 **** out who has done what. ! *latex-suite-maintainer* *ls_a_ez* The current maintainer(s) of Latex-Suite is(are) --- 3316,3320 ---- out who has done what. ! *latex-suite-maintainer* *ls_a_eC* The current maintainer(s) of Latex-Suite is(are) Index: latex-suite.xml =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/doc/latex-suite.xml,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** latex-suite.xml 23 Dec 2005 07:54:25 -0000 1.40 --- latex-suite.xml 24 Dec 2005 06:23:59 -0000 1.41 *************** *** 229,292 **** <title>Environment Mappings</title> &ls; provides a rich set of mappings to insert, enclose and modify ! &latex; environments. ! <section id="insert-mode-environment-mappings"> ! <title id="insert-mode-environment-mappings.title">Insert-mode Mappings</title> ! <para> ! These mappings insert LaTeX "environments" such as: ! <programlisting>\begin{center} ! &ph; ! \end{center}&ph;</programlisting> ! with the cursor left at the first |placeholder|. There are ! various ways of inserting environments into the source file. If ! the environment is a standard latex environment, then latex suite ! might also include common fields associated with it. ! </para> <para> ! See <link linkend="Tex_Env_name">this section</link> for details on ! how to customize the way &ls; will expand various environments. </para> ! <section id="ls-imap-f5"> ! <title>Method 1</title> <para> ! If you press <literal><F5></literal> in the ! insert mode while on an empty line, &ls; prompts you ! with a list of environments you might want to insert. You can ! either choose one from the list or type in a new environment ! name. This list can be customized via the <link ! linkend="Tex_PromptedEnvironments"><literal>g:Tex_PromptedEnvironments</literal></link> ! setting. </para> <para> ! In addition to the <literal>Tex_PromptedEnvironments</literal> ! variable, &ls; also lists envionments found in custom packages as ! described in the section <link linkend="package-actions">Package ! actions.</link> </para> - </section> - <section> - <title>Method 2</title> <para> ! If you press <literal><F5></literal> while on a line ! containing a single word, then &ls; creates a ! environment of that name. </para> </section> ! <section> ! <title>Method 3</title> <para> The shifted function keys, <literal><S-F1></literal> to ! <literal><S-F4></literal> can also be optionally mapped ! to some common environments which you insert most often. The ! environments mapped to each key can also be customized via the <link linkend="Tex_HotKeyMappings">g:Tex_HotKeyMappings</link> setting. </para> </section> ! <section> ! <title>Method 4</title> <para> ! Environments can also be inserted by pressing a 3 capital ! letter sequence starting with an <literal>E</literal>. The following subsection ! describes this in detail. The sequence of 3 letters generally ! tries to follow the following rules: </para> <orderedlist> --- 229,283 ---- <title>Environment Mappings</title> &ls; provides a rich set of mappings to insert, enclose and modify ! &latex; environments, i.e, <literal>\begin{...} ... \end{...}</literal> ! pairs. ! <section id="inserting-environments"> ! <title>Inserting Environments</title> <para> ! &ls; provides the following ways to insert environments </para> ! <section id="inserting-env-f5"> ! <title>Method 1: Pressing <literal><F5></literal></title> <para> ! If you press <literal><F5></literal> in the insert or normal ! mode while on an empty line, &ls; prompts you with a list of ! environments you might want to insert. You can either choose one ! from the list or type in a new environment name. If you press ! <literal><F5></literal> on a line which already has a word, ! then that word is used instead of prompting. </para> <para> ! See <link linkend="Tex_Env_name">Tex_Env_name</link> for a ! description of how &ls; uses the word to form the expansion and how ! to modify &ls;'s behavior. </para> <para> ! The list of environments which &ls; prompts you with (when ! <literal><F5></literal> is pressed on an empty line) is formed ! from the <link ! linkend="Tex_PromptedEnvironments">Tex_PromptedEnvironments</link> ! setting. ! </para> ! <para> ! In addition to this setting, &ls; also lists envionments found in ! custom packages as described in the section <link ! linkend="package-actions">Package actions.</link> </para> </section> ! <section id="inserting-env-shift-f1"> ! <title>Method 2: Using <literal><S-F1></literal>-<literal><S-F4></literal></title> <para> The shifted function keys, <literal><S-F1></literal> to ! <literal><S-F4></literal> can be mapped to insert very commonly ! used environments. The environments mapped to each key can be ! customized via the <link linkend="Tex_HotKeyMappings">g:Tex_HotKeyMappings</link> setting. </para> </section> ! <section id="inserting-env-threeletter"> ! <title>Method 3: Using three letter sequences</title> <para> ! Environments can also be inserted by pressing a 3 capital letter ! sequence starting with an <literal>E</literal>. The sequence of 3 ! letters generally tries to follow the following rules: </para> <orderedlist> *************** *** 322,345 **** </section> </section> ! <section id="visual-mode-environment-mapings"> ! <title>Visual-mode Mappings</title> <para> &ls; provides visual-mode mappings which enclose visually ! selected portions of text in environments. These mappings are ! derived from the corresponding insert-mode environment mappings ! according to the following simple rule: ! ! <programlisting>ECE --> ,ce</programlisting> ! The rule simply says that the leading <literal>E</literal> is ! converted to <literal>,</literal> and the next 2 letters are ! small case. ! ! Here <literal>ECE</literal> is the insert-mode map which inserts ! the <literal>\begin{center} ... \end{center}</literal> ! environment. Correspondingly, if you select a portion of text ! visually and press <literal>,ce</literal> while still in visual ! mode, then the selected portion will be enclosed in ! <literal>\begin{center} ... \end{center}</literal>. ! Some of the visual mode mappings are sensitive to whether you choose line-wise or character-wise. For example, if you choose a --- 313,358 ---- </section> </section> ! <section id="enclosing-environments"> ! <title>Enclosing in Environments</title> <para> &ls; provides visual-mode mappings which enclose visually ! selected portions of text in environments. There are two ways provided ! to do this. ! </para> ! <section id="enclosing-env-f5"> ! <title>Method 1: Pressing <literal><F5></literal></title> ! <para> ! You can also select a portion of text visually and press ! <literal><F5></literal> while still in visual mode. This will ! prompt you with a list of environments. (This list can be customized ! via the <link ! linkend="Tex_PromptedEnvironments">g:Tex_PromptedEnvironments</link> ! setting). You can either choose from this list or type in a new ! environment name. Once the selection is done, &ls; encloses the ! visually selected portion in the chosen environment. ! </para> ! </section> ! <section id="enclosing-env-threeletter"> ! <title>Method 2: Using three letter mappings</title> ! <para> ! You can also select text visually and press a sequence of three ! characters beginning with <literal>,</literal> (the single comma ! character) and the selected text will be enclosed in the chosen ! environment. The three letter sequence follows directly from the ! three letter sequence used to insert environments as described <link ! linkend="inserting-env-threeletter">here</link>. The following ! example describes the rule used: ! </para> ! <para> ! If <literal>ECE</literal> inserts a ! <literal>\begin{center}...\end{center}</literal> environment, then to ! enclose a block of selected text in ! <literal>\begin{center}...\end{center}</literal>, simply select the ! text and press <literal>,ce</literal>. The rule simply says that the ! leading <literal>E</literal> is converted to <literal>,</literal> and ! the next 2 letters are small case. ! </para> ! </section> ! <para> Some of the visual mode mappings are sensitive to whether you choose line-wise or character-wise. For example, if you choose a *************** *** 351,368 **** \end{center}</programlisting> </para> - <anchor id="ls-vmap-f5" /> - <para> - You can also select a portion of text visually and press - <literal><F5></literal> while still in visual mode. This will - prompt you with a list of environments. (This list can be customized - via the <link - linkend="Tex_PromptedEnvironments">g:Tex_PromptedEnvironments</link> - setting). You can either choose from this list or type in a new - environment name. Once the selection is done, &ls; encloses the - visually selected portion in the chosen environment. - </para> </section> ! <section id="normal-mode-environment-mappings"> ! <title>Normal Mode Mappings</title> <para> Pressing <literal><S-F5></literal> in normal mode detects which --- 364,370 ---- \end{center}</programlisting> </para> </section> ! <section id="changing-environments"> ! <title>Changing Environments</title> <para> Pressing <literal><S-F5></literal> in normal mode detects which *************** *** 394,446 **** <section id="latex-command-maps"> <title>Command Mappings</title> ! <anchor id="ls-imap-f7" /> ! <anchor id="ls-imap-s-f7" /> ! <para> ! &ls; provides two simple mappings <literal><F7></literal> and ! <literal><S-F7></literal> which work in both insert and normal ! mode in an idential manner. In insert mode, if the cursor is touching a ! word, then that word is replaced by a command constructed with that ! word. If the cursor is located on a white-space character, then you ! will be prompted with a list of commands to choose from. The list of ! commands is constructed from the <link ! linkend="Tex_PromptedCommands"><literal>g:Tex_PromptedCommands</literal></link> ! setting and also from commands which &ls; finds while scanning custom ! packages which &ls; finds. See the <link ! linkend="package-actions">Package actions</link> section for details ! on which files are scanned etc. ! </para> ! <para> ! For certain common commands, &ls; will expand them to include ! additional arguments as needed. For example, <literal>frac</literal> ! becomes <literal>\frac{&ph;}{&ph;}&ph;</literal>. Otherwise, it will ! simply change the word under the cursor as follows ! <programlisting>word --> \word{&ph;}&ph;</programlisting> ! You can define custom expansios ! of commands using the <literal>Tex_Com_{name}</literal> setting as ! described in <link linkend="Tex_Com_name">here</link>. ! </para> ! <para> ! Pressing <literal><F7></literal> in normal mode is equivalent to ! pressing <literal>i</literal> to go to insert mode and then pressing ! <literal><F7></literal>. In other words, if the cursor is in or ! just after a word, then that word will become a command, otherwise, the ! user is prompted to choose a command to insert. ! </para> ! <para> ! In both insert and normal mode <literal><S-F7></literal> will ! find out if you are presently within an environment and then prompt you ! with a list of commands to change it to. ! </para> ! <anchor id="ls-vmap-f7" /> ! <para> ! You can also select a portion of text visually and press ! <literal><F7></literal> while still in visual mode. This will ! prompt you with a list of commands. (This list can be customized ! via the <link ! linkend="Tex_PromptedCommands">g:Tex_PromptedCommands</link> ! setting). You can either choose from this list or type in a new ! command name. Once the selection is done, &ls; encloses the ! visually selected portion in the chosen command. ! </para> </section> <section id="font-maps"> --- 396,453 ---- <section id="latex-command-maps"> <title>Command Mappings</title> ! &ls; provides a rich set of mappings to insert, enclose and modify ! &latex; commands. ! <section id="inserting-commands"> ! <title>Inserting &latex; commands</title> ! <anchor id="ls-imap-f7" /> ! <anchor id="ls-imap-s-f7" /> ! <para> ! Pressing <literal><F7></literal> in insert or normal mode while ! the cursor is touching a word will insert a command formed from the ! word touching the cursor. ! </para> ! <para> ! For certain common commands, &ls; will expand them to include ! additional arguments as needed. For example, <literal>frac</literal> ! becomes <literal>\frac{&ph;}{&ph;}&ph;</literal>. Otherwise, it will ! simply change the word under the cursor as follows ! <programlisting>word --> \word{&ph;}&ph;</programlisting> ! You can define custom expansions ! of commands using the <literal>Tex_Com_{name}</literal> setting as ! described in <link linkend="Tex_Com_name">here</link>. ! </para> ! <para> ! If <literal><F7></literal> is pressed when the cursor is on ! white-space, then &ls; will prompt you to choose a command and insert ! that instead.The list of commands is constructed from the <link ! linkend="Tex_PromptedCommands"><literal>g:Tex_PromptedCommands</literal></link> ! setting and also from commands which &ls; finds while scanning custom ! packages which &ls; finds. See the <link ! linkend="package-actions">Package actions</link> section for details ! on which files are scanned etc. ! </para> ! </section> ! <section id="enclosing-commands"> ! <title>Enclosing in a command</title> ! <para> ! You can select a portion of text visually and press ! <literal><F7></literal> while still in visual mode. This will ! prompt you with a list of commands. (This list can be customized ! via the <link ! linkend="Tex_PromptedCommands">g:Tex_PromptedCommands</link> ! setting). You can either choose from this list or type in a new ! command name. Once the selection is done, &ls; encloses the ! visually selected portion in the chosen command. ! </para> ! </section> ! <section id="changing-commands"> ! <title>Changing commands</title> ! <anchor id="ls-vmap-f7" /> ! <para> ! In both insert and normal mode <literal><S-F7></literal> will ! find out if you are presently within an environment and then prompt you ! with a list of commands to change it to. ! </para> ! </section> </section> <section id="font-maps"> *************** *** 1274,1278 **** environments found to the list of commands and environments which you are prompted with when you press <link ! linkend="ls-imap-f5"><literal><F5></literal></link> or <link linkend="ls-imap-f7"><literal><F7></literal></link> in insert mode. --- 1281,1285 ---- environments found to the list of commands and environments which you are prompted with when you press <link ! linkend="inserting-env-f5"><literal><F5></literal></link> or <link linkend="ls-imap-f7"><literal><F7></literal></link> in insert mode. *************** *** 3359,3363 **** </thead> <tbody> ! <row><entry><literal>g:Tex_EnvironmentMaps </literal></entry><entry><link linkend="insert-mode-environment-mappings">Environment Mappings</link></entry><entry>1</entry></row> <row><entry><literal>g:Tex_EnvironmentMenus</literal></entry><entry></entry><entry>1</entry></row> <row><entry><literal>g:Tex_FontMaps </literal></entry><entry><link linkend="font-maps">Font Mappings</link></entry><entry>1</entry></row> --- 3366,3371 ---- </thead> <tbody> ! <row><entry><literal>g:Tex_EnvironmentMaps ! </literal></entry><entry><link linkend="environment-mappings">Environment Mappings</link></entry><entry>1</entry></row> <row><entry><literal>g:Tex_EnvironmentMenus</literal></entry><entry></entry><entry>1</entry></row> <row><entry><literal>g:Tex_FontMaps </literal></entry><entry><link linkend="font-maps">Font Mappings</link></entry><entry>1</entry></row> *************** *** 3483,3489 **** <para> In order to avoid clashes between the large number of visual mode macros ! provided, the <link linkend="visual-mode-environment-mapings">visual mode macros for environments</link> and sections start with a character ! different from <literal>g:Tex_Leade</literal>. </para> </section> --- 3491,3497 ---- <para> In order to avoid clashes between the large number of visual mode macros ! provided, the <link linkend="enclosing-env-threeletter">visual mode macros for environments</link> and sections start with a character ! different from <literal>g:Tex_Leader</literal>. </para> </section> |
From: <sri...@us...> - 2005-12-23 07:54:37
|
Update of /cvsroot/vim-latex/vimfiles/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9295 Modified Files: latex-suite.txt latex-suite.xml Log Message: Clarifying the documentation some more. Index: latex-suite.txt =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/doc/latex-suite.txt,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** latex-suite.txt 22 Dec 2005 21:28:47 -0000 1.59 --- latex-suite.txt 23 Dec 2005 07:54:25 -0000 1.60 *************** *** 12,16 **** macros to speed up editing LaTeX documents to functions for forward searching .dvi documents. Latex-Suite has been possible because of the contributions of ! many people. Please see latex-suite-credits [|ls_a_dO|] for a list of people who have helped. --- 12,16 ---- macros to speed up editing LaTeX documents to functions for forward searching .dvi documents. Latex-Suite has been possible because of the contributions of ! many people. Please see latex-suite-credits [|ls_a_dQ|] for a list of people who have helped. [...2445 lines suppressed...] --- 3270,3274 ---- ================================================================================ ! Credits *ls_12* *ls_a_dQ* *latex-suite-credits* *************** *** 3266,3270 **** out who has done what. ! *latex-suite-maintainer* *ls_a_ev* The current maintainer(s) of Latex-Suite is(are) --- 3307,3311 ---- out who has done what. ! *latex-suite-maintainer* *ls_a_ez* The current maintainer(s) of Latex-Suite is(are) Index: latex-suite.xml =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/doc/latex-suite.xml,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** latex-suite.xml 22 Dec 2005 21:28:49 -0000 1.39 --- latex-suite.xml 23 Dec 2005 07:54:25 -0000 1.40 *************** *** 1565,1584 **** <title>&ls; \ref completion</title> <para> ! To complete a <literal>|\ref|</literal> command, position yourself ! between the curly braces of a <literal>\ref</literal> command and press ! <literal><F9></literal>. &ls; will present you with a list of ! <literal>\label</literal>'s as described <link ! linkend="ls-completion-usage" ! endterm="ls-completion-usage.title">here</link>. You can also press ! <literal><F9></literal> after typing a part of the label, for ! example, a common prefix which a group of <literal>\label</literal>'s ! might share. In this case, &ls; will list only those ! <literal>\label</literal>'s which start with that prefix. </para> <para> ! See <link ! linkend="Tex_UseSimpleLabelSearch">Tex_UseSimpleLabelSearch</link> for ! a description of the algorithm used by &ls; to search for ! <literal>\label</literal>'s and how to change it. </para> <para> --- 1565,1608 ---- <title>&ls; \ref completion</title> <para> ! If you press <F9> in insert mode when the cursor is positioned ! just after the string "<literal>\ref{pre</literal>", then &ls; will ! present you with a list of all the <literal>\label</literal>s which ! begin with the prefix "pre". If you press <F9> after ! <literal>\ref{</literal>, then &ls; will present you with a list of ! <emphasis>all</emphasis> labels. See <link ! linkend="ls-completion-usage">here</link> for an example. </para> <para> ! <orderedlist> ! <listitem>If <link ! linkend="Tex_UseSimpleLabelSearch">Tex_UseSimpleLabelSearch</link> ! is set to 1, then &ls; will simply search for ! <literal>\label</literal>s in all the <literal>.tex</literal> files ! in the directory containing the current file</listitem>. ! <listitem>If the <link ! linkend="Tex_ProjectSourceFiles">Tex_ProjectSourceFiles</link> ! setting is non-empty, then &ls; will search for all labels specified ! in the list of files given by the setting above.</listitem> ! <listitem>If Tex_UseSimpleLabelSearch is 0 and Tex_ProjectSourceFiles ! is empty, then &ls; uses the following logic: ! <orderedlist> ! <listitem>First &ls; will determine if it can find a master-file ! specification as described <link ! linkend="latex-master-file-specification">here</link>.</listitem> ! <listitem>If it can, then &ls; will search for ! <literal>\label</literal>'s in that file first.</listitem> ! <listitem>If the master file <literal>\include</literal>'s or ! <literal>\input</literal>'s any other files, then &ls; will search ! for <literal>\label</literal>'s in those files. The search for ! <literal>\include</literal>'d and <literal>\input</literal>'ed files ! is recursive, i.e, if an <literal>\include</literal>'d file ! <literal>\include</literal>'s another file, then that will be ! searched as well and so on.</listitem> ! <listitem>If &ls; cannot find a master file specified for this file, ! then it will simply search for <literal>\labels</literal> in the ! present file.</listitem> ! </orderedlist> ! </listitem> ! </orderedlist> </para> <para> *************** *** 1803,1806 **** --- 1827,1836 ---- result in &ls; displaying a warning message without taking any action. </para> + <para> + If you are using a multiple file project and need to compile a master + file while editing other files, then &ls; provides a way to specify the + file to be compiled as described in <link + linkend="latex-master-file">latex-master-file</link>. + </para> <section id="compiler-rules"> <title>Setting Compilation rules</title> *************** *** 1956,2018 **** </para> </section> - <section id="latex-master-file"> - <title>Specifying which file to compile</title> - <para> - Often times the file you are currently editing is only a fragment being - <literal>\input</literal>'ed into a master tex file. In such cases you - will need to do create a dummy file in the directory containing the - current file. This dummy file is of the form: - <literal><mainfilename>.latexmain</literal> - </para> - <para> - As an example, suppose you have the following setup: - <programlisting>% file: main.tex - \documentclass{report} - \begin{document} - - \input{chapter1.tex} - - \end{document}</programlisting> - In other words, even when you are editing <literal>chapter1.tex</literal>, - you want to compile <literal>main.tex</literal>. In this situation, create - a file called <literal>main.tex.latexmain</literal> in the directory - containing <literal>chapter1.tex</literal> (and - <literal>main.tex</literal>). After doing this, when you press - <literal>\ll</literal> while editing <literal>chapter1.tex</literal>, then - &ls; will compile <literal>main.tex</literal> instead. The - <literal>.latexmain</literal> file can also be present in a directory - directly above the directory containing the present file. &ls; will - scan upwards recursively from the directory containing the present file - and stop when it finds a <literal>.latexmain</literal> file, which - points to the master file for the present file. - </para> - <note> - <para> - Here <literal>main.tex.latexmain</literal> is (obviously) a different - file from <literal>main.tex</literal> itself. - <literal>main.tex</literal> need not be renamed. This ofcourse - restricts each directory to have a single master file. - </para> - </note> - <anchor id="Tex_MainFileExpression" /> - <para> - If you wish to use some different logic to specify the main file name, - you can specify a custom expression via the - <literal>Tex_MainFileExpression</literal> variable. This is a string - containing a valid vim expression. In addition, you can use a variable - <literal>modifier</literal> which is in the format used for - <literal>|filename-modifiers|</literal>, for example, - <literal>':p:h'</literal>. You should utilize this variable to modify - the filename of the main file. - <programlisting>let g:Tex_MainFileExpression = 'MainFile(modifier)' - function! MainFile(fmod) - if glob('*.latexmain') != '' - return fnamemodify(glob('*.latexmain'), a:fmod) - else - return '' - endif - endif</programlisting> - </para> - </section> <section id="compiler-output-customization"> <title>Customizing the compiler output</title> --- 1986,1989 ---- *************** *** 2595,2621 **** </section> <section id="latex-project"> ! <title>Latex projects</title> <para> ! Most &latex; projects are divided into a set of files each of which ! contains some related material, like a chapter, a section etc. &ls; ! supports this in various ways. The per-project settings are stored in ! the <link linkend="latex-master-file">master file</link>, which is of ! the form <literal>main.tex.latexmain</literal>. In previous versions, ! the contents of this file were ignored. However, this file is now ! considered as if it is a &vim; source file and its contents are sourced ! whenever a new project is edited. Thus you can put &ls; settings ! specific to a given project in this file. </para> <para> ! This file is used in various ways. Firstly, it is used to point to the ! name of the file which should be compiled as described in <link ! linkend="latex-master-file">latex-master-file</link>. </para> <para> ! You can also put settings such as <link ! linkend="Tex_ProjectSourceFiles">Tex_ProjectSourceFiles</link> in this ! file to minimize the time it takes to search through all the relevant ! project files. </para> </section> <section id="latex-suite-commands-maps"> --- 2566,2691 ---- </section> <section id="latex-project"> ! <title>Multiple file &latex; projects</title> ! <anchor id="latex-project-example" /> <para> ! Many &latex; projects contain multiple source files which are ! <literal>\include</literal>d from a master file. A typical example of ! this situation is a directory layout such as the following </para> <para> ! <programlisting>thesis/ ! main.tex ! abstract.tex ! intro/ ! intro.tex ! figures/ ! fig1.eps ! fig2.eps ! chapter1/ ! chap1.tex ! figures/ ! fig1.eps ! conclusion/ ! conclusion.tex ! figures/</programlisting> </para> <para> ! In the above case, <literal>main.tex</literal> will typically look like ! </para> ! <para> ! <programlisting>% file: main.tex ! \documentclass{report} ! \begin{document} ! ! \input{abstract.tex} ! \input{intro/intro.tex} ! \input{chapter1/chap1.tex} ! \input{conclusion/conclusion.tex} ! ! \end{document}</programlisting> ! </para> ! <para> ! <anchor id="latex-master-file-specification" /> ! In such situations, you will need to convey to &ls; that ! <literal>main.tex</literal> is the main file which ! <literal>\input</literal>s the other files. This is done by creating a ! file called <literal>main.tex.latexmain</literal> in the same directory ! in which <literal>main.tex</literal> resides. This file is called the ! <emphasis>master file</emphasis> in this manual. See <link ! linkend="Tex_MainFileExpression">Tex_MainFileExpression</link> for an ! alternative way of specifying the master file. ! </para> ! <note> ! <para> ! Here <literal>main.tex.latexmain</literal> is (obviously) a different ! file from <literal>main.tex</literal> itself. ! <literal>main.tex</literal> need not be renamed. This ofcourse ! restricts each directory to have a single master file. ! </para> ! </note> ! <para> ! Each time &ls; opens a new &latex; file, it will try to see if it is ! part of a multiple file project by searching upwards (to the root of ! the file-system) from the current file's directory to see if it finds a ! file of the form <literal>*.latexmain</literal>. If such a file is ! found, then it is considered that the current file is part of a larger ! project. The name of the &latex; master file is inferred directly from ! the first part of the <literal>*.latexmain</literal> file as described ! in the example above. </para> + <section id="latex-project-settings"> + <title>&ls; project settings</title> + <para> + If a <link linkend="latex-master-file">master file</link> is found, + then &ls; <literal>:source</literal>s the file. Thus this file needs to + contain valid &vim; commands. This file is typically used to store + project specific settings. + </para> + <para> + Some typical per-project settings which are best put in the master file + are + <simplelist> + <member><link + linkend="Tex_ProjectSourceFiles">Tex_ProjectSourceFiles</link></member> + </simplelist> + </para> + </section> + <section id="latex-master-file"> + <title>Specifying which file to compile</title> + <para> + In the example described <link + linkend="latex-project-example">previously</link>, if you are editing + <literal>intro/intro.tex</literal> and press <literal>\ll</literal>, + then you still want &ls; to compile <literal>main.tex</literal>, + because <literal>intro/intro.tex</literal> is merely a fragment which + is <literal>\input</literal>'ed into <literal>main.tex</literal>. If + the master file is already specified using the + <literal>*.latexmain</literal> convention described <link + linkend="latex-project-example">previously</link>, then &ls; will automatically + compile the master file when you are editing any of its + <literal>\input</literal>'ed fragments. Thus pressing + <literal>\ll</literal> while editing <literal>intro/intro.tex</literal> + will compile <literal>main.tex</literal>. + </para> + <anchor id="Tex_MainFileExpression" /> + <para> + If you wish to use some different logic to specify the main file name, + you can specify a custom expression via the + <literal>Tex_MainFileExpression</literal> variable. This is a string + containing a valid vim expression. In addition, you can use a variable + <literal>modifier</literal> which is in the format used for + <literal>|filename-modifiers|</literal>, for example, + <literal>':p:h'</literal>. You should utilize this variable to modify + the filename of the main file. + <programlisting>let g:Tex_MainFileExpression = 'MainFile(modifier)' + function! MainFile(fmod) + if glob('*.latexmain') != '' + return fnamemodify(glob('*.latexmain'), a:fmod) + else + return '' + endif + endif</programlisting> + </para> + </section> </section> <section id="latex-suite-commands-maps"> *************** *** 3038,3056 **** <para> Customizing &ls; is done by defining certain global variables in ! <literal>$VIM/ftplugin/tex/texrc</literal>, where <literal>$VIM</literal> corresponds to <literal>~/.vim</literal> for *nix machines and <literal>~/vimfiles</literal> for windows machines. This file ! is not part of the &ls; distribution. You will need to create this file if you need to change any default settinngs. Since this file is not included as part of the &ls; distribution, it will not be over-written in subsequent updates. </para> - <note> - <para>It is also possible to define any customization in the - <literal>$VIM/ftplugin/tex.vim</literal> file, but for the sake of - clarity, you might want to use the <literal>texrc</literal> file - described above - </para> - </note> <para> The default settings in &ls; are defined in --- 3108,3120 ---- <para> Customizing &ls; is done by defining certain global variables in ! <literal>$VIM/ftplugin/tex.vim</literal>, where <literal>$VIM</literal> corresponds to <literal>~/.vim</literal> for *nix machines and <literal>~/vimfiles</literal> for windows machines. This file ! is not part of the &ls; distribution. You will need to create this file ! yourself (or modify it if it exists) if you need to change any default settinngs. Since this file is not included as part of the &ls; distribution, it will not be over-written in subsequent updates. </para> <para> The default settings in &ls; are defined in *************** *** 3212,3241 **** <section id="customizing-macros"> <title>Macro Customization</title> ! <para> ! The following variables disable various parts of the macro functionality ! of &ls;. See the links to the relevant sections to see what functionality ! setting each of the variables to zero will take away. ! </para> ! <anchor id="Tex_EnvironmentMaps" /> ! <anchor id="Tex_EnvironmentMenus" /> ! <anchor id="Tex_FontMaps" /> ! <anchor id="Tex_FontMenus" /> ! <anchor id="Tex_SectionMaps" /> ! <anchor id="Tex_SectionMenus" /> ! <informaltable frame="all"> ! <tgroup cols="3"> ! <thead> ! <row><entry>Setting</entry><entry>Link to relevant section</entry><entry>Default Value</entry></row> ! </thead> ! <tbody> ! <row><entry><literal>g:Tex_EnvironmentMaps </literal></entry><entry><link linkend="insert-mode-environment-mappings">Environment Mappings</link></entry><entry>1</entry></row> ! <row><entry><literal>g:Tex_EnvironmentMenus</literal></entry><entry></entry><entry>1</entry></row> ! <row><entry><literal>g:Tex_FontMaps </literal></entry><entry><link linkend="font-maps">Font Mappings</link></entry><entry>1</entry></row> ! <row><entry><literal>g:Tex_FontMenus </literal></entry><entry></entry><entry>1</entry></row> ! <row><entry><literal>g:Tex_SectionMaps </literal></entry><entry><link linkend="section-mappings">Section Mappings</link></entry><entry>1</entry></row> ! <row><entry><literal>g:Tex_SectionMenus </literal></entry><entry></entry><entry>1</entry></row> ! </tbody> ! </tgroup> ! </informaltable> <section id="Tex_UseMenuWizard"> <title>g:Tex_UseMenuWizard</title> --- 3276,3372 ---- <section id="customizing-macros"> <title>Macro Customization</title> ! <section id="Tex_Env_name"> ! <title>Tex_Env_name</title> ! <para> ! If you wish to wish to expand certain environments differently from ! the way &ls; does it, you can define custom expansions using global ! variables of the form <literal>Tex_Env_{name}</literal> where ! <literal>name</literal> corresponds to the environment. ! </para> ! <para> ! For example, if you press <literal><F5></literal> after typing ! <literal>theorem</literal>, &ls; will by default expand it to ! <programlisting>\begin{theorem} ! \label{&ph;}&ph; ! \end{theorem}&ph;</programlisting> ! However, if you wish change this to ! <programlisting>\begin{theorem} ! &ph; ! \end{theorem}&ph;</programlisting> ! then define the following variable ! <programlisting>let g:Tex_Env_theorem = "\\begin{theorem}\<CR>&ph;\<CR>\\end{theorem}"</programlisting> ! </para> ! <para> ! If the expaniosn uses special keys such as carriage return etc, then ! use double-quotes and use the <literal>"\<key>"</literal> ! notation for special keys. Backslashes have to be doubled. ! </para> ! <para> ! You could even use strings returned by functions as the expansion by ! using the <link ! linkend="IMAP_PutTextWithMovement">IMAP_PutTextWithMovement()</link> ! function. ! </para> ! <para> ! If the name of the environment contains special characters (for ! example, the <literal>eqnarray*</literal> environment), then use the ! following form: ! <programlisting>let g:Tex_Env_{'eqnarray*'} = ! \ "\\begin{eqnarray*}\<CR>&ph; &=& &ph;\<CR>\\end{eqnarray*}&ph;"</programlisting> ! This will make pressing <literal><F5></literal> after ! <literal>eqnarray*</literal> expand to ! <programlisting>\begin{eqnarray*} ! &ph; &=& &ph; ! \end{eqnarray*}&ph;</programlisting> ! </para> ! </section> ! <section id="Tex_Com_name"> ! <title>Tex_Com_name</title> ! <para> ! If you wish to define new expansions for fast command insertion as ! described <link linkend="latex-command-maps">here</link>, or redefine ! expansios from the default values in &ls;, you will need to define ! variables of the form <literal>g:Tex_Com_{name}</literal> where ! <literal>name</literal> is a command name. For example, with the ! setting ! <programlisting>let g:Tex_Com_frac = "\\frac{&ph;}{&ph;}&ph;"</programlisting> ! pressing <literal><F7></literal> after typing ! <literal>frac</literal> will change it to <literal>\frac{&ph;}{&ph;}&ph;</literal> ! </para> ! <para> ! See <link linkend="Tex_Env_name">Tex_Env_name</link> for additional ! details on how to create this setting in various special ! circumstances. ! </para> ! </section> ! <section id="macro-enabling"> ! <title>Enabling / disabling macros</title> ! <para> ! The following variables disable various parts of the macro functionality ! of &ls;. See the links to the relevant sections to see what functionality ! setting each of the variables to zero will take away. ! </para> ! <anchor id="Tex_EnvironmentMaps" /> ! <anchor id="Tex_EnvironmentMenus" /> ! <anchor id="Tex_FontMaps" /> ! <anchor id="Tex_FontMenus" /> ! <anchor id="Tex_SectionMaps" /> ! <anchor id="Tex_SectionMenus" /> ! <informaltable frame="all"> ! <tgroup cols="3"> ! <thead> ! <row><entry>Setting</entry><entry>Link to relevant section</entry><entry>Default Value</entry></row> ! </thead> ! <tbody> ! <row><entry><literal>g:Tex_EnvironmentMaps </literal></entry><entry><link linkend="insert-mode-environment-mappings">Environment Mappings</link></entry><entry>1</entry></row> ! <row><entry><literal>g:Tex_EnvironmentMenus</literal></entry><entry></entry><entry>1</entry></row> ! <row><entry><literal>g:Tex_FontMaps </literal></entry><entry><link linkend="font-maps">Font Mappings</link></entry><entry>1</entry></row> ! <row><entry><literal>g:Tex_FontMenus </literal></entry><entry></entry><entry>1</entry></row> ! <row><entry><literal>g:Tex_SectionMaps </literal></entry><entry><link linkend="section-mappings">Section Mappings</link></entry><entry>1</entry></row> ! <row><entry><literal>g:Tex_SectionMenus </literal></entry><entry></entry><entry>1</entry></row> ! </tbody> ! </tgroup> ! </informaltable> ! </section> <section id="Tex_UseMenuWizard"> <title>g:Tex_UseMenuWizard</title> *************** *** 3432,3503 **** </para> </section> - <section id="Tex_Env_name"> - <title>Tex_Env_name</title> - <para> - If you wish to wish to expand certain environments differently from - the way &ls; does it, you can define custom expansions using global - variables of the form <literal>Tex_Env_{name}</literal> where - <literal>name</literal> corresponds to the environment. This - over-riding setting only works for Methods 1-3 described in the - section <link linkend="insert-mode-environment-mappings" - endterm="insert-mode-environment-mappings.title"></link>. - In the future, it will work with the fourth method too. - </para> - <para> - For example, if you press <literal><F5></literal> after typing - <literal>theorem</literal>, &ls; will by default expand it to - <programlisting>\begin{theorem} - \label{&ph;}&ph; - \end{theorem}&ph;</programlisting> - However, if you wish change this to - <programlisting>\begin{theorem} - &ph; - \end{theorem}&ph;</programlisting> - then define the following variable - <programlisting>let g:Tex_Env_theorem = "\\begin{theorem}\<CR>&ph;\<CR>\\end{theorem}"</programlisting> - </para> - <para> - If the expaniosn uses special keys such as carriage return etc, then - use double-quotes and use the <literal>"\<key>"</literal> - notation for special keys. Backslashes have to be doubled. - </para> - <para> - You could even use strings returned by functions as the expansion by - using the <link - linkend="IMAP_PutTextWithMovement">IMAP_PutTextWithMovement()</link> - function. - </para> - <para> - If the name of the environment contains special characters (for - example, the <literal>eqnarray*</literal> environment), then use the - following form: - <programlisting>let g:Tex_Env_{'eqnarray*'} = - \ "\\begin{eqnarray*}\<CR>&ph; &=& &ph;\<CR>\\end{eqnarray*}&ph;"</programlisting> - This will make pressing <literal><F5></literal> after - <literal>eqnarray*</literal> expand to - <programlisting>\begin{eqnarray*} - &ph; &=& &ph; - \end{eqnarray*}&ph;</programlisting> - </para> - </section> - <section id="Tex_Com_name"> - <title>Tex_Com_name</title> - <para> - If you wish to define new expansions for fast command insertion as - described <link linkend="latex-command-maps">here</link>, or redefine - expansios from the default values in &ls;, you will need to define - variables of the form <literal>g:Tex_Com_{name}</literal> where - <literal>name</literal> is a command name. For example, with the - setting - <programlisting>let g:Tex_Com_frac = "\\frac{&ph;}{&ph;}&ph;"</programlisting> - pressing <literal><F7></literal> after typing - <literal>frac</literal> will change it to <literal>\frac{&ph;}{&ph;}&ph;</literal> - </para> - <para> - See <link linkend="Tex_Env_name">Tex_Env_name</link> for additional - details on how to create this setting in various special - circumstances. - </para> - </section> <section id="Tex_ItemStyle_environment"> <title>Tex_ItemStyle_environment</title> --- 3563,3566 ---- *************** *** 3687,3716 **** <title>Tex_UseSimpleLabelSearch</title> <para> ! This variable controls whether &ls; uses a simple algorithm to search ! for possible completions of a <literal>\label</literal> command. When ! set to 1, &ls; will search simply for <literal>\label</literal>'s in ! all the <literal>.tex</literal> files found in the present directory, ! ignoring whether they are part of a latex project or not. ! </para> ! <para> ! When set to 0, then &ls; will use the following algorithm to determine ! the list of possible completions: </para> - <orderedlist> - <listitem>First &ls; will determine if it can find a master-file - specification.</listitem> - <listitem>If it can, then &ls; will search for - <literal>\label</literal>'s in that file first.</listitem> - <listitem>If the master file <literal>\include</literal>'s or - <literal>\input</literal>'s any other files, then &ls; will search - for <literal>\label</literal>'s in those files. The search for - <literal>\include</literal>'d and <literal>\input</literal>'ed files - is recursive, i.e, if an <literal>\include</literal>'d file - <literal>\include</literal>'s another file, then that will be - searched as well and so on.</listitem> - <listitem>If &ls; cannot find a master file specified for this file, - then it will simply search for <literal>\labels</literal> in the - present file.</listitem> - </orderedlist> </section> <section id="Tex_ProjectSourceFiles"> --- 3750,3758 ---- <title>Tex_UseSimpleLabelSearch</title> <para> ! When set to 1, &ls; searches for <literal>\label</literal>s in all ! <literal>.tex</literal> files in the directory containing the file ! being edited when <F9> is pressed. See <link ! linkend="ls-completion-ref">\ref completion</link> for details. </para> </section> <section id="Tex_ProjectSourceFiles"> *************** *** 3761,3765 **** </section> </section> ! <section id="compiler-customization"> <title>Compiler Customization</title> <para> --- 3803,3807 ---- </section> </section> ! <section id="customizing-compiling"> <title>Compiler Customization</title> <para> *************** *** 3973,3977 **** </section> </section> ! <section id="viewer-customization"> <title>Viewer Customization</title> <para> --- 4015,4019 ---- </section> </section> ! <section id="customizing-viewing"> <title>Viewer Customization</title> <para> |
From: <sri...@us...> - 2005-12-22 21:32:46
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26809 Modified Files: bibtex.vim main.vim texmenuconf.vim wizardfuncs.vim Log Message: Index: bibtex.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/bibtex.vim,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** bibtex.vim 5 Aug 2004 01:48:15 -0000 1.6 --- bibtex.vim 22 Dec 2005 21:32:38 -0000 1.7 *************** *** 3,8 **** " Function: BibT " Author: Alan G Isaac <ai...@am...> ! " modified by Srinath Avadhanula <srinath AT fastmail DOT fm> ! " for latex-suite. " License: Vim Charityware license. " CVS: $Id$ --- 3,7 ---- " Function: BibT " Author: Alan G Isaac <ai...@am...> ! " modified by Srinath Avadhanula for latex-suite. " License: Vim Charityware license. " CVS: $Id$ Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** main.vim 22 Dec 2005 21:27:20 -0000 1.85 --- main.vim 22 Dec 2005 21:32:38 -0000 1.86 *************** *** 2,6 **** " Language: LaTeX (ft=tex) " Maintainer: Srinath Avadhanula - " Email: sr...@fa... " CVS: $Id$ " URL: --- 2,5 ---- Index: texmenuconf.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/texmenuconf.vim,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** texmenuconf.vim 7 Nov 2003 02:11:50 -0000 1.21 --- texmenuconf.vim 22 Dec 2005 21:32:38 -0000 1.22 *************** *** 1,5 **** "============================================================================= " File: texmenuconf.vim ! " Author: Srinath Avadhanula <sr...@fa...> " Copyright: Vim charityware license. :help license " Description: --- 1,5 ---- "============================================================================= " File: texmenuconf.vim ! " Author: Srinath Avadhanula " Copyright: Vim charityware license. :help license " Description: Index: wizardfuncs.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/wizardfuncs.vim,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** wizardfuncs.vim 27 Nov 2005 01:20:56 -0000 1.21 --- wizardfuncs.vim 22 Dec 2005 21:32:38 -0000 1.22 *************** *** 5,9 **** " Installation: " History: pluginized by Srinath Avadhanula - " ( sr...@fa...) "============================================================================= --- 5,8 ---- |
From: <sri...@us...> - 2005-12-22 21:28:56
|
Update of /cvsroot/vim-latex/vimfiles/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25815 Modified Files: latex-suite.txt latex-suite.xml Log Message: New: A desciption of how Tex_ProjectSourceFiles works. Index: latex-suite.txt =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/doc/latex-suite.txt,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** latex-suite.txt 19 Nov 2005 22:35:47 -0000 1.58 --- latex-suite.txt 22 Dec 2005 21:28:47 -0000 1.59 *************** *** 12,16 **** macros to speed up editing LaTeX documents to functions for forward searching .dvi documents. Latex-Suite has been possible because of the contributions of ! many people. Please see latex-suite-credits [|ls_a_dM|] for a list of people who have helped. --- 12,16 ---- macros to speed up editing LaTeX documents to functions for forward searching .dvi documents. Latex-Suite has been possible because of the contributions of ! many people. Please see latex-suite-credits [|ls_a_dO|] for a list of people who have helped. [...1896 lines suppressed...] --- 3229,3233 ---- ================================================================================ ! Credits *ls_12* *ls_a_dO* *latex-suite-credits* *************** *** 3224,3228 **** out who has done what. ! *latex-suite-maintainer* *ls_a_et* The current maintainer(s) of Latex-Suite is(are) --- 3266,3270 ---- out who has done what. ! *latex-suite-maintainer* *ls_a_ev* The current maintainer(s) of Latex-Suite is(are) Index: latex-suite.xml =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/doc/latex-suite.xml,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** latex-suite.xml 19 Nov 2005 22:35:47 -0000 1.38 --- latex-suite.xml 22 Dec 2005 21:28:49 -0000 1.39 *************** *** 1990,1996 **** <para> Here <literal>main.tex.latexmain</literal> is (obviously) a different ! file from <literal>main.tex</literal> itself. <literal>main.tex</literal> ! need not be renamed. The contents of ! <literal>main.tex.latexmain</literal> are not used. This ofcourse restricts each directory to have a single master file. </para> --- 1990,1995 ---- <para> Here <literal>main.tex.latexmain</literal> is (obviously) a different ! file from <literal>main.tex</literal> itself. ! <literal>main.tex</literal> need not be renamed. This ofcourse restricts each directory to have a single master file. </para> *************** *** 2595,2598 **** --- 2594,2622 ---- </section> </section> + <section id="latex-project"> + <title>Latex projects</title> + <para> + Most &latex; projects are divided into a set of files each of which + contains some related material, like a chapter, a section etc. &ls; + supports this in various ways. The per-project settings are stored in + the <link linkend="latex-master-file">master file</link>, which is of + the form <literal>main.tex.latexmain</literal>. In previous versions, + the contents of this file were ignored. However, this file is now + considered as if it is a &vim; source file and its contents are sourced + whenever a new project is edited. Thus you can put &ls; settings + specific to a given project in this file. + </para> + <para> + This file is used in various ways. Firstly, it is used to point to the + name of the file which should be compiled as described in <link + linkend="latex-master-file">latex-master-file</link>. + </para> + <para> + You can also put settings such as <link + linkend="Tex_ProjectSourceFiles">Tex_ProjectSourceFiles</link> in this + file to minimize the time it takes to search through all the relevant + project files. + </para> + </section> <section id="latex-suite-commands-maps"> <title>&ls; Commands and Maps</title> *************** *** 3690,3693 **** --- 3714,3746 ---- </orderedlist> </section> + <section id="Tex_ProjectSourceFiles"> + <title>g:Tex_ProjectSourceFiles</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>String</entry></row> + <row><entry>Default Value</entry> + <entry><literal>''</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + This setting is meant to be initialized on a per-project basis using + the <link linkend="latex-master-file">&ls; master file</link> as + described in <link linkend="latex-project">&ls; Project</link> + section. It is a list of source files which are used in the project. + If defined, then instead of using the logic described in + <link + linkend="Tex_UseSimpleLabelSearch">Tex_UseSimpleLabelSearch</link> to + search for files in which to search for <literal>\label</literal>s, we + simply search for <literal>\label</literal>s in this list. This + significantly reduces the time it takes to generate the list of + possible completions for large projects. + </para> + <para> + The list is specified as a whitespace seperated list of filenames + relative to the location of the main file. + </para> + </section> <section id="Tex_RememberCiteSearch"> <title>g:Tex_RememberCiteSearch</title> |
From: <sri...@us...> - 2005-12-22 21:27:28
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25231 Modified Files: main.vim texviewer.vim Log Message: New: A setting Tex_ProjectSourceFiles which if set is used as a list of all the latex source files for the project. If set, we will never try to use logic to find the list of files included in the project, but simply use this setting. This significantly reduces the time required to build up the completion list for \ref completion for large projects. Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** main.vim 8 Dec 2005 22:51:29 -0000 1.84 --- main.vim 22 Dec 2005 21:27:20 -0000 1.85 *************** *** 455,458 **** --- 455,459 ---- " " Description: function! Tex_ChooseFromPrompt(dialog, list, sep) + let g:Tex_ASDF = a:dialog let inp = input(a:dialog) if inp =~ '\d\+' *************** *** 636,640 **** " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.6.19" endfunction --- 637,641 ---- " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.7.01" endfunction Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/texviewer.vim,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** texviewer.vim 26 Nov 2005 23:38:50 -0000 1.10 --- texviewer.vim 22 Dec 2005 21:27:20 -0000 1.11 *************** *** 79,82 **** --- 79,86 ---- call Tex_Debug("Tex_Complete: silent! grep! ".Tex_EscapeForGrep('\\label{'.s:prefix)." *.tex", 'view') call Tex_Grep('\\label{'.s:prefix, '*.tex') + elseif Tex_GetVarValue('Tex_ProjectSourceFiles') != '' + call Tex_Debug('Tex_Complete: searching for \\labels in all Tex_ProjectSourceFiles', 'view') + call Tex_CD(Tex_GetMainFileName(':p:h')) + call Tex_Grep('\\label{'.s:prefix, Tex_GetVarValue('Tex_ProjectSourceFiles')) else call Tex_Debug("Tex_Complete: calling Tex_GrepHelper", "view") |
From: <sri...@us...> - 2005-12-08 22:51:40
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19468/packages Modified Files: url Log Message: Bug: When you include the url package using <F5>, then all syntax highlighting after the \url{} command is screwed up. Why: packages/url contains a nasty definition of the url syntax item. I beleive it was copied straight from the definition of the \verb|| command, but thats not how \url{} is defined. Moreover, the syn command is not run at the correct time (when syntax is being loaded). Fix: For now, just comment out both the syn lines till a more robust solution is found. Index: url =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/url,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** url 28 Sep 2003 22:52:37 -0000 1.2 --- url 8 Dec 2005 22:51:29 -0000 1.3 *************** *** 16,21 **** \.'bra:urldef' ! syn region texZone start="\\url\z([^ \ta-zA-Z]\)" end="\z1\|%stopzone\>" ! syn region texZone start="\\path\z([^ \ta-zA-Z]\)" end="\z1\|%stopzone\>" " vim:ft=vim:ff=unix: --- 16,24 ---- \.'bra:urldef' ! " TODO uncomment if you figure out ! " 1. how to get this syn command to work every time instead of only the ! " first time this file is sourced. ! " syn region texZone start="\\url{" end="}\|%stopzone\>" ! " syn region texZone start="\\path{" end="}\|%stopzone\>" " vim:ft=vim:ff=unix: |
From: <sri...@us...> - 2005-12-08 22:51:37
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19468 Modified Files: main.vim Log Message: Bug: When you include the url package using <F5>, then all syntax highlighting after the \url{} command is screwed up. Why: packages/url contains a nasty definition of the url syntax item. I beleive it was copied straight from the definition of the \verb|| command, but thats not how \url{} is defined. Moreover, the syn command is not run at the correct time (when syntax is being loaded). Fix: For now, just comment out both the syn lines till a more robust solution is found. Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** main.vim 27 Nov 2005 01:20:56 -0000 1.83 --- main.vim 8 Dec 2005 22:51:29 -0000 1.84 *************** *** 636,640 **** " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.6.18" endfunction --- 636,640 ---- " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.6.19" endfunction |
From: <sri...@us...> - 2005-11-27 01:21:06
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9328 Modified Files: main.vim wizardfuncs.vim Log Message: Bug: latex-suite maps <F1> without giving the user any option to disable it. (martin f krafft) Why: wizardfuncs.vim contains the erroneous mapping without doing a hasmapto() check. Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** main.vim 26 Nov 2005 23:38:50 -0000 1.82 --- main.vim 27 Nov 2005 01:20:56 -0000 1.83 *************** *** 636,640 **** " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.6.17" endfunction --- 636,640 ---- " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.6.18" endfunction Index: wizardfuncs.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/wizardfuncs.vim,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** wizardfuncs.vim 23 Oct 2003 01:52:20 -0000 1.20 --- wizardfuncs.vim 27 Nov 2005 01:20:56 -0000 1.21 *************** *** 206,212 **** " ============================================================================== ! inoremap <buffer> <silent> <F1> <C-O>:call <SID>TexHelp()<CR> ! nnoremap <buffer> <silent> <F1> :call <SID>TexHelp()<CR> command! -nargs=0 THelp call <SID>TexHelp() " TexHelp: Cursor being on LaTeX item check if exists help tag about it " {{{ --- 206,214 ---- " ============================================================================== ! inoremap <silent> <Plug>Tex_Help <C-o>:call <SID>TexHelp()<CR> ! nnoremap <silent> <Plug>Tex_Help :call <SID>TexHelp()<CR> command! -nargs=0 THelp call <SID>TexHelp() + call Tex_MakeMap('<F1>', '<Plug>Tex_Help', 'i', '') + call Tex_MakeMap('<F1>', '<Plug>Tex_Help', 'n', '') " TexHelp: Cursor being on LaTeX item check if exists help tag about it " {{{ |
From: <sri...@us...> - 2005-11-26 23:38:58
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19533 Modified Files: main.vim texviewer.vim Log Message: New: Treat \nobibliography exactly the same as \bibliography (suggested by Ryan Long). Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** main.vim 19 Nov 2005 22:35:47 -0000 1.81 --- main.vim 26 Nov 2005 23:38:50 -0000 1.82 *************** *** 636,640 **** " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.6.16" endfunction --- 636,640 ---- " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.6.17" endfunction Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/texviewer.vim,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** texviewer.vim 25 Sep 2005 09:32:28 -0000 1.9 --- texviewer.vim 26 Nov 2005 23:38:50 -0000 1.10 *************** *** 510,514 **** " assume that this is the only file in the project which defines a " bibliography. ! if search('\\bibliography{', 'w') call Tex_Debug('Tex_ScanFileForCite: found bibliography command in '.bufname('%'), 'view') " convey that we have found a bibliography command. we do not need to --- 510,514 ---- " assume that this is the only file in the project which defines a " bibliography. ! if search('\\\(no\)\?bibliography{', 'w') call Tex_Debug('Tex_ScanFileForCite: found bibliography command in '.bufname('%'), 'view') " convey that we have found a bibliography command. we do not need to *************** *** 517,521 **** " extract the bibliography filenames from the command. ! let bibnames = matchstr(getline('.'), '\\bibliography{\zs.\{-}\ze}') let bibnames = substitute(bibnames, '\s', '', 'g') --- 517,521 ---- " extract the bibliography filenames from the command. ! let bibnames = matchstr(getline('.'), '\\\(no\)\?bibliography{\zs.\{-}\ze}') let bibnames = substitute(bibnames, '\s', '', 'g') |