e42.uk Circle Device

 

Techie Stuff

Projects

Quick Reference

Will be moved to Quick Reference soon

LaTeX on Gentoo

Installing LaTeX on Gentoo

In this document I am going to write exactly what I did to install TeX Live and the Garamond font so that I could compile the CV on this website.

Installing LaTeX (TeX Live)

Well, this was easy:

emerge texlive-latex

Next I installed some fonts, texlive-fontsrecommended is not strictly required here but texlive-fontsextra is required for mathdesign. Finally dvipdfm is required to convert a DVI file generated with the latex command into a PDF believe it or not!

emerge texlive-fontsrecommended
emerge texlive-fontsextra
emerge dvipdfm

When I talk about compilation I mean that I have tried to create a .dvi file from my .tex source. I do this by running the command:

latex cv.tex

The compilation failed at this point with an error message stating that it could not find sectsty.sty...

! LaTeX Error: File `sectsty.sty' not found.

This is apparently available in texlive-latexextra, unfortunately that has a lot of dependencies (including ruby) which I did not want on my system.

Installing sectsty.sty as the Current User

Note: The texmf directory I refer to in the following sections can be overridden by changing the environment variable $TEXMFHOME. You can what the correct directory is by running this command: kpsewhich -var-value=TEXMFHOME.

I remembered in the deep dark past that I had a problem like this before and remembered that I could install some files in ~/texmf so I went off in search of sectsty.sty. Naturally that file is not available, you have to compile it from a .ins file, download the three files from CTAN into a temporary directory and run this:

latex sectsty.ins

You don't need the .pdf really but it tells you about the package As the comments say it just preprocesses the file and creates a .sty for you to put into your texmf directory.

In your home directory make the directory texmf and in this make the directories tex/latex/sectsty and put sectsty.sty in the top level.

mkdir -p ~/texmf/tex/latex/sectsty
cp sectsty.sty ~/texmf/tex/latex/sectsty/

Compilation will work now with latex you will not be able to make a PDF though because you have not got the right fonts.

Cannot find font file ugmr8a.pfb
grep: ugmr8y.log: No such file or directory
mktexpk: `gsftopk ugmr8y 1244' failed to make ugmr8y.1244pk.
kpathsea: Appending font creation commands to missfont.log.
ugmr8y: Can't locate a Type 1, TTF, PK, or virtual font file

To correct this we need to install the Garamond font

Installing Garamond

This was the most difficult part, I had no clue and the documentation is really not good :-(

It turns out that this is quite simple. Most of the hard work has been done for you already, it just requires a little reorganisation. Below is a list of the files in the correct directories, I downloaded these from CTAN:

# the texmf directory for Garamond
doc/
doc/fonts/
doc/fonts/urw/
doc/fonts/urw/garamond.txt
dvips/
dvips/config/
dvips/config/ugm.map
fonts/
fonts/vf/
fonts/vf/urw/
fonts/vf/urw/garamond/
fonts/vf/urw/garamond/ugmri8c.vf
fonts/vf/urw/garamond/ugmri8t.vf
fonts/vf/urw/garamond/ugmm8c.vf
fonts/vf/urw/garamond/ugmm8t.vf
fonts/vf/urw/garamond/ugmr8c.vf
fonts/vf/urw/garamond/ugmr8t.vf
fonts/vf/urw/garamond/ugmmi8c.vf
fonts/vf/urw/garamond/ugmmi8t.vf
fonts/afm/
fonts/afm/urw/
fonts/afm/urw/garamond/
fonts/afm/urw/garamond/ugmm8a.afm
fonts/afm/urw/garamond/ugmmi8a.afm
fonts/afm/urw/garamond/ugmri8a.afm
fonts/afm/urw/garamond/ugmr8a.afm
fonts/map/
fonts/map/vtex/
fonts/map/vtex/ugm.ali
fonts/map/dvips/
fonts/map/dvips/ugm/
fonts/map/dvips/ugm/ugm.map
fonts/tfm/
fonts/tfm/urw/
fonts/tfm/urw/garamond/
fonts/tfm/urw/garamond/ugmm8a.tfm
fonts/tfm/urw/garamond/ugmm8c.tfm
fonts/tfm/urw/garamond/ugmm8r.tfm
fonts/tfm/urw/garamond/ugmm8t.tfm
fonts/tfm/urw/garamond/ugmmi8a.tfm
fonts/tfm/urw/garamond/ugmmi8c.tfm
fonts/tfm/urw/garamond/ugmmi8r.tfm
fonts/tfm/urw/garamond/ugmmi8t.tfm
fonts/tfm/urw/garamond/ugmri8a.tfm
fonts/tfm/urw/garamond/ugmri8c.tfm
fonts/tfm/urw/garamond/ugmri8r.tfm
fonts/tfm/urw/garamond/ugmri8t.tfm
fonts/tfm/urw/garamond/ugmr8a.tfm
fonts/tfm/urw/garamond/ugmr8c.tfm
fonts/tfm/urw/garamond/ugmr8r.tfm
fonts/tfm/urw/garamond/ugmr8t.tfm
fonts/type1/
fonts/type1/urw/
fonts/type1/urw/garamond/
fonts/type1/urw/garamond/ugmm8a.pfb
fonts/type1/urw/garamond/ugmm8a.pfm
fonts/type1/urw/garamond/ugmmi8a.pfb
fonts/type1/urw/garamond/ugmmi8a.pfm
fonts/type1/urw/garamond/ugmri8a.pfb
fonts/type1/urw/garamond/ugmri8a.pfm
fonts/type1/urw/garamond/ugmr8a.pfb
fonts/type1/urw/garamond/ugmr8a.pfm
tex/
tex/latex/
tex/latex/ugm/
tex/latex/ugm/ts1ugm.fd
tex/latex/ugm/t1ugm.fd

Most of the structure is contained within ugm.zip and the rest I deciphered from http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instt1font. I should say that I too like the easy way out and so I have provided these files in a nice easy to use compressed tarball in the downloads section.

Once you have extracted the files in your texmf directory run the updmap utility:

ben@riker ~ $ updmap
copy //etc/texmf/web2c/updmap.cfg => 
/home/ben/.texlive/texmf-config/web2c/updmap.cfg
Config file: "/home/ben/.texlive/texmf-config/web2c/updmap.cfg"
dvips output dir: "/home/ben/.texlive/texmf-var/fonts/map/dvips/updmap"
pdftex output dir: "/home/ben/.texlive/texmf-var/fonts/map/pdftex/updmap"

/usr/bin/updmap is creating new map files
using the following configuration:
  LW35 font names                  : URWkb
  prefer outlines                  : true
  texhash enabled                  : true
  download standard fonts (dvips)  : false
  download standard fonts (pdftex) : true

Scanning for LW35 support files  [  3 files]
Scanning for MixedMap entries    [ 25 files]
Scanning for Map entries         [119 files]

Generating output for ps2pk...
Generating output for dvips...
Generating output for pdftex...

Files generated:
  /home/ben/.texlive/texmf-var/fonts/map/dvips/updmap:
       11489 2012-08-16 19:56:16 builtin35.map
       15960 2012-08-16 19:56:16 download35.map
      484889 2012-08-16 19:56:16 psfonts_pk.map
      698019 2012-08-16 19:56:16 psfonts_t1.map
      702484 2012-08-16 19:56:16 ps2pk.map
          14 2012-08-16 19:56:17 psfonts.map -> psfonts_t1.map
  /home/ben/.texlive/texmf-var/fonts/map/pdftex/updmap:
      702491 2012-08-16 19:56:17 pdftex_dl14.map
      700917 2012-08-16 19:56:17 pdftex_ndl14.map
          15 2012-08-16 19:56:17 pdftex.map -> pdftex_dl14.map

Transcript written on "/home/ben/.texlive/texmf-var/web2c/updmap.log".
/usr/bin/updmap: Updating ls-R files.

You thought you had finished didn't you? Well, try running dvipdfm now and it may fail... this is because gsftopk is trying to create glyphs to be used in your PDF but to do that it needs the gs command from ghostscript, so... emerge ghostscript-gpl.

kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 0+540/600 --dpi 540 ugmr8y
mktexpk: Running gsftopk ugmr8y 540
gsftopk(k) version 1.19.2/905

Now it will work!

dvipdfm cv.dvi

Downloads

References

Quick Links: Techie Stuff | General | Personal | Quick Reference