Texwatch is a command line utility for live building and spell-checking LaTeX projects. It allows you to have all the benefits of a code editor when writing your TeX but still have the power of seeing your PDF being compiled automatically when you save.
Texwatch requires the following to be installed:
At this point in time it has only been tested on OSX.
After you have NodeJS installed, just run the following from anywhere on your computer:
npm install -g texwatch
Hunspell does not come with its own dictionaries. Most of the time you need to install them yourself. Do the following to find out if you need to install any:
hunspell -D
Here are some instructions on how to install a set of english dictionaries for OSX:
hunspell -D
and find the output section called SEARCH PATH:hunspell -d
again - it should now say there are dictionaries present and loaded.Simply run texwatch
in your LaTeX project folder.
Texwatch assumes that your document is called document.pdf. If it isn't you can specify it as an argument: texwatch mydoc.pdf
.
This command will start a watch service that recursively monitors all .tex files in the directory. When a file is changed, the main document.tex file will be rebuilt using pdflatex and (optionally) spellchecking will be performed using hunspell.
The .texwatchrc can be used to override default texwatch settings. This file should be placed in your project root and can contain any of the options below, structured in JSON. Example:
{
"spellCheck": false,
"log": false,
"personalDictionary": [
"Woodings",
"JavaScript"
],
"file": "mydoc.tex"
}
Enable or disable log output to the console.
Globbing pattern given to the watch service.
Directory to run texwatch from.
Filename of the main .tex file.
Array of personal dictionary entries. This can be used to prevent unknown words from showing up in the spellcheck report. For basic usage, just populate this array with words. This array is actually used as a MySpell dictionary, which is passed to hunspell as a personal dictionary file. MySpell dictionaries make use of affix files which allow you to specify how words can be manipulated (e.g. can be pluralised). For more information on affix files, see: the hunspell manpage.
Temp file used to write the personal dictionary.
Dictionary to use with hunspell
Enable or disable spell checking