I'm using vim to write my thesis. It's a multi-document project, with most tex files in subdirectories from the master-document. I've set up a couple of \newcommands to replace the use of \section*{} in the Introduction, but when writing the sections, misspelt words aren't highlighted.
I thought it was a problem with vim-latexsuite, so I've just uninstalled it, but still, spell-checking functionality doesn't work in these sections.
For example, a MWE with the following files:-
thesis.tex
thesis.tex.latexmain
Classes/Thesis.cls
Intro/intro.tex
thesis.tex :
\documentclass[twoside,openany,titlepage,12pt]{Classes/Thesis}
\pagenumbering{roman}
\begin{document}
\include{Intro/intro}
% ...
\end{document}
Classes/Thesis.cls :
\ProvidesClass{Classes/Thesis}[2014/07/14 v1.2 Thesis template]
\LoadClass[pdftex, a4paper]{report}
\usepackage[pdftex,
plainpages = false,
pdfpagelabels,
bookmarks,
bookmarksopen = true,
bookmarksnumbered = true,
breaklinks = true,
linktocpage,
pagebackref,
colorlinks = true,
% Colour settings from::
% http://tex.stackexchange.com/questions/30243
linkcolor=NavyBlue,
citecolor=BrickRed,
filecolor=black,
urlcolor=BrickRed,
hyperindex = true,
hyperfigures
]{hyperref}
\usepackage{tocbibind}
\usepackage{bookmark}
\usepackage[english]{babel}
\usepackage{times}
\usepackage[a4paper]{geometry}
\usepackage{pdfpages}
\newcommand\chapwtoc[1]{%
\phantomsection
\chapter*{#1}
\addcontentsline{toc}{chapter}{#1}
\markboth{#1}{}
}
\newcommand\secwtoc[1]{%
\phantomsection
\section*{#1}%
\markright{#1} % Get the Section name in headnotes
\addcontentsline{toc}{section}{#1}
}
Intro/intro.tex :
\chapwtoc{First chapter}
this is a msisisspelt word. Some mnore mis-spellings.
\secwtoc{First section}
some more misskjkpellings.
% vim: spell spelllang=en_gb
thesis.tex.latexmain is an empty file, as suggested in the latexsuite documentation for Multiple file LaTeX projects
How do I get spell-checking to work in the intro.tex sections? Using vim 7.4 on Linux
desertthen all misspellings are highlighted. – Marco Sep 27 '13 at 11:14desert, or others... – Alex Leach Sep 27 '13 at 11:17intro.texare in the vim settings line:spelllangandgb. If I use\chapter*and\section*, then it works as expected.. – Alex Leach Sep 27 '13 at 11:23~/.vimrc, and I found the culprit:let g:tex_flavor = "latex". Removing that fixes it – Alex Leach Sep 27 '13 at 11:25.vimrcand add your custom configuration line by line (or do a bisect). Then you'll find the offending line or setting. – Marco Sep 27 '13 at 11:44.vimrcnow, but the content of my actualintroduction.tex. I just copied it over to the MWE - it doesn't work - so i'm cutting stuff out of it to see if I can the problem... – Alex Leach Sep 27 '13 at 11:52set filetypereturnstex, whereas when it does work, it detectsplaintex.. Guess I'll have to add the filetype to the settings line.. – Alex Leach Sep 27 '13 at 11:59texdocuments, as opposed toplaintexdocs. In the MWE,set filetype=texbreaks spell-checking. In my actual thesis,set filetype=plaintexfixes it. – Alex Leach Sep 27 '13 at 12:08