Sunday, April 6, 2014

Installing Latex/PdfLatex on Ubuntu

PdfLatex is a tool that converts Latex sources into PDF. This is specifically very important for researchers, as they use it to publish their findings. It could be installed very quickly using Linux terminal, though this seems an annoying task on Windows. Installation commands are given below. 

* Install the TexLive base
$ sudo apt-get install texlive-latex-base

* Also install the recommended and extra fonts to avoid running into the error [1], when trying to use pdflatex on latex files with more fonts.
$ sudo apt-get install texlive-fonts-recommended
$ sudo apt-get install texlive-fonts-extra

* Install the extra packages,
$ sudo apt-get install texlive-latex-extra

Once installed as above, you may be able to create PDF files from latex sources using PdfLatex as below.

$ pdflatex latex_source_name.tex


Also install texlive-publishers, to build with citations using BibTeX (to avoid error 2).
$ sudo apt-get install texlive-publishers

Once installed, you may compile with sources, using bibtex and latex.
$ latex latex_source_name.tex
$ bibtex latex_source_name
$ latex latex_source_name.tex
$ latex latex_source_name

Error 1:
grep: ptmr7t.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input ptmr7t' failed to make ptmr7t.tfm.
kpathsea: Appending font creation commands to missfont.log.

! Font OT1/ptm/m/n/10=ptmr7t at 10.0pt not loadable: Metric (TFM) file not found.

                   relax l.373 \normalfont
                 \selectfont

Error 2:
$ bibtex main
This is BibTeX, Version 0.99d (TeX Live 2013/Debian)
The top-level auxiliary file: main.aux
I couldn't open style file IEEEtran.bst
---line 2 of file main.aux
 : \bibstyle{IEEEtran
 :                   }
I'm skipping whatever remains of this command
I found no style file---while reading file main.aux
(There were 2 error messages)


Alternatively, you may just install the entire bundle:
$ sudo apt-get install texlive-full

6 comments:

  1. Reading your article solved my problem. Congratulations for the interesting post.

    ReplyDelete
  2. I installed texlive using these very commands in the same order. pdflatex works in the terminal. However, once i use texmaker or texstudio, i get an error message saying pdflatex does not exist. Please show me the way through this.

    ReplyDelete
  3. After I installed the packages as you said, TeXstudio started working and my several-hour quest is finally over. I appreciate your useful article.

    ReplyDelete
    Replies
    1. Hi Tekin, I am glad to know that this article was useful to you.

      Regards,
      Pradeeban.

      Delete
  4. ! LaTeX Error: File `acl2015.sty' not found.
    getting this error when tried with pdflatex.

    ReplyDelete

You are welcome to provide your opinions in the comments. Spam comments and comments with random links will be deleted.