Updating my (Xe)LaTeX vim plugin · Test Web Page

Updating my (Xe)LaTeX vim plugin

After some years, it was time to update my LaTeX vim plugins.

My setting was: plain vim, a makefile, some configuration lines. Back-forward search, not much completion.

Now, with the vundle plugin.

Things to do: I had vundle installed already. I needed to add lervag’s vimtex and ajh17’s VimCompletesMe.

Hence, in .vimrc:

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#rc()

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

Plugin 'lervag/vimtex'
let g:vimtex_view_general_viewer='okular'
" 'skim' for Mac OSX instead.
" let g:Tex_ViewRule_pdf = 'Skim'
" also: forward search
" map ,p :w<CR>:silent !/Applications/Skim.app/Contents/SharedSupport/displayline
" on Windows Linux (WSL) 'zathura'
let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex'
let g:vimtex_view_general_options_latexmk = '--unique'
" let g:vimtex_echo_ignore_wait = 1
" let g:vimtex_quickfix_latexlog = {'default' : 0}
let g:vimtex_quickfix_open_on_warning = 0

Plugin 'ajh17/VimCompletesMe'
augroup VimCompletesMeTex
   autocmd!
   autocmd FileType tex
       \ let b:vcm_omni_pattern = g:vimtex#re#neocomplete
augroup END
" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required

Remember :PluginInstall after adding these lines.

Commands to remember:

\ll       => Start/stop continuous compiling
\lv       => Forward search in the PDF
\le       => Parse the log file.
\lc | \lC => clean .aux files (or also .pdf file)
[TAB]     => AutoCompletion

At the first lines of the master .TEX file the line:

%! TEX program = xelatex

Then okular should have the inverse/backward search enabled with the Custom Text Editor as one of the two lines:

gvim --remote-silent +%l "%f"
gvim --servername GVIM --remote +%l %f

Further Help.

Spell check

map <C-s> : set spl=it spell
setlocal spell spelllang=it_it
set spell spelllang=en_us

Multi-file

As with the documentation in :h vimtex-multi-file, either add the root line in all subfiles

%! TEX root = /path/to/my-main.tex

or use the .latexmain specifier:

touch main.tex.latexmain

Color scheme and font

if has('gui_running')
 colorscheme ir_black
 set guifont=Courier\ New\ 16
 set scrolloff=3
else
 color desert
endif

" OSX:
" set gfn=Courier\ New:h24.00
" set gfn=Menlo:h24.00

And …

To use gvim without GNOME in linuxmint/ubuntu:

sudo apt-get remove vim-gnome
sudo apt-get install vim-gtk

with some other configuration options:

set hlsearch
set incsearch
set matchtime=5
set showmatch
set smartindent
set noshiftround

How to silence unwanted LaTeX warnings?

Use the package silence.

\RequirePackage{silence} % before documentclass
\WarningFilter{latex}{Marginpar}

But I cannot silence overfull hboxes.

Bibliography, BibTeX references

Unfortunately bibdesk only exists for OSX. Pity.

Alternatives: JabRef (are there other options?)

Put filename.bib into a directory, where all PDF files will go, and use the import-bibtex-from-pdf functionality. But the DOI automatic import does not work, and getting metadata from PDF really does not work. Chrome plugin does not exist. Firefox plugin seems not woking.

What else?

Trying zotero… kind of it does not really work with syncing without their thing, but at least DOI and PDF-to-bibtex seem working. It needs some understanding and adapting, maybe. Next time.


Update on Zotero: it works quite well, with the sync & WebDAV. Unfortunately, I need a WebDAV provider or to understand how do I subscribe to the paid service on Zotero. Interesting plugins, also: ZotFile & Better Bib(La)TeX.

Another couple of old pieces to check if they still exist: synergy and x2x.