Hacker News new | ask | show | jobs
by walnutclosefarm 1265 days ago
I have a question: if what you have to write in order to create your beautiful and aesthetically pleasing proof, and thereby "establish your ethos and character" (presumably as a righteous and good), is an ugly and fragile instance of a poorly designed, inherently unreadable, archaic language that embodies none of the characteristics you are after, can the result really be "a work of art that combines both the precision and creativity of your logical thinking, as well as the elegance of a beautifully typeset writing?"
11 comments

> RE: ugly and fragile instance of a poorly designed, inherently unreadable, archaic language

That's a lot of hate for LaTeX, and some of it is warranted, but you have to think of the results, not the source... It's not the source code that people are in love with, but the result (rendered PDF or via MathJax/KaTeX on the web). The "ugly" markup syntax allows you to produce beautiful, versatile, well designed, readable, and modern math equations.

As for the latex source code, I think it's redeeming qualities are the fact that it is a standard (with over 40+ years track record). It's definitely not readable, or user-friendly (try adding or forgetting a single }), but people seem to get used to it after a while.

Another thing I could say in defence of tex syntax, is that it is necessary complexity. If it wasn't the backslash-macros and curly braces, we would need some other way to express structure in equations, so the same complexity would be present in a new look.

What a great summary! Unfortunately, many discussions of TeX vs alternatives are somewhat thin on details and are instead trading on emotions. As you mentioned in your comment, the choices made by Knuth are far from random. He even made it possible for anyone to change them! Not many people using TeX know that the choice of the backslash as an 'escape' character may be easily changed. Even the necessity of curly braces may be avoided using carefully designed macros. LaTeX took a different path but it is only one possible choice. It is telling that no real alternatives have emerged during the 40+ years of TeX's existence.
Asciidoc, TexMacs, LyX, reStructuredText, Markdown (admittedly, only ish).

None of them have become the standard. But some of the ones above - though excluding Markdown - are a complete replacement.

Actually, even Markdown stands a chance if supplemented with enough HTML and CSS. HTML and CSS have practically replaced most non-maths uses of Latex.

The way I see it, this only proves my point. As you write: '...None of them have become the standard...' and this is at the center of the argument. TeX may not be ideal but it strikes the correct balance to become and stay standard for so many years. One can do pretty much anything in bare Postscript (and I am ashamed to admit, I have) or even 'handmade' PDF but it does not make it a good alternative to TeX. I have experimented with alternative syntaxes (apologies it this is not the correct plural of 'syntax') but had to give all of them up due to a number of flaws. These experiments gave me a new appreciation for Knuth's choices.
I disagree. I think Latex will soon become legacy like Cobol.

HTML and CSS basically do a lot more than Latex does - except for maths things - and are far more widely known, and far more forgiving. Also importantly, they support hyperlinks, animations, and inline interactive scripts. It seems that HTML and CSS with the appropriate CSS styles and shorthands (like Markdown) could eat up everything that Latex does and much more. I don't know if Latex can survive the onslaught.

I have heard HTML/CSS mentioned as an alternative and I pray every day this time will never come. Even taking all the complaints leveled at LaTeX at face value, using HTML/CSS looks like pure hell to me. Allow me to elaborate.

1. You mentioned forgiving. One may not like the style of TeX error messages but its tracing facilities are extensive and given enough time and perseverance one can track nearly any layout issue down an correct it. Compare this to CSS silently ignoring incorrect syntax, having different syntax across browsers, etc. I would take strict syntax checking over this mess any day.

2. Many complained that LaTeX has more than one way of achieving the same result. True but how many ways are there of centering a div on a page? I can list six off the top of my head and there are probably more.

3. You casually mentioned '...except for maths things...' but this is far from minor. I cringe when I read engineering papers not written in TeX: the formulas are so ugly that they border on unreadable.

4. CSS may be wider known but unlike TeX CSS is a moving target. Being designed by a committee it carries all the flaws, like kludgy design in the name of 'compatibility', poor choices of syntax to make it appeal to a wider audience, etc. The designers of CSS are so enamored with the 'cascade' but in practice it is rarely used as intended. The 'important!' kludge as a perfect testament to this.

5. LaTeX syntax may be unappealing to some but HTML takes it to a whole other level: whitespace that affects the layout yet no easy way of getting rid of it (HTML style comments are a torture device); too verbose... one may not like the backslash but what about <...> </...> ? Five extra symbols!

6. LaTeX engines produce full featured PDF so hyperlinks are not a problem (most LaTeX documents have them). Yes, CSS has so called 3D graphics but it is anything but programmer friendly. What good are 3D transforms if one cannot even use simple lighting effects programmatically; c'mon, at least give me Lambert reflection! Incidentally, inline JavaScript can be included in pdf documents produced by LateX as well (although ... why?)

> I think Latex will soon become legacy like Cobol.

LaTeX’s usage has only increased with the creation and growth of the web. What makes you think it’s going anywhere?

The “except for math” part is doing a lot I think. There’s a huge amount of work needed to get rendered math to look as good as latex’s and I’m not sure CSS (as an example) is expressive enough to get this done
Or HTML syntax will become legacy

People are write something like Kotlin html dsl

How many of those rely on LaTeX syntax extensions to render equations?
The LaTeX formula language is a separate thing from the rest of LaTeX: It's become the standard for formulas. There are some editors that can speed up writing those formulas. Asciidoc also offers an alternative formula language.
I can't speak for most of them because I haven't used them, but I know that TexMacs doesn't use LaTeX under the hood.
None of those are a complete replacement, except maybe Lyx, and it’s based on LaTeX.

> HTML and CSS have practically replaced most non-maths uses of Latex.

Huh? You must be totally ignorant of the uses of LaTeX.

This comment makes me see red.

First of all, this:

> None of those are a complete replacement, except maybe Lyx, and it’s based on LaTeX.

Source: Your [censored].

> Huh? You must be totally ignorant of the uses of LaTeX.

Outside of academic papers and books, what?

> It is telling that no real alternatives have emerged during the 40+ years of TeX's existence.

But what does it tell you that such an ugliness remains and the way to fix it is relatively unknown? It surely can't be a pro-TeX tell!

It tells me that beauty is in the eyes of the beholder, i.e. what one may perceive as ugliness, countless others will view as beauty or, at least functionality. I personally think that the ugliest design in existence is Python but I admit my opinion is not common. Moreover, I use Python myself, since syntax is not the only important thing in a language (the ecosystem is Python's undisputable strength). It is also unclear to me what specific 'ugliness' in TeX is fixed by, say TeXmacs. Is TeXmacs internal language dramatically (or any) better than TeX? Does not seem so. The WYSIWYG option? There are WYSIWYG editors for TeX as well.
"here are WYSIWYG editors for TeX as well." not there are not. Apart from TeXmacs I know of no editor which give you on the screen the same result you get on the paper. LyX has not such a feature. If an approximation is ok, then fine, but I do not think you can call it WYSIWYG. Is something else. And it requires a lot of work to do it correctly. You should at least appreciate the technical merits, even if you prefer to use LaTeX for its ecosystem. But as a user of both I see the clear merits of TeXmacs in terms of quality of my work (mathematician), I can focus more on what I'm doing, instead on deciphering the mess of the LaTeX formulas and try to find where to put a correction. I can give online lectures with it, discuss on zoom while scribbling on a TeXmacs document, much of the work I was doing on paper I do now directly on the computer. To me there is a clear difference in the user experience between TeXmacs and LaTeX and I will never go back to write LaTeX if I can help it (I do it sometimes, if my coauthors are using it and do not want to try otherwise).
As a fellow mathematician you may then appreciate the fact that local and global maxima may differ dramatically which pretty much precludes true WYSIWYG (not just in TeX) in that you have to settle for one of the two: visual output with suboptimal aesthetics (TeXmacs, and, to some extent, LyX) or perfect results that you have to compile with some delay. It has nothing to do with the computational power available but rather with the occasional highly unstable line breaking. Even in MS Word it is annoying sometimes to see it resize a current line even though it uses a rather lame line breaking routine. TeX does have facilities for almost real time WYSIWYG (SyncTeX was added specifically for that purpose) although they take some effort to set up. As far as concentrating on the work at hand I have written whole papers without compiling the document once before everything was complete. I admit it takes some getting used to but I prefer something I can grep through to a mere pretty picture. I admit if my work was heavy on large commutative diagrams I might have had a different view. One thing I totally agree with you on is that TeXmacs is an outstanding piece of software. I would just prefer to keep my documents in TeX (which TeXmacs can export, kinda).
In my experience, that’s not entirely true. Some of my mathematician friends claim that they (and other people they know) often rather read the source code than the type-set result. I’m inclined to believe it because the biggest problem with LaTeX (to me) is jumping between the source and the result while editing, especially when formulas are involved. (Syncing tools help, but they’re far from perfect.) So it is often more convenient to just work with the source but this leads to problems where mis-typeset formulas don’t get recognized because too little time is spend with the result and they look fine in the source. And then people start reading the source code of other people’s papers because it’s more understandable, making the whole thing absurd.
> you have to think of the results, not the source

You can. But it's equally valid to look at the source and say "this should have been replaced long ago"

Which is really has, except for tiny markets.

No reason it can't be improved on drastically.

but the source is the problem. When you work with 100+ latex files and it is so difficult to reuse the code and every variable is in a giant global scope, you would waste so much time just to trying to figuring out how it works.
> That's a lot of hate for LaTeX, and some of it is warranted, but you have to think of the results, not the source

I cannot think of the results separately from the source. I am not wired to appreciate Potemkin beauty.

In this case, of course. The final product (the document), once produced, is much more independent of the underlying code than "normal" software. Once the document has been produced, it doesn't really matter whether you used Word or LaTeX or ConTeXt or whatever.
Until you have to change, quote, or re-use parts of it, in another document.
There are tools (i.e https://mathpix.com/) that actually does a pretty great job at LaTeX OCR, although you'll need to re-create labels and the like. I was pleasantly surprised that it replicated alignments & chose the right font faces while using it.
As ugly as it may appear to you, it is so much more readable than MathML Core.

TeX is, in fact, still better than all the alternatives to represent mathematical equations in plain text created so far.

MathML is not a writing format, it is an output format that is designed to be machine readable.

And I think most people complain about the non-equation parts of LaTeX.

I guess readability is in the eye of the beholder, but I find latex much more readable than html and usually more readable than reStructuredText. Markdown might be more readable, but it's so limited it shouldn't even be in conversation.
I am still looking for a text markup system that gives me good PDFs with DTP-grade text setting and and is plain-text, so I can work with standard version control programs. Right now, only TeX/LaTeX comes close. AsciiDoctor is not doing citations well, Markdown is basically a mess which differs in implementation, also footnotes and citations.

Do you have something better?

I think (though I can’t find a reference) that Knuth hoped that some of the algorithms developed for TeX, such as the hyphenation and line breaking algorithms, would catch on and be used by other, non-TeX typesetting software. If that has ever happened, I a unaware of any examples. That’s a pity.
I don’t have an opinion about whether they’re better or worse, but have you tried groff or heirloom troff?
How is Quarto? It uses Pandoc Markdown.
There was a discussion about that last year [1]

[1] https://news.ycombinator.com/item?id=30042831

Generally agreed, writing should be a tool that supports clear thinking, and a giant mess of unreadable markup is not amenable for thinking.

I’m still reading through this post, but it seems to have some great advice for making that situation at least a little better, like the trick with mathtools to make paired braces more readable

I collaborate with some academics that strongly prefer to do all writing and editing in MS Word, but I’ve personally found that to be a lot worse for supporting clear thinking, especially if any math is involved

TeX is not unreadable. It's hard to automatically parse, but it is easy to read by a human, unless the authors have been piling hacks and too-smart-by-half constructs. The latter case happens every once in a while but is generally pretty rare.
I find writing LaTex is like painting a beautiful sunset using pig’s blood. The results are beautiful, but don’t look behind the canvas or too deeply into the artist’s mental health following that.
LaTeX is robust enough and has a consistent enough interface that with some macros and snippets you can take real-time notes of people giving graduate level math lectures on a blackboard. If LaTeX is ugly, it's in the same sense as APL is "ugly".
Well no, but LaTeX should be backwards compatible with TeX so there's always that option.
Great question! Is there a specific domain/example that you have in mind? I don't think people intentionally use archaic language if their goal is to educate and enlighten, but in papers it is quite common for unnecessary jargon to be peppered in, which while probably obvious to the author, makes it hard for people new to the field to break in.
Realized I misunderstood your question. IMO the main design problem with LaTeX from a usage-standpoint is that there are too many ways of achieving the same thing, and oftentimes none of them is a clear winner. It's still the best option for a usable, programmable typesetting language that we have (i.e writing for-loops to draw structured graphs in TikZ...)
My personal beef with LaTeX, other than the utterly atrocious syntax, is that it a.) endlessly barfs on your terminal during its normal operation and b.) does not respond to normal terminal interaction upon an error (wth is it expecting? I interactively edit and correct mistakes!?). So it's scroll blindness and flailing all the way, a kludgy, rickety mess. Not to mention its utter mess of a package management system.
It should be noted that TeX wa s of course designed to actually be interactive and stop letting you fix errors.

I went through the texbook by Knuth last year and my eyes were opened (also note that I am an incurable (La)TeX fan so my opinion is biased)

For the terminal output issue, consider latexrun https://github.com/aclements/latexrun
You're crapping on a thing that Knuth and friends made and gave you for free.

Are you about to go write something better?

I don't think the fact that Knuth wrote it and gave it away has anything to do with the question I was asking. If anything, the fact that it's free may contribute to its ubiquity and longevity, notwithstanding its poor design and other undesirable characteristics.

But none of that was the point of my question. The article on which the original post was made was effusive about how elegant and beautiful LaTeX output is, and how virtuous an author is for creating such works of art. It almost made it an obligation of anyone who writes math to love the look of LaTex. I'm asking, notwithstanding the output, if the input and process are a mess, is this really such a virtuous thing?

I personally think not. Obviously, some others disagree.