XML Résumé Libray 0

ludo, Tuesday 07 October 2003

A few minutes ago I saw the second mention in just a few days of the XML résumé library and I really don't understand the benefits of writing a CV (or any other document) in XML.

It may be that my tastes are retro, but LaTeX is still the better option for writing documentation. I tried using DocBook a while ago, but the drawbacks are too many:

  • the text disappears under the XML tags
  • XML catalogs are a pain, and they become almost necessary if you're behind a proxy
  • you have to type too many characters for simple things, like creating a new paragraph
  • PDF output is awful, and image support requires installing extra Java classes

You may argue that with XML you get validation, but you get the same thing with LaTeX error messages, plus excellent output of typesetting quality, and lots of packages covering every possible need, since LaTeX and TeX have been around for a long time.

To write a CV in LaTeX, you could use the currvita package by Axel Reichert, which usually comes preinstalled on reasonably modern LaTeX installations. Currvita has a cleaner syntax than the XML Résumé Library, produces a better output, and allows you to use other LaTeX packages like BibTEX. Compare for example a job entry in the XML Résumé Library format

<job>
  <jobtitle>Junior Bedpan Cleaner</jobtitle>
  <employer>Framingham Palace</employer>
  <period>
    <from>
      <date>
        <month>October</month>
        <year>1633</year>
      </date>
    </from>
    <to>
      <date>
        <month>October</month>
        <year>1634</year>
      </date>
    </to>
  </period>
  <description>
    <para>Analyzed bedpan cleanliness strategies for royal
      family.  Learned how to make soufflés.
    </para>
  </description>
</job>

to the same one using currvita

item[10/1633--10/1634] textbf{Junior Bedpan Cleaner},
Framingham Palace
Analyzed bedpan cleanliness strategies for royal family. Learned how to
make soufflés.

Can you see my point? And I don't believe you'd find an XML CV useful, because you can query it using XPath, or extract lists of employers, dates, and so on. Have you ever needed to do it? And how long would it take to do the same thing using regexps on the LaTeX file, or using a parser on an HTML file generated by the LaTeX source? It's a CV, not enterprise data.

LaTeX for sanskritists 0

ludo, Thursday 18 September 2003

A few useful links on skt-utf, an Omega TeX package that allows you to input and process Sanskrit inside LaTeX.

The skt-utf package resides at the site of the Martin-Luther-Universität Halle- Wittenberg Philosophische Fakultät Fachbereich Kunst-, Orient- und Altertumswissenschaften Institut für Indologie und Südasienwissenschaften, on a set of pages maintained by J Hanneder.

A more straightforward set of instructions for installing and using the utf-skt package can be found on the page Sanskrit Unicode Text Processing by Christian Coseru of the Australian National University. This page also covers the installation and usage of the corresponding Emacs packages.

My installation was pretty simple (I run Slackware 9.0 with Dropline Gnome)

get root privileges, then extract the package

ludo:~# tar zxvf utf-skt.tgz

find the location of your texmf-local tree

ludo:~# kpsewhich -expand-var $TEXMFLOCAL
/usr/share/texmf-local

if the directory does not exist yet, create it

ludo:~# mkdir /usr/share/texmf-local

copy the contents of the extracted archive's texmf directory under your texmf-local tree

ludo:~# cp -R utf-skt/texmf/* /usr/share/texmf-local/

update the TeX files index

ludo:~# /usr/share/texmf/bin/texhash

The installation is now complete, let's revert back to a normal system user to test the package, using the example documents contained in the utf-skt/user/examples directory extracted from the archive.

Before starting, it will be useful to note that utf-skt is an Omega package (Omega is a TeX extension "designed for the typesetting of all the world's languages"), and so the commands used to generate .dvi files from the .tex sources are different from standard LaTeX. Instead of latex we will need to use lambda, instead of dvips odvips.

Let's create a PDF file from the Transliterated.tex example file (I only list the commands, without their output):

ludo:~/download/skt/utf-skt/user/examples$ lambda Transliterated.tex
ludo:~/download/skt/utf-skt/user/examples$ lambda Transliterated.tex
ludo:~/download/skt/utf-skt/user/examples$ odvips Transliterated.dvi
ludo:~/download/skt/utf-skt/user/examples$ ps2pdf Transliterated.ps

Supposing you got no errors (due to problems with your TeX or utf-skt installations), you should now have a Transliterated.pdf file. If you open the file in Acrobat Reader though, you will notice that the fonts are all blurred. The PDF will print ok, but reading it on-screen is a pain. This is due to dvips including bitmap versions of the fonts used in the document, instead of their outlines.

After a bit of digging around in Google, and experimenting with different solutions to this problem, I found a thread in the debian-users list that worked (keep in mind I'm a novice TeX user, so other solutions may be better for different setups, etc.):

In your home directory, make (or modify it if it already exists) a file 
named .dvipsrc which must contain the lines: 
    p+ psfonts.cmz
    p+ psfonts.amz

Make sure that the LaTeX preamble of your LyX file (or the part before begin{document} if you are using straight LaTeX files) contains: usepackage[T1]{fontenc} usepackage{ae,aecompl}

Re-running odvips and ps2pdf the resulting PDF looks as in the image above. The document source in the image is opened in Gnome 2.4's gedit.

The master's humour 0

ludo, Sunday 31 August 2003

The TeXBook

I've started experiencing withdrawal symptoms from new (for me) concepts. So tonight I started reading D.Knuth's The TeXbook, and I found myself laughing after just a few pages. Usually this does not happen with technical books....

Insiders pronounce the X of TeX as a Greek *chi*, not as an 'x', so that TeX rhymes with the word blecchhh. It's the 'ch' sound in Scottish words like loch or German words like ach; it's a Spanish 'j' and a Russian 'kh'. When you say it correctly to your computer, the terminal may become slightly moist.

Donald Ervin Knuth, The TeXbook, page 1

And the citations are great too. And I've been reading only about 5 or 6 pages. =)

LaTeX has been on my to be learned list for a long time, but somehow I never got around to anything more than reading a few pages of Tobias Oetiker's (you may know him as MRTG's author) The not so Short Introduction to LaTeX2e. Then I started using LaTeX a few weeks ago as an intermediate format to output pdf from RestructuredText (the same format used to write this blog), and was immediately fascinated by its printed quality, and its versatility.

So when a few days later I was asked to produce printed copies of our (>50k) users directory, I decided to write a simple python script to extract info from our Directory Server and produce a LaTeX file (actually, a few files, as we generate more than one type of directory, and I did not write it alone but together with a colleague, and we copied most of the LaTeX stuff from Rich Lafferty, and as usual the request was to ask the consultants I more or less supervise to do it not do it myself).

I have been looking for quite a long time for a more structured way of writing documents. My first attempts where to use the Microsoft Word outliner (its best and most underrated feature imho), which works well enough for writing simple, one-shot documents. Then I tried using Docbook, but I soon discovered that writing XML directly is a pain, reading it on screen is worse, producing good quality output from Docbook + FOP is a frustrating experience, and double validation (once as XML once printed/on screen) is too much. Then I switched to RestructuredText, and you already know what happened. =)

Now I write my documents in RestructuredText with the same editor I use to write code, and with the added bonus of being able to use CVS for versioning. When I have a sufficiently complete version I convert it to LaTeX, and from then on I make corrections etc to the LaTeX source. For complex documents I use Kile, a very nice LaTeX IDE for KDE that gives me syntax coloring and allows me to jump to sections, preview the output from the IDE, etc.

Since I started using LaTeX, I not only get easily manageable documents and excellent quality output, but I also get small satisfactions, like having one of our Avanade consultants come see me with my last report in hand, and ask me with longing eyes if I used LaTeX to write it. They standardise on Word. =)