I use Latex in larger projects and I use the following file structure:


The command \input{tex/subfileN.tex} is used to import the content from each file in the tex/ folder. The mainfile.tex.latexmain work as expected and cross-reference completion across the project is available.

However, spite recogized correctly, spelling in each of the subfiles does not work properly. Spelling in comments follow g:tex_comment_nospell and verbatim follow g:tex_verbspell, but nothing in the document itself irrespectively of the state ofg:tex_nospell.

A little bit of exploring and I found at that by adding a \begin{document}/\end{document}-pair, the document behaves normal again. I'm assuming that latex-suite thinks that the document is stand-alone and I'm actually writing a preamble. But the preamble and \begin{document}/\end{document}-pair can be found in mainfile.tex.

To enable spelling in such projects I in practice either comment out each line or add a \begin{document}/\end{document}-pair. Neither are very good solution to the problem.

Is there a good way to get around this? Alternatively, is there another way of structuring my documents I should be using that doesn't involve me editing a file with 8000 lines?


One solution, though not very satisfying, is to turn off spelling through

let g:tex_nospell=1

and instead let spelling be handled through an module like Syntastic: http://github.com/scrooloose/syntastic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.