spf13 / spf13-vim

The ultimate vim distribution
http://vim.spf13.com
Apache License 2.0
15.56k stars 3.64k forks source link

How do I get LaTeX Syntastic plugins to work? #476

Open aeonaut opened 10 years ago

aeonaut commented 10 years ago

I've been using Syntastic for months now with no issues on source code (ruby, erlang, python, etc.) However, I can't seem to get it work with a latex file. Here's the output of SyntasticInfo inside my .tex file:

Syntastic info for filetype: tex Available checkers: Currently active checker(s):

Obviously, it's not finding the checkers installed here by default:

$ ls ~/.vim/bundle/syntastic/syntax_checkers/tex/ chktex.vim lacheck.vim

So, some questions: 1) How do I make these checkers available? 2) If the answer to (1), is "put the executable on $PATH", where is the executable? I can find it online, but is it not included already with the Syntastic Distribution? (Other syntax checkers were, presumably, since I didn't download them.) Where should I put it (i.e., what is the standard location)? 3) Where (in which file) should I tell Syntastic / $PATH the path to all my syntax-checking executables? Where does this happen for existing checkers? 4) Where (in which file) should I tell Syntastic which checker to use for a given filetype? E.g., '"et g:syntastic_ruby_checkers=['mri']". Where does this happen for existing checkers?

I assume steps (3) and (4) are happening somewhere in the wilds of this spf13 distribution; however, I can't find them:

$ grep -ER "g:syntastic_.*_checkers" ~/.vim <returns just examples from the READMEs, not actual code>

Nor can I find the executables for my working syntax checkers (for instance, 'which mri' comes up blank, as does searching the disk for files named 'mri', though the mri ruby checker works fine).

Many thanks in advance for your collective wisdom!

ljani commented 10 years ago

Mine worked out-of-the-box, as I have TeX Live 2013 in my search path. TeX Live 2013 includes both, chktex and lacheck and thus both of them are available for me:

C:\Users\Jani>chktex
ChkTeX v1.7.1 - Copyright 1995-96 Jens T. Berger Thielemann.
...
C:\Users\Jani>lacheck
* LaCheck *
    ...a consistency checker for LaTeX documents.
...

This has probably been the case with other checkers, ie they are installed when you have installed the other dev tools. In case you want to install them manually, according to FHS, you should put the compiled binaries in /usr/local/bin, but any path is fine as long as it's in your search path.

Default checkers are configured in syntastic/plugin/syntastic/registry.vim, at row 24.

If you want to use eg. chktex, you can do let g:syntastic_tex_checkers=['chktex'] in ~/.vimrc.local.

EDIT: note that these checkers are not perfect as TeX is a very hard language to lint.

aeonaut commented 10 years ago

Got it. I didn't realize the syntax checkers were separate from Vim -- I had no LaTeX distribution at the time (was copying from Vim into a web app to do the compilation). Much obliged!