Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

LaTeX has a number of issues:

- Compilation feels almost non-deterministic at times. You should not have to recompile your document 2 or 3 times to get the final behavior, yet that's pretty standard practice. References / bibliographies don't work the first time through, and often you compile the bibliography separately, which is just crazy to me.

- Compilation errors are really non-helpful. In programming, if I omit one side of a bracket or parentheses somewhere, I'll almost certainly get an error with a reference to the line number right at or below the issue. GOOD LUCK finding a missing bracket in a LaTeX document based on the error messages when compilation fails.

- Lots of pretty simple behavior that really should be standardized and built in requires additional packages. The real problem comes when combining multiple packages... It's like how medications interact. It's almost hopelessly intractable to try and predict how multiple packages will interact with each other, so the way you do a simple thing in one document may change in another document depending on the combination of packages.

- >What you describe as "a complex hack of internals" is usually in practice a 30 second visit to Stack Exchange and a cut and paste.

I'm with the person you were replying to on this. There's a lot of really hacky stuff to get a result that really should have been built in. Like, a built in quote or excerpt for example, should just be a standard style like: /begin{quote} Quote \end{quote}. But instead you have to do it as a \parbox[center]{hope-you-guessed-a-good-width-mm}{Quote}.

- It's a small thing, but the way you do quotes is pretty silly. Not a fan of `` '' instead of "". If that's really how I have to do it without including additioanl packages, why not at least have a built-in like: \lquote and \rquote ?

I am normally a person that is deeply opposed to language updates, unnecessary feature updates, new frameworks, etc. But in the case of LaTeX, it's one of the most obvious examples I can think of where it's desperately needed.



"You should not have to recompile your document 2 or 3 times... References / bibliographies don't work the first time through..." If you think about it, you'll probably see why. Cross-references can't be set until you know what they refer to, which may be later on in the doc ("see section 8 below"), and setting such references (or citations) can change the page numbering. If the multiple passes (which are analogous to the multiple passes a compiler makes) bother you, then use a tool that hides them from your eyes, like arara. That's probably what Word does under the hood.


I think what OP is suggesting is that the multiple passes should be done by the executable itself. They shouldn’t have to be abstracted away be some other tool. TeX already does two or so passes for layout IIRC.


This, totally. Nobody cares—or should be forced to care—whether a given compiler does something in a single or multiple passes, what counts is ergonomics and overall speed. FWIW when I still worked with TeX (XeLaTeX) I soon built my own wrapper for the executable that simply compared the sha1sum of the relevant *.aux file from before with that from after the run and would loop until the checksum wouldn't change any more.


Seems like rubber [1] is a commonly-used wrapper for this sort of thing. Works well in a makefile.

[1] https://gitlab.com/latex-rubber/rubber/


> Compilation errors are really non-helpful. In programming, if I omit one side of a bracket or parentheses somewhere, I'll almost certainly get an error with a reference to the line number right at or below the issue. GOOD LUCK finding a missing bracket in a LaTeX document based on the error messages when compilation fails.

You are right but I think is not trivial to solve because contrary to programming languages LaTeX is interleaved with natural language and so almost everything is possible. Maybe the best approximation is to have heuristics. For example start with a valid document, introduce errors and train a neural network to identify the problem. Overkill?


While we're already using machine learning and neural networks to solve this problem, why not use a blockchain? /s

TeX being "interleaved with natural language" is not at all at the heart of the problem IMO. Every HTML document does so, too. The real problem lies much deeper. TeX uses recursive rewrites of the code that is the document to achieve what it does, without properly keeping track of where it is and what it does. There is no technical necessity for doing so, but the technique introduces huge complexity costs. On a somewhat related note, TeX's syntax at its very heart is also not trivial to parse short of executing (compiling) a given document (i.e. TeX's syntax itself is Turing-complete). This has been done only because the author got carried away by the coolness factor of it. Already a few years after TeX came out, Leslie Lamport implemented LaTeX on top of TeX to make TeX more approachable to less dedicated / insanely gifted users; he chose to dial back on this very aspect—the inscrutable syntax—and proposed a much more regular syntax as a convention.


Tex being Turing complete is what allowed LaTeX in the first place. HTML not being Turing complete requires Javascript and CSS separately. Do you find them easier? Maybe, I'm not sure, but you cannot escape your language being Turing complete because the range of possible documents is so vast.


This doesn't sound right. First of all, I'm not complaining about TeX being Turing-complete, what I'm saying is the syntax is unnecessarily hairy because TeX's syntax is Turing complete, meaning there is no static grammar production that would allow you to recognize all the macros / commands / 'active' content parts in a given document—you have to typeset (compile) it, only then you can know. Nothing is gained by this, not in theory and not in practice; it's just a burden.

To say that "HTML is not Turing-complete, therefore CSS as a separate language is required" is not even wrong and I leave it to the readers to fill out the blanks.

To say that "HTML is not Turing-complete, therefore JavaScript as a separate language is required" is more or less correct although to be fair we've seen many, many features such as animation being absorbed by declarative CSS that had to be implemented in imperative JS so in that regard the need for JS has diminished.

I can say with certainty that a full fledged programming language (i.e. Turing-completeness + usability) is absolutely necessary for a viable solution of document production. And while one can and people do produce TeX and HTML output programmatically, this does not obviate the need for a typesetting engine that can tell you where you are and what the circumstances are while typesetting the document. JavaScript has grown many abilities in this direction, but TeX in comparison is, after almost 45 years in development, still lacking and CLUMSY AS HELL for crying out loud.

Nothing is easy, simple or straightforward in TeX. Numbers are difficult, units are difficult, command syntax is difficult, namespaces are difficult (because there are none), variable names are difficult, conditions are difficult (there are like hundreds of specialized \if s), knowing in which column you are is difficult, fonts are difficult, character encoding is difficult, keeping constant line heights is difficult, positioning floats is difficult, the processing model is difficult, the very syntax is difficult.

I've said it before and I will say it again: TeX is a computational typesetting system, but it turns out it's quite bad at dealing with numbers, strings, and conditions, the basic building blocks of computational typesetting.

TeX is an utterly broken system because every single aspect is a convoluted mess.

It does get a lot of praise for its incorporation of the Knuth-Plass line breaking algorithm, and rightly so. However this beast, too, is hard to handle unless you just go with the defaults. It will happily give you overshooting lines because Knuth decided to have a word jutting out the right margin was a better solution than unsightly spaced words or letters. Most printers would disagree and just bite that bullet where necessary.

Yes, TeX will issue a warning in such cases but this is almost insubstantial because TeX keeps warning you about many, many things in the same output stream as its informative messages. That stream is almost impossible to parse for humans and machines alike. To make it even harder TeX's console output is hardwired to wrap at column 80. Even TeX's error messages are a convoluted mess.

/rant

And to come back to your original question, yes, I do have the strong suspicion that the separation of styling (CSS), content (HTML) and programming proper (JS) into three distinct compartments with differing syntaxes is close to the local optimum that we as people in this time and age can and want to deal with. If anything the syntax of JS and CSS could perhaps be unified (CSS is 90% JavaScript's object literal syntax; it adds selectors, allows hyphens in property names, and has quite a few notational amenities on the right hand side; other than that, it's like object notation). One can also imagine to express CSS in HTML which would be a bit clumsy but still somewhat usable. However, to unify markup syntax with imperative syntax is almost sure to fail. JSP (remember those?) and embedded PHP are two examples for how we do not want things to be. JSX looks a bit more viable. Svelte does this very interesting thing where they have a single file define the markup, the styling, and the behavior in a single file with three distinct parts; to me that looks like the future.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: