Google Analytics

Wednesday, November 02, 2005

How to install the Luxi Mono font in TexShop

I've just spent way too much time trying to get this font installed. I wanted to install it as it was recommended by the Listings package (PDF) for LaTeX as the font to use if you wanted your code listings (a) in a monospace font (who wouldn't?) and (b) able to be in bold type (for highlighted keywords, etc.).

I found the LuxiMono package on CTAN, then tried to figure out how to install it for ages, then finally came across this post from the Mac-Tex mailing list describing the process for another font package.

The secret is putting everything in ~/Library/texmf/. I think it's just quickest to dump a tree listing of what I have there:

.
|-- doc
| `-- fonts
| `-- luxi
| |-- LICENSE
| `-- luximono.txt
|-- dvips
| |-- config
| | `-- ul9.map
| `-- luxi
| `-- ul9.map
|-- fonts
| |-- afm
| | `-- public
| | `-- luxi
| | |-- ul9b8a.afm
| | |-- ul9bo8a.afm
| | |-- ul9r8a.afm
| | `-- ul9ro8a.afm
| |-- map
| | `-- vtex
| | `-- ul9.ali
| |-- tfm
| | `-- public
| | `-- luxi
| | |-- ul9b8a.tfm
| | |-- ul9b8c.tfm
| | |-- ul9b8r.tfm
| | |-- ul9b8t.tfm
| | |-- ul9bo8a.tfm
| | |-- ul9bo8c.tfm
| | |-- ul9bo8r.tfm
| | |-- ul9bo8t.tfm
| | |-- ul9r8a.tfm
| | |-- ul9r8c.tfm
| | |-- ul9r8r.tfm
| | |-- ul9r8t.tfm
| | |-- ul9ro8a.tfm
| | |-- ul9ro8c.tfm
| | |-- ul9ro8r.tfm
| | `-- ul9ro8t.tfm
| |-- type1
| | `-- public
| | `-- luxi
| | |-- ul9b8a.pfb
| | |-- ul9bo8a.pfb
| | |-- ul9r8a.pfb
| | `-- ul9ro8a.pfb
| `-- vf
| `-- public
| `-- luxi
| |-- ul9b8c.vf
| |-- ul9b8t.vf
| |-- ul9bo8c.vf
| |-- ul9bo8t.vf
| |-- ul9r8c.vf
| |-- ul9r8t.vf
| |-- ul9ro8c.vf
| `-- ul9ro8t.vf
`-- tex
|-- context
| `-- pdfsync4context.tex
|-- latex
| |-- luxi
| | |-- luximono.sty
| | |-- t1ul9.fd
| | `-- ts1ul9.fd
| `-- pdfsync.sty
`-- plain
`-- pdfsync.tex

26 directories, 43 files


Then the magic command is sudo updmap --enable MixedMap ul9.map. You may need to be in the dvips/luxi dir to run that. Also, just in case you're getting confused, the .tex, .vf, .ali and .tfm files were either already there or auto-generated.

To take advantage of the font, I just added
\usepackage[scaled]{luximono}
to my LaTeX document, and it automatically became the default \tt font for it.

I hope this alleviates headaches for some others out there!

4 comments:

Adam Badura said...

It does also require use of package:

\usepackage[T1]{fontenc}

- without it you get wired results.

Jan Michael said...

Bei mir auf dem Mac mit pdftex und der Tex-Live 2007 ging es noch einfacher mit dem Befehl:

getnonfreefonts-sys --all --force

Damit wurde der Font automatisch installiert.

Stewe said...

Thank you Mike... you saved my life ;) I always get mad installing packages in TexShop!

saurabh said...

if you are on a mac: e.g., using mactex, then the simplest way is to use getnonfreefonts or getnonfreefonts-sys scripts provided by texlive