How to install Latex on Ubuntu 14.04LTS

You may often get error messages like "missing subfigure.sty", "missing url.sty", or missing other .sty files. The problem is caused by missing packages. This post outlines the steps to correctly install latex on Ubuntu latest version 14.04LTS. It should also work for most previous other versions.

1. Install Latex on Ubuntu

In the terminal, type in "latex". You will get a message saying that latex is not a valid command, and suggest you install it. Use the "sudo apt-get install xxx" command to install. After that, you should also run the following command:

sudo apt-get install texlive-latex-extra

This command will install popularly used packages you will need to use latex correctly. "texlive-latex-extra" is the most important package you will need for your latex projects.

To compile latex file, you can do the following:

$ latex myarticle
$ bibtex myarticle
$ latex myarticle
$ latex myarticle

2. Install Eclipse Plugin for Latex

Under linux, I suggest you use TeXlipse to edit your latex files. TeXlipse is a plug-in that can be installed on your eclipse in no time. The good feature is that you can click the paragraph of a generated PDF file, TeXlipse will lead you to the latex code automatically.

Click "Help" -> "Install New Software ...", use http://texlipse.sourceforge.net as site url.

install-latex-eclipse-plugin

Category >> Latex >> Linux  
If you want someone to read your code, please put the code inside <pre><code> and </code></pre> tags. For example:
<pre><code> 
String foo = "bar";
</code></pre>