latex
i maintain some sort of a love-hate relationship with latex. we’re almost like a married couple: we can hardly get along on some days, but we couldn’t imagine living without each other anymore, either.
on the one hand, latex is so much superior to WYSIWYG word processors that it almost hurts me physically when i see my friends suffer from microsoft word woes when writing their university papers. honestly, ms word is a moody snob that will give you random crap on any given day; not because of a specific reason, but just because it feels like it. we all know that software tends to get sassy when it has “its days” once a month, but ms word seems to have “its days” just about any freaking day i have ever used it. here’s a quick summary why i would never go back to WYSIWYG word processing:
- full control: I do not appreciate programs hiding relevant information (i.e. control commands) from me, thus making it impossible to analyse and fix problems in my documents. I want to see the commands that define a table / a footnote / a heading, because that will let me understand why stuff displays the way it does. It should not assume that it’s smarter than me and can do stuff right for me without letting me look “behind the scenes”.
- text based file format: Working with a text based file format has big advantages: 1. you can automate repetitive tasks. it makes me feel all warm inside to know that i can hack up a python script anytime to do the boring parts of my work. 2. use standard command line tools like ‘grep’ or ‘diff’ or ‘make’ 3. use a revision control system like SVN to keep track of changes (no more “i know i wrote that paragraph once, but it must have magically disappeared at some point” moments). i would recommend this to anyone working on a bigger project. 4. easy integration with external tools, like JabRef bibliography manager etc. 5. tweak the processing of your documents at any point: use a Makefile to control the build process, and hook up any script you might need at any point during the build process.
- it looks good: at the university, people supply a handout when they give a speech, and i can usually tell after two seconds if a handout has been typeset with latex or not. the reason is that latex documents simply look so much better. the authors of (la)tex have put great efforts into making the system make smart choices to optimize the typesetting. as an example, you will never see latex put a heading at the bottom of a page: it has very sophisticated algorithms to figure out stuff like that. of course, it is not impossible to make pretty documents with WYSIWYG word processor, but quite frankly, i hardly ever see one of those.
on the other hand, some aspects of using latex make we want to bang my head against the wall, or at least torture someone uninvolved who happens to be around. for example, could someone please explain the rationale behind this?
bibliography{vgs,gr} % works
bibliography{vgs, gr} % does not work
i’m not kidding, a single whitespace at this position really breaks a document.
the main problems i have with latex all stem from the same cause: (la)tex is just way too antiquated. in fact, it is so old, it makes a stegosaurus look like it lived yesterday. consider that tex was started in the early eighties. the early eighties? heck, i was born in the early eighties! no wonder some parts of it are fossil.
alright, here comes the unordered list of my biggest gripes with latex:
- no unicode support: as a multi-lingual word processor, this is a fundamental shortcoming in the 21st century. IMHO there is no doubt that unicode is the character encoding of the future: a word processor that does not support it is (at least in my case - i’m a linguist) almost worthless.
- image support sucks: have you ever heard of an EPS? do you know how to convert JPG, GIF or PNG image files to the EPS format? no? then you better go figure, because latex wants its images in just that format.
- debugging sucks: it can be a real challenge to find out just what went wrong when your documents don’t compile. it prints masses of information and warnings to STDOUT, covering up the important stuff. and if you don’t configure it explicitly, it won’t just stop at an error - it will leave you at an unintuitive interactive prompt which is almost as hard to get out of as the infamous vi editor.
- TTF fonts: it won’t let you use custom TTF fonts easily. there are ways to do it, but don’t dare to try it by yourself unless you have a M.A. in “latex studies”. i have tried it more than once, and it is mind-bogglingly complicated.
- plethora of half-redundant, half-incompatible extensions: you want a table with dynamic column widths? no problem, use the ‘tabularx’ packet. oh, your table is supposed to be larger than one page? don’t worry, you can do it with the ‘longtable’ packet. or wait, you could use ’supertabular’, too, which does the same thing. or doesn’t it? and now that i come to think of it, maybe ‘ltxtable’ would have been the better choice in the first place, since it seems to be a combination of ‘tabularx’ and ‘longtable’… that stuff drives you nuts after a while and it takes ages to evaluate all your choices. all these packages are useful for something, but many of them overlap partially in their functionality, they all have specific requirements, and some of them are not compatible (combinable).
drum roll, flash, bang - enter xetex
the good news is that some of the problems i just described have been solved by the awesome jonathan kew, who came up with xetex. that software is an extension to latex that will solve 3 of my main problems: unicode support, easy image import (JPG, PNG etc.), and easy custom TTF font support. xetex was originally designed for macOS, but luckily, it will also run on linux. better yet, it has already been included into tex-live, so that it has found its way into debian and consequently into ubuntu, which means that a quick ’sudo apt-get install texlive-xetex’ will solve all these problems in a single swoop on my ubuntu system. i’ve been using xetex for about half a year now, and i’m so happy with it, there’s no way i would go back to using plain latex again. i’m actually tempted to look at xetex as a kind of latex3 (the real latex3 seems to be dead, AFAICS).
the right setup
in order to work efficiently with latex (xetex), you should put some thought into your working environment. first of all, it is a good idea to work on linux or another unix-like system where you have a decent console. personally, i recommend to use a SVN repository to store the sources for easy version tracking. if you work on different documents, i recommend to create a folder for every document, and a ‘common’ folder that holds stuff like bibliography files that you use for all documents. then, you write a Makefile for each document which will compile your sources, do any preprocessing, fetch files from the ‘common’ dir etc. in my case, i use a small preprocessor in python which will basically do some regex-replacements in my source files (for example, i use a shorthand expression for italicizing words: “engl. /hound/ and lat. /canis/” should be converted into “engl. \textsl{hound} and lat. \textsl{canis}”, etc.). also, you can have the Makefile call a pdf-viewer, so that a quick “make” on the console will compile your document and immediately show you the result. some people use fancy latex-editors, but i prefer to use a simple editor with latex syntax highlighting, and use the console for everything else. of course, tastes are different, but this is what works for me. if someone is interested, i could explain my setup in some more detail, and share my preprocessor, Makefiles etc., so let me know if that’s the case.
freaking long post, i hope it is of use to someone
further hints:
- please do me a favour and do not use latex’s default computer modern font. it takes only a simple “\usepackage{times}” in the header of your document to use a decent, standard font.
About this entry
You’re currently reading “latex,” an entry on doink.ch
- Published:
- 10.11.07 / 12am
- Category:
- linux, uni, historische sprachwissenschaft











3 Comments
Jump to comment form | comments rss [?] | trackback uri [?]