2008-03-24

TeX, UML, OS X (going slightly mad...)


This post is only relevant to the lucky few who want to use UML diagrams in a TeX environment on OS X. This is the third time I solved this issue so this post is mainly to prevent me from having to figure it out once more.

First of all you need a TeX distribution, TeXShop is currently the best option. Next you need an UML package that works with that. I found MetaUML (a set op .mp files) that can be interpreted by MetaPost which (fortunately) is part of the TeXShop package.

To install MetaUML it seems sufficient to have the set of .mp files somewhere on your desktop. Documentation of the package tells you to move the files somewhere where other .mp files are but I have no other .mp files on my system so I'm very happy it just seems to work this way as well.

A UML diagram can now be made by using the code of the MetaUML package in an .mp file and type-setting it by choosing 'MetaPost' next to the typeset button. You can either create a stand-alone pdf-file or a postscript file (with extension '.1' for some reason...) that can later be included in a normal .tex file. To switch between these type-setting modes go to Preferences -> Misc and choose either mptopdf or mpost.

Make sure the .mp file has no spaces in its name because it will not work if it does (it took me ages to figure this out...).

Happy Unified Modeling!

1 comment:

Unknown said...

The texshop latex distribution already comes with metaUML as a standard package.

no need to download anything from the metaUML website, except for the manual, maybe :)

all you have to do right now is use the texshop editor to compile the diagrams as you have perscribed.

without your post I would have not figured this out

Cheers!