Check spelling on multiple LaTeX files using multiple languages

Consider that you have several directories and sub-directories, e.g., the organization of a thesis document in which each chapter has its own directory and several .tex files. And your goal is to check the spelling on all the .tex files in this tree of directories, recursively. Moreover, you want to check the spelling in different languages, some circumstances require that, such as the abstract of the thesis was written in multiple languages. Here is my approach for that, explained step-by-step:

First, in order to check the spelling, we are going to use aspell. Therefore, we rely on its dictionaries, which are packeged on Debian as aspell-[language], e.g., aspell-fr is the package for French dictionary. Install the packages referent to the dictionaries you want. To check which language dictionaries you have installed do:

aspell dump dicts

Then take note of those you gonna use, we gonna need them later on.

Now, back to our .tex spell check. First, lets get the content of all the .tex files, from here on lets consider you are in the root directory of your document’s tree:

find . -name '*.tex' -exec cat {} \;

Second, to spell check the words from text that resulted from the command above using, at the same time, many languages, for example, English from US and Brazilian Portuguese , we use aspell as following:

aspell --lang=en_US -t list | aspell --lang=pt_BR -t list

the -t indicates that we are going to check LaTeX files, i.e., to discard its directives and the list parameter outputs the words that were not found in the dictionary.

A final touch would be write to a file only unique instances of the misspelled words alphabetically sorted, thus the whole command is:

find . -name '*.tex' -exec cat {} \; | aspell --lang=en_US -t list | aspell --lang=pt_BR -t list | sort -u > typo.txt

Now you can proofread the typo.txt file and see if there are problematic words in there.

Advertisements

Wifi Disconnects and it is Unable to Reconnect, “device not ready” on Debian and Ubuntu

On both Ubuntu and Debian I’ve faced a problem with the Wifi that would get disconnected and would not be able to reconnect. On some circumstances, even brand-new Debian Jessie, Network Manager 0.9.8 would show a “device not ready” message instead of a list of wireless networks.

On both Debian Jessie and Ubuntu 10.04 I’ve solved that by removing and reloading modules, though different modules were targeted.

Ubuntu 10.04 (and it will probably work for newer versions):


sudo rmmod iwlagn
sudo rmmod iwlcore
sudo modprobe iwlcore
sudo modprobe iwlagn

Debian Jessie

rmmod iwlmvm
rmmod iwlwifi
modprobe iwlmvm
modprobe iwlwifi lln_disable=1 swcrypto=1