LaTeX on Linux

June 8, 2013

As I’ve mentioned in previous posts, I use TeXWorks for pretty much everything other than taking brief notes.  However, if you’re going to use it for much more than basic formatting, you’re probably going to need to install some extra packages other than the preloaded stuff that comes with TeXWorks.  The best package for Ubuntu, and the one that includes most of what you might use on a regular basis (including tipa, a package for typesetting IPA symbols, which is probably my most frequently used package), is the texlive-full package.  To install this in Ubuntu, you can open the terminal and type “sudo apt-get install texlive-full”.  This will prompt you for your sudo password and then install the package, which might take a while since it includes a whole bunch of stuff.  Remember that the apt-get service is the same as the Ubuntu Software Center service, so you can’t be running both at the same time; you’ll have to exit the Software Center if you want to install something with the command line.

I won’t go into a whole discussion of how to use TeXWorks here, but I’ll just add a reminder of how to use a package in LaTeX.  Extra packages you want to load have to go in the preamble/header, right after the \documentclass{} command.  So, for instance, to use the tipa package, I add \usepackage{tipa} immediately after my \documentclass{} declaration.  Some packages are picky and need to loaded before or after other packages, because of definition updates run by various packages.


I started using LaTeX while working on a qualifying paper as a graduate student at Rutgers.  At that point I was still using Windows and Word, and I just couldn’t get the paper to look like I wanted it to in Word, despite having used it for a decade and having taught it to high school students for a year.  That’s not to say that I couldn’t have done it in Word, just that even after a decade I found Word completely unintuitive and difficult to customize.  Switching to LaTeX made it possible for me to end up with a document that looked professionally typeset and appeared exactly as I wanted, with little explicit formatting on my part.  LaTeX also eased my transition to Ubuntu, since I could continue using TeXWorks, whereas I wouldn’t have been able to continue using Word (at least not without Wine).

Before I switched to TeX I was afraid it would be difficult to compose in, since TeXWorks and other TeX editors aren’t WYSIWYG, so you don’t see things like italics or font faces in the document you’re editing.  However, for me it didn’t take long to adjust to typing in the editor on the left side of the screen and hitting Ctrl+t whenever I wanted to see what the formatting looked like (Ctrl+t typesets the document and also saves it).  Another nice feature is that converts from WYSIWYG editors don’t have to give up their little red underlining for misspelled words.  You just have to have to right spelling dictionary installed and then tell the editor to use that dictionary (under Edit > Spelling).  Unfortunately, the current default version of TeXWorks for Ubuntu only comes preinstalled with spelling dictionaries for British and South African English (who knows why — the last default package had only Canadian English).  Oh noes!

Luckily it’s not difficult to install a new spelling dictionary.  What I was looking for is the US English dictionary — en_US.  This consists of two parts: en_US.aff and en_US.dict.  These files are included in the OpenOffice en_US spelling dictionary available here:  You’ll have to download the file, then extract the contents using, e.g., Archive Manager.

Once you have the two files (en_US.aff and en_US.dict) you’ll have to copy them to the correct location.  For Ubuntu this is /usr/share/myspell/dicts.  Copying to this directory requires administrative privileges, so I recommend copying them using the terminal (I’ve gotten myself into trouble using the Nautilus file browser as root).  To do this you’ll use the copy utility: sudo cp <file location> /usr/share/myspell/dicts.  In my case I had the files in my Downloads folder of my home directory, so the exact command I used was sudo cp ./Downloads/en_US.aff /usr/share/myspell/dicts.  Do this for both files, and you’re done!  After restarting TeXWorks you’ll be able to select the en_US spelling dictionary and spellcheck your work in US English.