You can use the detex tool to strip LaTeX commands. If you do detex file.tex
, it will output to stdout. Then, you can use the diction tool to analyse your text, and suggest improvements. Putting it all together:
detex file.tex | diction -bs
This will strip the LaTeX, and pipe it into diction with suggestions and "beginner mistakes" enabled.
For Debian/Ubuntu:
sudo apt-get install diction texlive-extra-utils
This will install detex and diction, as well as several other useful tools.
Since you mentioned that you're using Emacs, there is also diction.el which provides diction integration with Emacs. You can do M-x diction-buffer
, and it will take care of detexing/dehtmling and show the diction results in a separate buffer. You can even hit enter on the individual results to be taken to approximately where the phrase is.
(If you do use diction.el, my version of detex didn't have the -C flag. I'm not sure of what it was meant to do, but if you search for 'detex -C' in the file, you can add other command line options if you want. Also, I recommend replacing 'diction -L' with 'diction -bsL')
One editor-independent approach would be to save the quotes into a separate file. You could do this in a single quotes.tex
file, which might contain
\newcommand*\getquote[1]{\csname quote#1\endcsname}
\expandafter\def\csname quote1\endcsname
{%
Some American text about color!%
}
\expandafter\def\csname quote2\endcsname
{%
Another quote about neighbors.%
}
...
You could then have \input{quotes}
in your main preamble, and call quotes by doing \getquote{1}
, etc. (I've defined the quotes with numbers as that seemed easiest, but you might want to give them names instead.)
Now, I don't know how long your quotes are, how many there are, and so on. So this approach might not be practical. However, it is hopefully a start.
Best Answer
According to the Texstudio manual, the standard distribution already has an English spellchecker. You perform a spell check by using the shortcut Ctrl+Shift+F7. Spell checking will start at the cursor position and not at the beginning of the document.
In addition, you may use a ‘magic comment’ in your TeX- source file:
If this comment is present in a file, the given language is automatically used for spell checks.
Use:
if you prefer US spelling. You use this code in all .tex-files you want to spell check, i.e. both in the main file and in the chapter files, if your sources are divided in multiple chapters.
Remember, the percent sign is mandatory.
Section 1.4 in the manual has detailed information how to set up different languages and perform spell checks (and grammar checks).