nihil architecture blogs

content

Why I dislike LaTeX on a fundamental level

LaTeX is pretty much the standard for publishing mathematical documents, a pretty old standard too, and one I dislike on a fundamental level, already I should have acquired copious amounts of nerd-rage by writing this, but you know it turns me one when you guys are mad at me.

My main dislike is hardly the quality of the output—though that could really use some work too, despite what the liberal media may tell you, it’s far from the quality of a professional typesetter—it’s the language used to specify the output. The language to me is so daft and devoid of any reasonable thought, it feels like gotos all over the place again.

The year is 2010, Dijkstra has won, few modern languages still support the goto, those that do often require the code to have special privileges and/or be explicitly placed in some ‘unsafe’ clause. However there are more things to healthy programming, say I’m programming some code which does some-thing with prime numbers, tries to find some pattern in it, just hypothetically, say that initially, I’m not that ambitious, and I investigate only the first 1 000 000 primes. Afterwards, I’m on a lead and I want to scoop it up a notch and go for the first 10 000 000, surely, if I programmed it scalably, I would only have to change the number 1000000 to 10000000 once in my code and the rest adapts right? If I run a gravity simulator, say I want to then try it for two times as much gravity? If I programmed this well I would have to change that number only once right? If I make some program to output a web-page, and I suddenly decide to output XHTML instead of HTML, surely if I did this well I would only have to change one switch some-where and the rest follows?

Okay, so let’s port this idea to LaTeX, a real life example, a friend of mine was once collaborating, he used em-dashes in his version, his parter thought they were too prætentious, so he changed them to commata. He had to edit every single em-dash, a simple substitute didn’t work because it turns out they used --- in more places than em-dashes. It was a frustrating task I can imagine. Now, it’s quite possible to just use \medium-pause every time and let this be output as em-dashes or as commata at one’s pleasure. But this is seldom done, and LaTeX certainly doesn’t make this very convenient nor encourages this. Another quite simple example would be that you’re writing some-thing which uses the speed of light, and in a second edition you find out that the symbol conflicts with some other symbol in the same formula, you’d wish you had used s_l there or some other thing instead of c the entire time, now you have to edit it, probably missing a few, and introducing errors. In my world, I would have used some-thing like [lightspeed] from the start and bound that concept to a symbol at only one piece in the entire code, which is then easily changed. Alternatively, you might find out your publisher’s style doesn’t really like dots and wants crosses or spaces for multiplication, you’re stuck on editing that. You could just search and replace, but of course you want to check. Isn’t it easier to just specify multiplication each time and define the symbol associated with that at some higher level?

Another part we’re always getting hot about is re-use of code, Two or more, use a for!, LaTeX isn’t particularly friendly about this thing either, often you will find multiple æquations which re-use some basic concept into it which often leads to copy-ing and pasting of text. I once learnt that as soon as you copy and paste your code, you’re doing some-thing wrong and I agree with this maxim. Consider this simple example:


$\land$ and $\lor$ distribute over each other, more formally:
\begin{eqnarray}
x \land (y \lor z) &=& (x \land y) \or x (\land z) \\
x \lor (y \land z) &=& (x \lor y) \land x (\lor z)
\end{eqnarray}

Splendid, I’d rather just use:


\mutual_distribution(\land,\lor)

And define once how this is output, and then be done with it. I can change that template once then later if I want to make some changes. I’m to be honest surprised that LaTeX automatically enumerates your æquations for you and you don’t have to do that yourself. And yes, it is possible with some hacking around to make such a template, but the syntax for it is so limited and confuzzling that almost no one does it, and it almost makes things less readable to begin with. I tried and I tried to make this happen a little more but the language was quite clearly never designed for it that well, and it’s madness and pain.

LaTeX lacks a \Beta on its own, quite obviously because it looks visually the same as B so why bother? Well, even if you were a dusty computer scientists who has a fetish with not keeping his mind ordered, it still begs the quæstion in what typeface?, it’s not unlikely that a typeface exists which for clarity puts Greek letters in a slightly different makeup, and I would not think this would be a bad idea, differentiating A and ? in various manuscripts can be very handy. And this requires extensive workarounds in LaTeX, to be expected from a tool coming from a time which prided itself on writing all possible code with the mentality of not looking ahead and taking into account the future. LaTeX code manages to be a reasonable write-only language, an impressive feat considering you don’t even have to mentally follow the flow of computation, that its commenting syntax is so verbose that it discourages people from using them might be another part of the problem.

Another thing I don’t like is how it enters and closes math-mode, sure, if math-modes can’t nest? Why not take the same open and closing tag right? I am sure to speak for all of us when I say that never has debugging been such a pain as LaTeX incorrect LaTeX math-mode closing, the error messages are so enormously cryptic by misplacing a dollar sign that you often have no idea exactly which it is you misplaced and often when you got it to work you still have no idea what you did wrong. It’s like rebooting your computer when some-thing went wrong and you’re still not exactly sure on how you fixed it. It turns out that closing tags help error messages and help you find them. Maybe this is Donald’s savant mind speaking who makes no errors, but for us mortals this is damned annoying.

It’s quite clear that the base of this language was designed in a time when people were practically still cave-men scratching COBOL code in granite walls to keep track of how many mammoths they hunted down.

Finally, on a more meta-level. LaTeX, well, just PDF or Postscript really, defines a lot of things which I feel a document ought not define. Yes, they are languages to specify the layout for a printing place, every pixel, every vector, and I feel that the only thing that should ever receive that data is the printer, or the person who checks it before it goes to the printer. The consumer should never receive that on his or her computer. Things like font size, font type, letter spacing, colour, text width, line spacing, these should all be properties of the viewer not of the document it reads. Supposedly LaTeX is about legibility, and it has used some archaic myths about what is optimal legibility to algorithmically force that down our throats, in reality probably more Donald Knuth’s præferred style. In the end, legibility is subjective, dependent on person, varies through locus and time, has a genetic and an environmental component, what one person considers legible another does not. So people should be able to adjust those settings in their viewer, computers are powerful enough to calculate that on the fly nowadays. Especially since e-readers are coming up, why not use that advantage?

Some people have already done this, it’s called separation of præsentation and content, take apart what you are saying semantically, and how you are layouting what you say for the most part as you can. It’s scalable, it takes into account that the house style of the publishing magazine may later on change, it enables the same document to easily be published in multiple styles depending on the target audience, it also gives the audience itself control over the style if they receive it in digital format, and so on. I for one hate with a passion that new misodendric hype of basically 1 em line spacing in papers. I’m still not really sure if they actually hit enter twice after every line or make some switch that does that automatically for each line, but as they use LaTeX I would not be surprised if they actually accomplished their treeslaughter by the former. Every time I see it, I would kill to have my PDF viewer implement a simple switch that could take that away, it reads both annoyingly and I’d like my grandchildren to have a plentiful supply of oxygen.

Attire and work

Okay, so let’s say you have to be operated. You go to meet your doctor, he shakes your hand, he’s friendly, he makes a little small talk, tries to ensure you that it’s not a big deal, that this operation is routine work for him and that he’s done it for years and the risks are really quite small, he’s friendly, and he seems genuinely concerned for your well-being. There’s just one catch.

He’s some-one who look to be in his twenties, and he has long, green hair and an eye-brow piercing.

Now, as you go to the operating table, you see him there again, he’s removed his piercing, his hair is tucked back, he’s wearing his white coat, his gloves, and he’s wearing an operating mask and all that good stuff. Obviously none of this interferes with his task at hand.

However he’s still a youthful bloke who’s got long green hair and an eye-brow piercing when he first introduces himself to his patients. The quæstion at hand is if people can, or should, be able to be refused for a job like this regardless of meeting all other qualifications because they don’t radiate the authority with that that they should.

Where-ever you go, laws regarding this are opaque at best, the concept of ‘discrimination’ is vague and arbitrary. Discrimination was illegal when it was legal to not hire women into executive functions because they didn’t radiate authority enough. And it is still illegal this day while for a lot of legal things the only qualification one needs is to be older than a certain age. What is ‘discrimination’ and what is not, is quite simply just translating the mass consensus of the people about ‘how far you can go’.

And quite obviously, there are a lot of people who would not feel that women radiate enough authority to be able to be a doctor. However not hiring women because of that rule is out of the quæstion in most western countries these days, that’s ‘discrimination’. And of course being a woman is irrelevant for one’s capabilities as a surgeon. Just as having green, long long and an eye-brow piercing is. However people grow a lot more sympathetic to requiring doctors to change that, because people might not feel safe then. Even though obviously it’s just conceding to their præjudices.

Of course, there is a fundamental difference between being a woman and having a piercing and green hair, you can change the latter easily, but not the former. Or is that entirely true? Quite absurdly one can say: ‘You can also change your sex!, and that’s quite true. But of course, a very big sacrifice to make for most people to be a doctor. But perhaps not bigger than for some people to live their lives in a hair colour they do not like just because some people are small-minded bigots?

Piercings and green hair are again different, you can take out a piercing quite easily, but to die your hair back and forth from every interview is quite cumbersome, to cut it and let it re-grow is again completely impossible.

But this is all still the public service. Let’s say you are a commercial entity with a for-profit raison d’être, if the law would require you to hire women, even though the sad reality is that hiring women in certain positions will simply mean less profit—then you’re stuck with that. You might even think that this is a sad thing and honestly want to give these woman a chance to prove themselves, but the reality is that you’re primary responsibility as a ceo is delivering profit to your shareholders, and not hiring women accomplishes that. You cannot let your political convictions interfere with your job, so to speak.

As said, what the law requires and what not of employers is opaque. However it seems to have been established some-what by præcedence that sex and ethnicity are not a quality you cannot hire people on. Even though it will eventually hamper your profit because the world is simply filled with small-minded bigots. You can also argue that this has a good reason, as you cannot (easily) change these qualities of yourself. It’s imaginable that you for same reason also can’t disqualify short people on the argument that clients are simply still small-minded bigots.

But it seems to go deeper than that. Long hair poses a risk in various job situations, but women seem to never be required to cut their hair short even though it could hamper their performance. Women simply in various cultures conventionally have long hair, and you can’t ask them to cut it, because it would be seen as quite hard for a woman to live without long hair should she desire to have it.

However, say you’re a male waiter in a classy restaurant, it’s quite imaginable that they require you to cut your long hair. Admittedly it hampers with your job performance, and not even for a tangible reason, but only because the world is filled with small-minded bigots. But because it’s ‘unconventional’ for males to have long hair, this can be required of them. Even though some security risks that are far more important cannot require women to cut their hair short. It would be unsurprising for me if some men have just as much troubles having short hair as some women. This can also be a cultural thing though, indeed, to ask a Sikh to cut his hair, a thing his religion forbids, is again more complicated.

A fundamental difference between public services like health-care and commercial things is though that health-care is seen as a right provided free of charge, at least in the civilized world outside of that isolated greatest nation in the world. While those commercial things are privileges you pay, if you pay for it, should you not be able to demand that you are assisted by some-one who is not a foreigner if you so please? While if it’s a thing the government provides free of charge, you have nothing to complain, take it or leave it. If you don’t like it, then try to pay a doctor out of your own pocket.