Keeping latex message after compilation

10 views
Skip to first unread message

Byungchul Cha

unread,
Sep 29, 2010, 9:19:31 PM9/29/10
to vim_mac
Hi.

I use vim for editing my latex file, but I do not use the vim-latex
suite. I have the following line

:map <F5> :w <CR> :!pdflatex --shell-escape % <CR> :!open -a Skim.app
%<.pdf <CR>

in my .vimrc file. This works for me when I use vim in terminal.

I have the same line above in .gvimrc, but, there is an issue when I
use MacVim. The problem for me is that MacVim does not show the latex
compiling message after compilation and opens Skim. (Well,
technically, it does show the mesage but it disappears fast as it
opens Skim next.) I would like to glance the message before I go back
to editing.

I do not have this problem when I use vim in terminal, so, I suppose
there must be a way to fix this.

Thanks.

David Patrick Henderson

unread,
Sep 30, 2010, 10:55:15 AM9/30/10
to vim...@googlegroups.com

One can recall such messages by using :messages command; also, I would consider setting the 'makeprg' value to your pdflatex command and mapping <F5> to :make instead

Dave H
--
"Never attribute to malice that which can be adequately explained by stupidity."
-- Robert J. Hanlon

björn

unread,
Oct 1, 2010, 4:30:23 PM10/1/10
to vim...@googlegroups.com

Due to the way MacVim queues rendering instructions it is very
difficult to get the exact same behavior as in console Vim.

I seconds Dave's suggestions of setting makeprg instead, then you can
use Cmd+B to compile. Here's an excerpt from my ftplugin/tex.vim
file:

" Set 'makeprg' so that you can use Cmd+B to compile
setl makeprg=pdflatex\ -interaction=nonstopmode\ %

" taken from ':h errorformat-latex'
setl efm=%E!\ LaTeX\ %trror:\ %m,
\%E!\ %m,
\%+WLaTeX\ %.%#Warning:\ %.%#line\ %l%.%#,
\%+W%.%#\ at\ lines\ %l--%*\\d,
\%WLaTeX\ %.%#Warning:\ %m,
\%Cl.%l\ %m,
\%+C\ \ %m.,
\%+C%.%#-%.%#,
\%+C%.%#[]%.%#,
\%+C[]%.%#,
\%+C%.%#%[{}\\]%.%#,
\%+C<%.%#>%.%#,
\%C\ \ %m,
\%-GSee\ the\ LaTeX%m,
\%-GType\ \ H\ <return>%m,
\%-G\ ...%.%#,
\%-G%.%#\ (C)\ %.%#,
\%-G(see\ the\ transcript%.%#),
\%-G\\s%#,
\%+O(%f)%r,
\%+P(%f%r,
\%+P\ %\\=(%f%r,
\%+P%*[^()](%f%r,
\%+P[%\\d%[^()]%#(%f%r,
\%+Q)%r,
\%+Q%*[^()])%r,
\%+Q[%\\d%*[^()])%r

" Use <Leader>v to view pdf
map <buffer> <Leader>v :!open %:p:r.pdf<CR>


Note that with the above settings you can also use Cmd+Ctrl+Left/Right
to step between the errors.

Björn

David Patrick Henderson

unread,
Oct 1, 2010, 5:33:42 PM10/1/10
to vim...@googlegroups.com
On 01 Oct 2010, at 13:30, björn wrote:

> " Set 'makeprg' so that you can use Cmd+B to compile
> setl makeprg=pdflatex\ -interaction=nonstopmode\ %

I use 'pdflatex --shell-escape --synctex=1 --interaction=nonstopmode $*' in my compiler argument to latex-suite, adding the synctex and using Skim.app, one can achieve behavior very like TexShop's where one can double click at a point in the pdf and have it return one to the appropriate spot in the tex file; the secret sauce being to set Skim's sync facility to invoke mvim with args '-c ":RemoteOpen +%line %file"' making it easy to correct errors in one's text. The pdflatex command may need some tweaking if not using latex-suite but should still be workable

Dave
--
"To announce that there must be no criticism of the president, or that we are to stand by the president, right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public."
-- Theodore Roosevelt

Reply all
Reply to author
Forward
0 new messages