Latex - Manually add a package in Ubuntu

Sometimes the packages in Ubuntu are outdated (e.g. the geometry package in Ubuntu 12.04, see this forum) and it is necessary to manually include the package.

The easiest way for me is to just download the package from ctan, e.g. for the geometry package

http://ctan.org/tex-archive/macros/latex/contrib/geometry

i.e. either download the .sty file OR both the .dtx and .ins file. Change directory to the download folder, open a terminal (Ctrl + Alt + t) and run following commands

cd /PATH/TO/FILE.dtx
latex *.dtx
latex *.ins

Some files are generated. Copy the *.sty file (e.g. geometry.sty) into the directory of your .tex file, on which you are currently working on. Then the document should compile using

pdflatex MyLatexFile.tex
blog_tags: 

Add new comment

Filtered HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <img> <br> <p> <span>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Use [collapse] and [/collapse] to create collapsible text blocks. [collapse collapsed] or [collapsed] will start with the block closed.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Code snippets in <code>...</code> or <source>...</source> automatically will be pretty printed.
  • Use [collapse] and [/collapse] to create collapsible text blocks. [collapse collapsed] or [collapsed] will start with the block closed.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Target Image