Apr 23, 2012

setting type

or, rather, TeX. or, actually, LaTeX. what does someone who doesn't write equations need latex for? the awful truth is: i switched to latex so that i could automatically set old-style numerals. also, it is always nice to separate content from representation and data from metadata (as anyone who has ever had to clean up a word document's formatting will tell you).

latex (built on tex) is a document production system. its chief virtue is in separating content from representation. there is no way to do this without a) thinking through the structure of the document, b) learning how to represent the structure abstractly (ie, structural markup), then c) writing documents separately from how they will appear in finished form (but marked up for structure).

every production system involves massive up-front investments of time (the so-called "learning curve") before the palmy days begin. latex was no different. i spent many tasty hours learning how to insert images, write tables, rotate tables, control linespacing, etc. then, for more typographical control, i added the fontspec package and xelatex. this broke some environmental parameters, which required debugging. did i mention how some typefaces don't have correctly coded glyphs and don't work as expected? (= more debugging). then i decided to go for broke and move my citation database to bibtex. this consumed many more tasty days. now my papers look great, i cite effortlessly, and it's usually all just peachy.

my latex distribution is miktex (2.9). my typeface of choice is minion pro (it handles oldstyle numbering, is readable in block text), and i use the article document class. to handle graphics, i use the graphicx package. for typography, the fontspec package. for tables, the tabulary package. for citations, the natbib package. other miscellaneous utility packages include rotating (to rotate things like tables and figures), booktabs (for high-quality table formatting), and endfloat (to automatically move all figures to the end of a document; endfloat requires a separate configuration file in the source document directory if it is used with rotating).

i renew the quote environment to change the linespacing inside blockquotes. i manage my citation database with jabref and add new citations either by hand (if my citations come single spies) or by importing from zotero (if they come in battalions). i compile by running xelatex, bibtex, then xelatex twice more. (it took a long time to figure out how to get the commands to call the right input files, and that the \bibliography command requires filenames with extensions on some operating systems and not on others.)

then, a dark moment. in the late stages of preparing a manuscript for submission last week, i ran into a problem: the journal calls for an idiosyncratic reference style and provides no style file. two options: rewrite a style file to suit, or generate a new one. let all of us who have been in a similar quandary but lack extensive experience with stack languages thank the creator of this custom reference style maker. you answer a string of questions, it generates a file that you can then compile into a style file (.bst). this took a bit (well, no, let's be honest: hours and hours) of tweaking to get 98% right. (remaining 2%: do you know how i can force a linebreak between the author block and the year block and a tab character between the year block and the rest of the citation? if yes, please email me.)

"triumph!" i thought. but wait, .pdf files are verboten for this journal's submission machinery. fortunately, .ps files are ok. a simple matter, you might think, to take the .xdv files from xelatex and use dvips to produce a .ps file. except dvips doesn't work with .xdv. xpdf's pdftops converter saves the day (though erratic, it is the least temperamental and the one that copes best with transparency in the source pdf).

there must be a better way.

2 comments:

Ben said...

wow.

vaughn tan said...

i could have spent the time on ... something else. but i didn't.