Coder Social home page Coder Social logo

lervag / vimtex Goto Github PK

View Code? Open in Web Editor NEW
5.2K 36.0 386.0 11.49 MB

VimTeX: A modern Vim and neovim filetype plugin for LaTeX files.

License: MIT License

TeX 71.10% Python 0.14% Makefile 0.42% Perl 0.03% Dockerfile 0.03% Vim Script 28.08% Lua 0.21%
vim vim-plugin vimtex latex tex filetype-plugin neovim

vimtex's People

Contributors

144026 avatar 927589452 avatar andymass avatar bertrandsim avatar doronbehar avatar greencourt avatar j1-lee avatar jingmatrix avatar jipolanco avatar kiryph avatar konfekt avatar krishnakumarg1984 avatar languitar avatar lervag avatar manu-mannattil avatar marcelrobitaille avatar matze-dd avatar mbrunnen avatar micbou avatar patnr avatar psvenk avatar rsekman avatar shuber2 avatar tom-anders avatar tornaria avatar tornaxo7 avatar tpmkranz avatar vyasr avatar yongrenjie avatar znculee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vimtex's Issues

pid error

The docs state that

... the entry pid is only available if vim-latex-latexmk is enabled g:latex_latexmk_enabled.

I don't use latexmk so in my vimrc I set

let g:latex_latexmk_enabled = 0

However if I then run :echo latex#info() I get the following error

Error detected while processing function latex#info:
line   20:
E716: Key not present in Dictionary: pid
E15: Invalid expression: d.pid

Is it possible to suppress that error when g:latex_latexmk_enabled is set to 0?

TOC window: Does not show all sections if some are folded in the tex file.

Ok, this is rather cosmetical, and somewhat fuzzy but I created a MWE where it should be reproducable. I should say that I couldn't reproduce it in gvim, but only vim.

Here it goes:

\documentclass{scrartcl}
\begin{document}
 \tableofcontents

  \section{Section in the main file}
  \subsection{Subsection in the main file}

 \section{Second section in main file}
 \subsection{Second subsection in main file}

  \section{Third section in main file}
  \subsection{Third subsection in main file}
\end{document}

These are my settings for vim-latex:

  let g:latex_complete_close_braces = 1
  let g:latex_latexmk_quickfix = 1
  let g:latex_latexmk_options = '-xelatex'
  let g:latex_toc_enabled = 1
  let g:latex_toc_hide_help = 1

Now: If I press \lt (after having compiled the document once), the TOC window pops up without help. But: Some of the last lines where the corresponding entries (Third section and subsection) should be are not legible but have the same color as folded lines and ------------------------------ as text. If I navigate down on them, i.e. move the cursor to them, they suddenly change bg color and become legible.

This only happens if I have one or all sections or subsections in the main file still folded. If the first or all of them are unfolded, this does not happen.

Here's a screen shot:
2013-11-29-130756_636x147_scrot

I tried to :redraw! or <C-L> but nothing of it worked…

I had to update the issue since my TOC was still corresponding to an older version of the MWE (\ll did not actually start up latexmk, but that's a separate issue again), but now it should be all right.

Better documentation about latexmk

I should add some more documentation with tips and tricks about how to set up vim-latex with latexmk in a best possible manner. In particular, I should explain how to make latexmk use the vimserver to open the errorwindow when there are errors.

Error when opening input file

Hi,

I have the following file structure.

|--main.tex
|--sections
   |-- some_file.tex

I input some_file.tex in main.tex. When I open some_file.tex for editing, I get the following error:

Error detected while processing function latex#init..<SNR>130_init_environment..<SNR>130_get_main..<SNR>130_get_main_recurse:
line   25:
E118: Too many arguments for function: globpath
E15: Invalid expression: globpath(l:dirs, '*.tex', 0, 1)
line   30:
E121: Undefined variable: l:candidates
E15: Invalid expression: l:candidates

Any Idea what's going on?

Main tex file not found

The current method of finding the main tex file in projects with several tex files is not fool proof. At the moment, the plugin first checks whether the current tex file has the following code:

\begin{document}

If not, then it looks for all tex files in the current and the parent directory, then it checks if any of these has a file name that appears in the list g:latex_main_tex_filenames. If found, the first file that meets this criteria is chosen. If no such file is found, then the current file is accepted. This is as explained in the documentation.

A better way to do this would be to instead recursively search the current directory (and perhaps also the parent directory) for any files that has the current file included, and to select the main tex file that has the \begin{document} code.

Edit: Refined the description.

ViewRules seemingly ignored on Mac OS 10.9.5

Despite having the following settings in my .vimrc, it seems that they are all ignored — when using \ll, the output format remains PDF, and the generated PDFs always open in whatever program is the default for PDFs at the time (changing the default program before compiling confirms this). I have also confirmed via :echo that these variables really are set in Vim. Why aren't these being used when \ll is invoked?

    let g:tex_flavor='latex'
    let g:Tex_DefaultTargetFormat='dvi'
    let g:Tex_ViewRule_dvi='/Applications/TeXShop.app/Contents/MacOS/TeXShop *$.dvi'
    let g:Tex_ViewRule_pdf='/Applications/TeXShop.app/Contents/MacOS/TeXShop *$.pdf'
    let g:Tex_ViewRule_ps='/Applications/TeXShop.app/Contents/MacOS/TeXShop *$.ps'

<m-i> conflict with the "é" character

Hi,

Thanks for your work !

The mapping used to insert "\item" is in conflict with the "é" letter, at least for the french language. That is pressing "é" gives me "\item" instead of the letter itself.
As is probably here to stay, maybe it can be guarded behind a new option. Or the doc may gives an easy way to cancel that mapping, without disabling everything.

Sincerely,
Matth

Language specific toc

The new TOC file is really great. The only thing that I miss about the implementation that used the aux files is that it detected the document language settings. This means that if one had a document like

\documentclass{article}
\usepackage[spanish]{babel}
\usepackage[backend=biber]{biblatex}
\addbibresource{biblatex-examples.bib}

\begin{document}
\section{Spanish document}
\label{sec:spanish_document}
This is document will be written in spanish.
\nocite{shore}
\printbibliography
\end{document}

The TOC entry for the bibliography was correctly rendered as "Referencias" (spanish word for references).

With the current implementation the bibliography (and the Alphabetical Index) are shown in the TOC in english regardless of the document language (see image below).

I understand that this might be hard to implement. I believe that one way this could be achieved would be to parse the preamble looking for options to the babel package:

\usepackage[babel options]{babel}

If a language other than english is found in these options then the Bibliography and Alphabetical Index title should be given in that specific language. If no other language was found or babel was not found then default to english.

btw: If this ever gets implemented it would also be good that in article class the bibliography title would be "References" instead of "Bibliography" (and keep "Bibliography" only for the book class).

screenshot 157

Toc numbering of subsections in book class

Consider the following MWE

\documentclass{book}
\begin{document}
\chapter{Foo-bar-baz}
\section{Foo}
\subsection{Bar}
\subsubsection{Baz}
\end{document}

Latex doesn't number \subsubsection(s) in the book class (this can be seen in the PDF image). However vim-latex's TOC shows numbered subsubsections.

screenshot 159

Question regarding latexmk and g:latex_build_dir

I have a LaTeX repository organized as follow:

proj (root)
  |---> src (*.tex, *.bib)
  |---> images
  |---> build (compilation/auxiliary files, resulting PDFs)

So if we consider src/example.tex, I would like the data dictionary to contain something like:

name: example
base: example.tex
root: proj
tex: proj/src/example.tex

I thought that the g:latex_build_dir option would allow me to achieve something closer to what I want, but apparently this option is not forwarded to latexmk with the -outdir option.

Adding the following line to latexmk_set_cmd seems to be partially working:

let cmd .= ' -outdir=' . g:latex_build_dir

The build directory is created in root, but root is currently proj/src, not proj, so that still needs to be resolved.

Can you confirm that I am on the right track, or enlighten me if this can already be achieved with the current code? Thanks! ;-)

Disable indentation problem

Consider the following minimal vimrc

set nocompatible
let $ONEDRIVE_HOME = expand('C:/OD/Users/Pedro/')
let $DOTVIM = expand('$ONEDRIVE_HOME/vimfiles')
set runtimepath=$DOTVIM,$VIMRUNTIME,$DOTVIM/after/

if has('vim_starting')
    execute 'set runtimepath+=' . expand('$DOTVIM/bundle/neobundle')
endif
call neobundle#begin(expand('$DOTVIM/bundle/'))
NeoBundle 'lervag/vim-latex', {'name' : 'vim-latex' }
NeoBundleFetch 'Shougo/neobundle.vim', {'name' : 'neobundle'}
call neobundle#end()

filetype plugin indent on

let g:tex_flavor = 'latex'
let g:tex_indent_brace = 0
let g:latex_indent_enabled = 0

and in a tex file type { in a new line and then press <CR>. The resulting line will be indented (i.e that g:tex_indent_brace variable is ignored) . On the other hand if I remove vim-latex plugin by erasing this line from the minimal vimrc:

 NeoBundle 'lervag/vim-latex', {'name' : 'vim-latex' }

then braces are not indented as expected (i.e g:tex_indent_brace is active).

Maybe this is related to the runtimepath explanation you gave me here.

However neobundle docs state:

... set up a path to the repository directory.
set runtimepath+={path to neobundle directory}

If you believe this to be a problem in Neobundle I''ll report it to Shougo.

Some problems with the TOC

Great work on the new toc that doesn't need aux files! There are a few thing I noticed:

i) Consider the case where without generating aux files one has a_main_file.tex:

\documentclass{book}
\begin{document}
  \include{bar}
  \include{foo}
\end{document}

where bar.tex is

\section{Bar section}
\label{sec:bar_section}

and foo.tex is

\section{Foo section}
\label{sec:foo_section}

If for instance I call latex#toc#toggle() on either bar.tex or foo.tex the TOC only shows the sections corresponding to each file and not both of them (maybe this is related to #16)

ii) the first time I call latex#toc#toggle() from the main file it complains that it cannot read the included files like this

Error in latex#toc s:parse_files:
File not readable: ..../foo.tex

but when called again it works

iii) if in the preamble I have some command that uses \section{#1} like:

\newcommand*{\secappendix}[1]{%
  \setcounter{section}{0}%
  \renewcommand*{\thesection}{\appendixname\space\thechapter.\Alph{section}}%
  \renewcommand*{\theHsection}{\thechapter.\Alph{section}}%
  \section{#1}\renewcommand*{\thesection}{\thechapter.\Alph{section}}%
}

it shows in the TOC as a new section. Section commands in the preamble should be ignored.

iv) When I open the TOC I want focus to be in the TOC buffer (i.e place cursor there). Is there a way to achieve that?

Run bibtex in the background

Mmm I think a recent change (I'm not quite sure which) makes bibtex run in the foreground (or at least not "silently"). Consider the following MWE

\documentclass{article}
\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}

\begin{document}

\end{document}

Previously, when typing \textcite{, bibtex would run in the background and then automatically show the results in the popup menu. Now (as it can be seen in the image) one has to press a key to close the cmd.exe and return to vim.

I don't know if this has something to do with my own settings. If you cannot reproduce it I'll write a minimal vimrc. Thanks!

untitled

Window resize when opening toc

When I open the TOC, GUI Vim window gets resized (as seen in the images). This doesn't happen with Latex-Box (the plugin that I'm migrating from).

screenshot 153
screenshot 154

Open folds from TOC

If a document is folded, and one selects an entry in the TOC then the cursor jumps to the corresponding entry in the document but it doesn't unfold the entry if it is folded. In the first image below I select a subsubsection, in the second image the cursor jumps to the document without unfolding and only If I manually unfold (third image) I reach the desired section.

This is similar to this issue in Latex-Box

screenshot-03-08-2014_19-46-19
screenshot-03-08-2014_19-46-24
screenshot-03-08-2014_19-46-34

Focus on TOC

When calling latex#toc#toggle() from a buffer, focus (cursor) stays in that buffer. Is it possible to switch focus to the TOC? Thanks!

add optional viewer arguments

Hello,

Being able to pass arguments to the VimLatexView Command allows for forward search (by SumatraPDF say) and is all that vim-latex is missing in comparison to Latex-Box.

Since this extra option doesn't do any harm (no exisiting setup has to be changed), why not adding it to vim-latex too?

Unable to run on OS X

I found this plugin while tinkering with LaTeX-Box and I like where you're going with it. However, I am not able to get it up and running. Do you know of any issues with OS X in particular or how I may debug it effectively (not very familiar with VIM-plugin dev)?

When running \ll or call g:latex#latexmk#compile() it spits out started latexmk successfully, but nothing is produced. When successively running \lg it replies latexmk is not running.

I've tried invoking latexmk directly from the command line, using the the command string produced by the plugin (got it from \li) and it works just as expected.

For now, I'll stick with LaTeX-Box, but if you've any suggestion as how to get it spinning or how to determine what's going underneath, I'd be thankful.

Cheers, Oskar

Implement LatexLabels functionality

LaTeX-Box has a nice feature implemented as the :LatexLabels command, which essentially gives a ToC window with a list of labels that match a provided regexp.

I think a nice way to implement this is to add the labels directly to the ToC, and to add a simple filter function in the ToC window mapped to f. Another idea might be to somehow interface the ToC to CtrlP to get a nice fuzzy filtering of ToC contents.

Unfortunately, I don't have time to do this now, so I open this issue in order to mention the ideas for future implementation.

Add alphabetical index to TOC

Maybe it is possible to add "Alphabetical Index" to the TOC. The command that prints this index at the end of a book (in the \backmatter and after the bibliography) is \printindex[optional argument]

inner environment begin pattern

Hello,

 let begin_pat = '\C\\begin\_\s*{[^}]*}\|\\\@<!\\\[\|\\\@<!\\('

does not account for text afterwards. For example , if there is label{..} after
begin{..}, then

vmap <buffer> ie <Plug>LatexBox_SelectCurrentEnvInner

(by the way should be xmap) erroneously assumes the opening \begin{..} line to belong to the inner environment.

How about allowing for this possibility?

Implement `LatexCloseCurEnv` (from LaTeX-Box)

Hey, this is more of a feature/discussion request than an issue really, but I'd like to hear your thoughts on that:

Latex-Box has a function called LatexCloseCurEnv that closes the last opened environment in a tex document.

Granted, when using snippets it rarely occurs that you open an environment without adding the \end{env} tag below, so maybe this is not as important a feature to be had, but I'd like to know how others deal with this?

Is there any of the big completion thingys (YCM, necomplete) that can do this?

vim-latex not loading mappings with new vundle?

Hello,

I just wanted to ask here first because I'm not yet sure whether this is a vundle or a vim-latex issue.

Since I upgraded to most recent vundle (526d390854f14bc5886ca0606b3be51f7379eacb) and did the interface change, vim-latex doesn't seem to be loaded when I open a tex file in vim or gvim.

It seems related to issue 430 of vundle. However, when I execute :scriptnames from the tex file, vim-latex is in the list:

 47: ~/.dotfiles/vim/bundle/vim-latex/ftplugin/tex.vim
 49: ~/.dotfiles/vim/bundle/vim-latex/indent/tex.vim
 52: ~/.dotfiles/vim/bundle/vim-latex/after/syntax/tex.vim: 

Yet, when I want to use \ll, I navigate up (due to my custom mappings) or with \li I get into insert mode. And that the mappings of a plugin weren't loaded, was peculiarly enough described by raghur here as well.

Can anyone else observe this behaviour?

Indenting on `$` and `$$`

As far as I can tell, the indent/tex.vim files adds indent when (simple) equations are opened with \) and \], but not with $ and $$. Is this intended? If not, it would be most appreciated if it were fixed. Thanks a lot for this plugin, it really is amazing, and works surprisingly well on MS Windows.

Add parent folder to parent folder of current file when searching for main file

The function to detect the main file

assumes that the main tex file lives in the same folder or the parent folder of the current file.

Consider a setting where the main file lives in directory and chapter files live in directory/chapters/chapter1/chapter1.tex, directory/chapters/chapter2/chapter2.tex and so on.
It is possible to add to the search a parent folder to the parent folder of the current file?

I think that something like this will do?

 let l:glob3 = expand('%:p:h:h:h') . '/*.tex'

Thanks!

TOC: Selecting a \(sub|subsub)section does not jump to the respective section but produces errors

Hey,

the TOC feature itself works quite well, however,it's impossible to select any section and jump to it (whether it is in the main or input file doesn't matter) by pressing <Enter>. This happens both in gvim and vim.

Here's a MWE:

main.tex

\documentclass{scrartcl}
\begin{document}
 \tableofcontents
  \section{Section in the main file}
  \subsection{Subsection in the main file}
 \input{input}
\end{document}

input.tex

%!Tex Root = main.tex
 \section{Section in the input file}
  This is the file that is being input via \\input
 \subsection{Subsection in the input file}

And here's the errors that I get when I want to switch to input.tex. If I want to switch to a section in main.tex the errors are a bit shorter, but I can't copy them.

Error detected while processing function <SNR>52_toc_activate:
line    3:
E121: Undefined variable: b:toc
E116: Invalid arguments for function len(b:toc)
E15: Invalid expression: n >= len(b:toc)
line    7:
E121: Undefined variable: b:toc
E15: Invalid expression: b:toc[n]
line    9:
E121: Undefined variable: entry
E116: Invalid arguments for function s:toc_escape_title(entry['text'])
E15: Invalid expression: s:toc_escape_title(entry['text'])
line   13:
E121: Undefined variable: entry
E15: Invalid expression: entry['level'].titlestr
line   16:
E121: Undefined variable: b:toc
E15: Invalid expression: b:toc[i]['level'].s:toc_escape_title(b:toc[i]['text'])
line   17:
E121: Undefined variable: i_hash
E15: Invalid expression: i_hash == entry_hash
line   25:
E121: Undefined variable: b:calling_win
E15: Invalid expression: b:calling_win . 'wincmd w'
line   27:
E121: Undefined variable: entry
E15: Invalid expression: [entry['file']]
line   28:
E121: Undefined variable: entry
E116: Invalid arguments for function readfile(entry['file']), 'v:val =~ ''\\input{''')
E116: Invalid arguments for function filter(readfile(entry['file']), 'v:val =~ ''\\input{''')
E15: Invalid expression: filter(readfile(entry['file']), 'v:val =~ ''\\input{''')
line   33:
E121: Undefined variable: entry
E116: Invalid arguments for function <SNR>52_toc_find_match

My vim-latex settings are as follows:

" Settings for vim-latex
  let g:latex_complete_close_braces = 1
  let g:latex_latexmk_quickfix = 1
  let g:latex_latexmk_options = '-xelatex'
  let g:latex_toc_enabled = 1
  let g:latex_toc_hide_help = 1

Am I missing some setting here or is the function broken and you know it already? This is by no means to put any pressure, I'm almost not using this feature, I just noticed it doesn't work here so wanted to let you know :)

Respect tex root specifier

The current generic method (see #3) of locating the main tex file seems good, and would probably work in most cases. However, it is easy to give examples where it would not work (again, see #3). Therefore it has been proposed (#3) to also allow the main tex file to be specified with %! Tex Root = <main-tex-file>.

Get main file function

I'm trying to switch from Latex-Box to vim-latex. I use this function several times in a script I wrote in order to get the main file. Is there a similar function to specify the main file in vim-latex?
In general, how does vim-latex find the main file?
Thank you!

Use conceal in TOC

Add option to use conceal to show greek letters and math as unicode symbols in TOC.

Continuous Build Toggle

Perhaps I missed it, but how about a toggle for the continuous build command? That is, stop if running, run if stopped.

Thanks for this great plugin.

Implement function that turns current word into command

I want to be able to do something like:

\section{Some section}
Some sentence with some text with a ref<F7>

where <F7> implies that I type the function key, in which case the above becomes

\section{Some section}
Some sentence with some text with a \ref{

Possibly also with a closing paranthesis.

Preamble isn't folded, although `let g:latex_fold_preamble = 1` is set

Heya,

time for my next term paper (there's actually 2 to come), so I was undusting vim-latex again and seem to have found a smaller annoyance here:

When I open a normal tex file, everything is folded except for the preamble. However, if the cursor is somewhere in the preamble and I hit za, it gets folded. So it seems the preamble is still properly detected, it's just automtic folding that doesn't happen.

This is my vim-latex config:

" Settings for vim-latex
  let g:latex_complete_close_braces = 1
  let g:latex_quickfix_mode = 0
  let g:latex_quickfix_open_on_warning = 0
  let g:latex_fold_preamble = 1

Hope we can find the source of this :)

Make init_errorformat() global function

Is it possible to make the s:init_errorformat() a global function? I like to use vim-latex's error format in a script and in order to do so I have to either run latex#init() (which is a global function) or copy the s:init_errorformat() function to my script.

If this is not possible, if there is another way of calling the init_function from outside the script, or if this breaks some behavior just ignore this request and close the issue.
Thank you!

Better documentation that explains ignored warnings

I don't understand what to put in the g:latex_ignored_warnings variable. Are the contained strings regexes or the full warning message? Regardless of what I tried, the warnings were not ignored. Explaining this would be very helpful.

I looked up the behavior in the code. Unfortunately, I don't understand vimscript, so this line is a mysterium for me (source):

exe 'setlocal efm+=%-G%.%#'. warning .'%.%#'

Is it possible to get correct line numbers in the errors when using \include?

I am compiling a document that uses \include to bring in other sections. After a compile, the errors in the quickfix all have the main tex file as their filename and have line numbers as if the the project was one big file with each file pasted in.

Is it possible to get the quickfix list to report line numbers and filenames that represent the actual file structure of the project?

Freezing when exiting insert mode in large files.

This is something I've noticed recently, if I edit a large latex file (several hundred lines, with no wrapping, so lines can be very long) I see a delay of 1-3s when exiting insert mode. CPU usage for gvim hits 50% (I'm using a dual-core) during this time.

Disabling folding and syntax highlighting doesn't change things. If I disable the plugin and edit the file using vim's default latex support it is instant again.

I see a similar delay when opening a large file for the first time - again, default vim works fine.

Here is the result of :au InsertLeave:

--- Auto-Commands ---
Undotree  InsertLeave
    *         call UndotreeUpdate()
unimpaired_paste  InsertLeave
    *         if exists('s:paste') |   let &paste = s:paste |   let &mouse = s:mouse |   unlet s:paste |   unlet s:mouse | endif
latex_fold  InsertLeave
    *.tex     call FdmRestore()

FdmRestore() just seems to track folding methods so I don't think this would be the problem.

It seems like some sort of processing of text that vim-latex is doing, for folding maybe? I do not even needed to make any changes, entering and immediately exiting insert mode will trigger a delay.

windows support

Ok, so I am curious what is missing from the Windows support in vim-latex that latex-box has implemented.

As an independent suggestion: you provide a function, say *@:call latex#view() and a mapping to invoke it. How about a commands, say LatexView, so that the user can set up a command line alias such as Lv (by cnoreabbrev H <c-r>=getcmdpos() == 1 && getcmdtype() == ":" ? "LatexView" : "Lv"<CR>) instead of having to create another mapping.

And regarding a structuring, how about a wrapper function for executing commands by a bang, that is,

Bang(cmd)
 if iswin
  execute '!start /b '.a:cmd.'> nul' ...
 else
  ... > dev/null'
 endif
return

SuperTab Chaining Completion Does not Initially Work with vim-latex

Thank you for developing vim-latex. I really like it so far!

When I was previously using Latex-Box, I used the following code in my .vimrc file to enable two types of completion: (1) the standard "next" completion that uses my dictionary and the current buffer to complete words and (2) Latex-Box for items in the bibliography and other labels in the paper.

autocmd FileType tex
            \ if &omnifunc != '' |
            \   call SuperTabChain(&omnifunc, "<c-n>") |
            \   call SuperTabSetDefaultCompletionType("<c-x><c-u>") |
            \ endif

However, using this "chaining" feature of SuperTab does not seem to work with vim-latex when I type a word llike "exam" and then type "tab".

Interestingly, it does work correctly if I directly type "ctrl-n" to do the completion.

Also, if I first use vim-latex to do tab completion of a \cite or a \ref -- which works correctly and is faster than Latex-Box -- then the tab completion of words will work correctly from that point forward. This means that "exam" would now display a box for words like "example" and "examination".

Did I configure something incorrectly? Any advice that you can provide is appreciated!

Ignore section command in preamble in the TOC

Consider the following MWE

\documentclass{article}
\begin{document}
\newcommand*{\secappendix}[1]{%
  \section{#1}}%
\section{Foo}
\label{sec:foo}
\end{document}

\section{#1} in the definition of secappendix command is shown in the TOC as another ordinary section. Section commands in the preamble should be ignored.

Complete bibliography completion not working anymore

Not much going on in the office today, so I've got the time to deal with the issues I had with vim-latex lately.

Scenario: I want to complete a bibtex key by pressing <C-x-C-O>, but I get Pattern not found as a red error below vim's status bar.

Here's a MWE.

  1. Run latex on it once in order to get \jobname.bib created.
  2. Open the tex file, remove the % sign in line 17 (or 18, alternatively).
  3. Move cursor to je.
  4. Press <C-X-C-O>
  5. Get error message Pattern not found instead of completion to jeuk10.
\documentclass{scrartcl}
\usepackage{filecontents}
\usepackage[bibencoding=utf8,backend=biber]{biblatex}
   \addbibresource{\jobname.bib}
\begin{document}

\begin{filecontents}{\jobname.bib}
@Book{jeuk10,
  Title                    = {Deutsch als Zweitsprache in der Schule: Grundlagen - Diagnose - Foerderung},
  Author                   = {Stefan Jeuk},
  Year                     = {2010},
  Location                 = {Stuttgart},
  Publisher                = {Kohlhammer}
}
\end{filecontents}
Word
%\autocite[]{je
%\autocite[1]{je

\end{document}

This one is also quite strange, especially as I can't exactly say when it stopped working. I went back in the git repo until master25 (a661d86), but all the way I could still not complete the citation key. If trying to use it while master20 (587f560) is checked out, I get errors, but other than that all the time the same "pattern not found".

Note: I don't use any completion mechanism such as YCM or neocomplete. This also happens if I use a minimal vimrc

Bibliography and Alphabetical Index rendering in TOC

Consider the following MWE:

\documentclass{book}
\begin{document}
\frontmatter
  \tableofcontents
  \chapter{Preface}
\mainmatter
  \chapter{First chapter}
  \chapter{Second chapter}
  \chapter{Third chapter}
\backmatter
  \printbibliography
  \printindex
\end{document}

The \printbibliography and \printindex commands will respectively generate a bibliography and an alphabetical index that generally refers to the whole document and not just to the last chapter (Third Chapter in the example). However with the current TOC the "Bibliography" and "Alphabetical Index" are shown as a part or subset of the last chapter (and hence folded within it). I think they should be shown as independent entries (the same way that the "Preamble" and "Table of Contents" are shown)

screenshot-19-07-2014_13-51-53
screenshot-19-07-2014_13-51-58

`latex#latexmk#errors()` doesn't work if `g:latex_latexmk_quickfix` is set to 0

Heyho,

it seems that since a few commits ago, I can't qet the quickfix window to open by using <localleader>le (in my case \le).

Strangely, it sometimes seems to not work as long as I have g:latex_latexmk_quickfix = 0 in my config, and then changing its value to 1 or 2 does the trick. But not always, it seems.

Pressing \le (with quickfix set to 0) doesn't do anything while vim-latex throws this error if I do :execute latex#latexmk#errors():
quickfix

I also tried with a mini vimrc, but I get the same error.

As far as I understand the documentation this should not be the case but is rather a bug, isn't it?

Bib completion problem

Mmmm for some reason the bib completion sometimes fails if the current directory is not that of the working file. Maybe the cd part of the command doesn't work (at least on windows):

let cmd = 'cd ' . g:latex#data[b:latex.id].root . ' & ' . cmd

If I have a file in C:/Users/Pedro/Desktop/foo.tex like

\documentclass{article}
\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}

\end{document}

and I do cd C:/OD/Users/Pedro/vimfiles/bundle/vim-latex/autoload/latex/ and then type \cite{ then vim complains:

Error detected while processing function  latex#complete#omnifunc..latex#complete#bibtex..<SNR>176_bibtex_search:
line   33:
E484: Can't open file tmpfile.bbl

If from foo.tex I now run :lcd %:h, then bib completion works fine.
I''ll try to have a look at this problem when I have some spare time (but if you can fix it in the meantime that would be great).

Issue with compiling on Windows 7

I may be trying this out prematurely, but this plugin seems to have Windows support so here goes...

After loading a latex file the autoload scripts seem to run correctly - I have folding and keymappings. However, if I :call latex#info() I see that the pid for g:latex#data is zero. Should this hold the value of a pid of a running background service?

Compiling fails with following output:

Error detected while processing function latex#latexmk#compile..<SNR>69_latexmk_set_pid:
line    8:
E684: list index out of range: 0
E116: Invalid arguments for function strpart(pids[0], 10)
E15: Invalid expression: strpart(pids[0], 10)
latexmk started successfully

I have had a quick look through the code and the only thing that strikes me as suspicious is the use of Windows find.exe, as I also have a port of GNU find installed. I replaced find with \%WINDIR\%\System32\find to ensure the correct version was used but this didn't fix anything.

Edit: Updated formatting.

Toc numbering with frontmatter and backmatter

The commands \frontmatter and \backmatter turn off chapter numbering (while \mainmatter turns them on). With the current toc if one has a main_file.tex like this:

\documentclass{book}
\begin{document}
\frontmatter
  \include{preface}
\mainmatter
  \include{foo}
\backmatter
  \printbibliography[]
\end{document}

where preface.tex is

\chapter{Preface}
\label{cha:preface}

and foo.tex is

\chapter{Foo}
\label{cha:foo}

The toc will number the unnumbered preface chapter as the first chapter and will add the bibliography inside the (wrongly) numbered foo chapter. Maybe it is possible to parse the main file for the commands \frontmatter, \mainmatter and \backmatter, and if they are present, number the toc accordingly.

screenshot-17-07-2014_11-25-15

Hide preamble in TOC

I understand that the TOC is just a means of navigation so it might be useful to have an entry for the "Preamble". Personally I like the TOC to reflect what eventually gets printed. So, is it possible to add a variable that controls whether the preamble is shown or hidden in the TOC? Something similar to g:latex_toc_hide_preamble?.
Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.