Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim and latex-box

Tags:

vim

plugins

I installed the vim plugin latex-box but I am having trouble getting it to compile my Latex file. The docs say it uses latexmk to do the compiling, and I have that installed and it works when called by itself. But when I use the plugin's \ll command to compile I get an error that says 'cannot run latexmk in background without a VIM server'. I cannot find an explanation of why this error would occur in the plugin documentation.

EDIT:

I found a solution to this issue, but ran into others.

To fix this, you need to install the full version of vim (which is different depending on your OS) which will include things like server support. I suggest doing this even if you don't use this plugin because it will fix not been able to copy/paste from/to vim. In (K)ubuntu, install the package vim-gtk.

Start vim like this vim --servername SOMETHING file.tex

After doing this, the servername error went away and the compilation went through but the output from latexmk shows up on top of the file I'm editing. It doesn't overwrite it, it's just displayed on top of the text. When I move the cursor and vim highlights a word or bracket, that appears back on the screen. The only quick way I found to get rid of the compiler output is to scroll the file up and back down, that makes the text appear again.

like image 684
ravl1084 Avatar asked Sep 15 '11 22:09

ravl1084


1 Answers

You can ask vim to redraw the screen like this:

:redraw!

Append that command after running your latex command.

like image 191
holygeek Avatar answered Nov 05 '22 21:11

holygeek