41 comments

[ 1.4 ms ] story [ 92.4 ms ] thread
No wonder Knuth hasn't gotten around to writing the parsing chapter of TAOCP.
[flagged]
I don’t think anyone disputes that it is possible to typeset documents like this in Microsoft Word, given sufficient effort. But in LaTeX, I can create documents which look far better than this with far less work. It’s not simply a matter of ‘disliking mouse-and-click’: LaTeX is designed for high-quality typesetting, in ways which Word is not. (To take just two examples, it enables kerning and ligatures by default.)
Kerning and ligatures in Word: Simply CMD+D (fonts) and enable anything you want.

My point is the marginal benefit of using Latex to make documents slightly prettier is negligible. The focus of the researcher should be on the content.

Don't use Latex for 6 months and see if you still remember all the necessary syntax.

> Simply CMD+D (fonts) and enable anything you want.

Like I said, you can do it. That’s why I said ‘by default’: the defaults clearly show how LaTeX is optimised for high-quality typesetting to a greater extent than Word is.

> My point is the marginal benefit of using Latex to make documents slightly prettier is negligible.

I disagree with this: it’s not just a matter of being ‘slightly prettier’. I will make the claim that, if you care about typography, LaTeX is easier to use than Word. Given the same amount of time and effort, a document created in LaTeX will look better than one made in Word.

For instance, take the paper you linked. You mentioned that, in order to create it in Word, you needed to make ‘lots of Word styles’, etc. etc. By contrast, simply retyping the text into a minimal LaTeX document will result in an output which is as good, if not better. I’m not going to bother wrestling with Word styles and whatnot, if I can create a far better-looking document in LaTeX with less effort.

> The focus of the researcher should be on the content.

And it is, when I use LaTeX. The whole point of LaTeX was always to separate design from content, and I feel it succeeds pretty well in this.

> You mentioned that, in order to create it in Word, you needed to make ‘lots of Word styles’, etc. etc.

All of that is done just once (one fixed cost). I've been using the template for years now.

I think it's a matter of taste as well. I prefer WYSIWYG; Tex users prefer to see this instead:

    \documentclass{article}
    
    \begin{document}
    
    \begin{itemize}
        \item \textbf{TEXT}
              \begin{itemize} 
                \item TEXT \textit{TEXT} TEXT
                \item TEXT \textit{TEXT},$\Phi(\lambda$) \textit{TEXT}
              \end{itemize}
    \end{itemize}
    
    \end{document}
I was a systems phd, so the amount of math I used in latex, was minimal. In practice, i used very little of latex's features, and what I did, was kept in a small text notes file that I could copy/paste from as needed (i.e. inserting an image / table mostly).
That's why I use Lyx. WYSWYIG-enough like MS Word, but still can resort to good old Tex when needed. Sure, some documents are easier to write in Word.

My personal experience with TeX is kinda similar to HTML: you still remember some parts even if you don't write it for many years...

Because you can put your (La)TeX documents in source control, split them up like you would with code and assign different authors to different chapters or section, without disturbing each other or having to worry about merging the document later.

One of Words big issues is that very few people know how to use it. It's such a massive program, with an absolutely insane feature set. Still you see people manually doing stuff like setting font size to do headings, rather than actually using the feature to set and style headings, but now they can't use the automatic index, so they also do that manually. It's also funny to me that companies will complain about UI changes, because that will force them to retrain staff, but most companies don't do training on Windows, Word or Excel to begin with.

LaTeX is stable, most people I know who still use it have templates they made at college and they've been using them for 20 years. They can just sit down and start typing, not having to worry about leaving their preferred editor or styling. Anything can be looked up in their old worn out copy of "The LaTeX Companion" (To one with the St. Bernard on the cover. Retraining to use Word would be a major hassle.

> One of Words big issues is that very few people know how to use it. It's such a massive program, with an absolutely insane feature set.

This seems equally applicable to LaTeX, though, at least once you start adding in a handful of modules. Like with Word, most people I know seem to learn the subset of LaTeX that solves their immediate problems, and then have to Google random snippets for anything outside of that range. You say people have templates that they've used with no changes for the last 20 years, but in my experience that's because they don't remember how half the things they put in there work, and so any change would take days to implement.

I think LaTeX is a great example of the difference between inherent complexity and added complexity in software development. Typesetting is an inherently complex problem, and LaTeX is excellent in that solves this problem very well, although to a certain extent users of LaTeX will always need to understand that complexity somewhat - it is inherent in the problem they are dealing with. But it also creates added complexity by providing this solution in the form of the TeX language and the various macros and components that make up LaTeX. This added complexity is not needed to solve the inherently complex core task, but the best tool to solve the inherently complex task includes this added complexity.

I don't mean this comment to be a defence of Word, which has its own issues. And I love reading a well-typeset document, and LaTeX does an excellent job of that. But it is also the sort of software that is long overdue a replacement.

I think you're absolutely right, but you do have to learn a subset of LaTeX to get anywhere. Words doesn't require you to learn anything to start typing, which will prevent you from actively using many of the features within Word. At least with LaTeX you're less likely to start out on the wrong foot, but you're also more likely to not start out at all.

But there's certainly a good amount of cargo cult in many or most LaTeX templates as well.

1. Justified text without hyphenation is a quick recipe for very odd-looking uneven spacing, like in your example.

2. The inset used by the headings is jarringly big.

3. The text is too wide for comfortable reading.

4. The fonts used in the body and in the figures don’t match.

Other than that, it’s probably the best-formatted Word document I’ve seen.

I wouldn’t want to use Word, because in my experience even outside of maths its UI is working against me. In particular it’s hard to recreate the same document in two different major versions of Word. The spacing, the sizes are always off. Moreover, I don’t like how formatting is very sticky based on where you position your text cursor. I constantly need to disable styling copied from some text nearby.

It's a shame that TeX the great typesetting system comes with TeX the ungodly complex language. There's literally no chance to create good tooling for TeX because of this. There's very little chance to optimize rendering of large documents because of it (e.g., by automatic parallelization). Finally, there's never going to be a readable error message from TeX.

TeX the language is the prime example of gatekeeping.

OTOH, no one has ever succeeded in creating and popularizing a context-free language that compiles to TeX.

> Finally, there's never going to be a readable error message from LaTeX.

FTFY. If you learn TeX from Knuth’s TeX book, along with the typographical concepts it works with, the error messages generated by documents written in raw TeX are understandable.

LaTeX on the other hand is what the metaprogramming-heavy Boost/STL libraries are to C or C++. Abandon all hope.

> If you learn TeX from Knuth’s TeX book

https://visualmatheditor.equatheque.net/doc/texbook.pdf

+1 on this.

That book is fantastic, one of my favorites. It's been a couple of years since I last read it, and your comment reminded me that I should probably skim again.

Except that PDF shouldn't exist since it was generated in flagrant disregard for the copyright/comment:

    % This manual is copyright (C) 1984 by the American Mathematical Society.
    % All rights are reserved!
    % The file is distributed only for people to see its examples of TeX input,
    % not for use in the preparation of books like The TeXbook.
    % Permission for any other use of this file must be obtained in writing
    % from the copyright holder and also from the publisher (Addison-Wesley).
    \loop\iftrue
      \errmessage{This manual is copyrighted and should not be TeXed}\repeat
If you want a free PDF on TeX try _TeX for the Impatient_:

https://tug.ctan.org/info/impatient/book.pdf

If you want a copy of _The TeXbook_, buy it.

I love the subtle humor in misusing “copyright” as a verb and then misusing “TeX” the same way.
Yeah, I always used plain TeX back in the day because I could understand it. LaTeX always seemed unnecessarily complex.
One of the things I decided to do with finl was to formalize on LaTeX’s syntax. No more shifting category codes, Separating out the lexer definition of commands from their meaning also means that tooling becomes simpler. Throw in proper variables so there’s no longer the need for redefining macros to emulate variables and it becomes a little more tractable.

That said, even with these restrictions, writing a good lexer/parser of a LaTeX-like syntax is still a challenge (and made all the slower by the needs to earn money, spend time with my kids and have other joys in life).

> It's a shame that TeX the great typesetting system comes with TeX the ungodly complex language

You hit the nail on the head. Brilliant design of the typesetting system, not an ergonomic language.

I think over the next few years Scroll (https://scroll.pub/) will become the language all academics use to publish papers.(Or another markdown like alternative, but ours will be _very_, _very_ good)

You are always in an ergonomic, simple, fun, forgiving high level language (Scroll), but then you can dip down into TeX whenever you want for its beautiful 2D math rendering (thanks to KaTeX library).

We don't have great automatic whole document PDF generation yet (you still have to manually save as PDF from your web browser), but we will get there.

If anyone really wants this please shoot me an email--fun to get more passionate beta users that can help us steer priorities and build something free and great for paper writers all across the globe.

People say TeX doesn't have good tooling but I can't think of any other language where I can seamlessly intermix circuit diagrams with equations and plots. It's really nice to be able to draw on an axis coordinate system (pgfplots with TikZ), as an example.

The language itself is horrible and the skill floor is too high but the Turing completeness enables a ton of wacky features that would never be allowed in something like Mathematica.

I think you're misunderstanding what "tooling" means here. Even determining what line (or even file!) in your document is the source of an error or warning is sometimes a nightmare.
I don't think a language is complex just because it's not context free, since any language that supports syntactic macros of some sort are not context free. Neither M4 nor C++ are context free, but C++ is usually considered more complex than M4.

Still, multiple parsers and great tooling exist for C++, and the error messages have gotten much better in recent years. This is probably because companies needed them for different reasons, and they have the resources to build alternatives.

> TeX the ungodly complex language

A friend, although he is a good mathematician, kept criticizing TeX, so I explained one view of it: TeX was not intended to be some new big steps forward in interactive user interface, to replace Microsoft's Word, HTML or Mathematica, or for making images or movies. Instead, TeX was, first, for something he knew well -- the journal of the AMS (American Mathematical Society). For doing the word processing for the AMS, TeX was a nice step forward from what went before.

TeX seems fine to me, just the way it is. Started with Knuth's book and also got his file of TeX source his book. The book is easier to read, but with my favorite text editor KEDIT sometimes the file is easier to search.

Also with the TeX software have the Windows program to display the formatted output on a screen and the program to write the output to a PDF file. Both work fine.

It appears that Knuth made commendable efforts to get any bugs out of TeX.

Wrote some macros for TeX: The main collection has, just checked, 86 macros. Also have macros for some special purposes, e.g., foils, inserting images, verbatim, business cards, etc.

Use TeX for business letters; used TeX for the last paper I published: The paper had a lot of tricky math notation, and TeX handled that well. The journal seemed quite pleased to get the TeX input with my macros; then they were able to format the paper right away.

When rusty with TeX, my old papers, letters, etc. and macro collections get me productive again quickly.

Since I like TeX so much and since the philosophy of LaTeX seems different, never used LaTeX.

Knuth's book shows that it's possible to write long documents with TeX.

More importantly, TeX resulted in the concept of "Literate Programming" as exemplified by the books:

_TeX: The Program_

and

_METAFONT: The Program_

I've found that LP allows me to be successful working on projects which are more complex and of greater length than other tools allow me to --- worst case is I find myself reading through a nicely typeset hyperlinked PDF until I understand the code I need to modify and am then able to control/command click to go right to it in the editor.

I've been trying to put together a list of Literate Programs published as books:

https://www.goodreads.com/review/list/21394355-william-adams...

Knuth's "Literate Programming"???? NO WAY!!! Not a chance!! I won't mention that one!!!! It appears that all the overt, happy, productive literate programming people get banished to, to where, to, maybe, Antarctica, under one of the ice sheets, naw, the back side of the Moon!!! E.g., for a sample of just 1, the little piece of code I'm working on now, just had my favorite text editor KEDIT count, has (hush, secret) 387 lines of comments in a file of 840 lines. And one of my worst transgressions of solid, world-wide norms, I have no undefined technical terms or acronyms. And for this code, I have an external document on the architecture -- for that transgression, could be sent to Pluto???
I wish that I was a better programmer, so could be a better advocate for this programming style.

I wish that there were more standard tools for it --- it kills me that I couldn't find a nice .layout for doing Literate Programming in LyX w/ arbitrary programming languages.

I'm just glad that my using this system lets me overcome hurdles/complexity beyond levels which previously posed insurmountable stumbling blocks --- at a previous job there was a typesetting back-end for phone book ads which I had written in LaTeX using a documented TeX file (.dtx) --- once a year or so they would sell a license to a new customer and I would have to update it to their needs, and every quarter or so there would be a bug report... being able to read through the code would quickly get me in a place where I could fix things and then move on to the next task.

Current effort is at:

https://github.com/WillAdams/gcodepreview

At some point in time I need to look into if using Lua would allow some niceties such as per-file line # tracking...

Some people say that TeX lacks tooling the same way that people say that of ASN.1. Those are the people that then go on to reinvent the same thing badly, like ProtocolBuffers (which is remarkably similar to DER but with different syntax).
One of the things which Knuth expected was that folks would take the TeX source code and create customized versions for specific typesetting tasks.
If you were willing to live with a Turing-complete grammar in a general purpose language, I wonder how it would ideally work and what you’d be able to gain in trade.

Sort of a supercharged version of Lisp reader macros.

We already have that: Forth.

The above sentence can be a Forth program. This? Another Forth program.

What does my post do? Run it to find out!

> OK

METAFONT is another macro language where everything is context sensitive because macros redefine everything. But METAFONT has a BNF grammar that describes the language after the macro expansion. Perhaps the problem with TeX are the catcodes, that redefine at runtime how every future token is interpreted even after macro expansion?
I'm a fan of most of what Knuth has done, and in particular I love the high quality _output_ of the TeX family. But TeX's language is extremely difficult to use. I suspect this is true for any macro-expansion-like language.

If you like deep dives, I suggest two follow-up tools for mathematical typesetting:

1. LuaTeX, which is TeX + Lua scripting support. (luatex.org) An example:

https://tex.stackexchange.com/questions/70/what-is-a-simple-...

This has become my default, and I enjoy it. (I use lualatex.)

2. A friend of mine was inspired to write a modern macOS app for math typesetting. It's called MadHat:

https://madhat.design/

One of the coolest features is "no compilation," which I view as a slight exaggeration, but what's true is that it can work quickly and incrementally so you don't have a compile-and-wait cycle, even on long documents.