Ask HN: Why are LaTeX error messages so baffling? - ISL
======
shakna
LaTeX errors are 'well defined', i.e. they have a set way they appear, so they
can be parsed by a machine.

They aren't really meant for you, as a user, but rather for whatever is
calling LaTeX as a library. It's one of the reasons that an IDE is recommended
rather than a text editor.

You can see a good breakdown here. [0]

[0]
[https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings](https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings)

~~~
ISL
One could make a similar argument for compilers, too, but can they not have
great error messages?

~~~
shakna
The error messages from LaTeX are _intended_ to be parsed by a machine. They
aren't meant to be the first stop.

If we want to compare it to other compilers, LaTeX outputs similar error
messages to C++, that is, it gives you the error tree, not an error message.

It's output isn't meant to be the final stop for the user. It's one stop
short.

~~~
ISL
Is there a LaTeX wrapper that gives comprehensible error messages? ("Sure
looks like you left off a } on line 30")

~~~
shakna
ChkTeX [0] on *nix, or lacheck [1] for Windows.

[0] [http://baruch.ev-en.org/proj/chktex/](http://baruch.ev-
en.org/proj/chktex/)

[1] [https://www.ctan.org/tex-
archive/support/lacheck](https://www.ctan.org/tex-archive/support/lacheck)

~~~
ISL
So cool. Thank you! :)!

------
wcoenen
LaTeX looks a bit like semantic markup, but is implemented as layers of macros
on top of TeX primitives.

Some errors may only be detected in the later stages of processing, making it
difficult to relate them to the original LaTeX.

------
vfulco2
Great question, glad I am not the only one. So much great stuff you can do
with Rmarkdown but inevitably you have to dig deep into LaTeX if you are going
to customize/standardize docs to your business.

------
adiusmus
Out of cheese error.

