LaTeX forum ⇒ GeneralMore wishes - error messages

LaTeX specific issues not fitting into one of the other forums of this category.
pireddag
Posts: 20
Joined: Tue Nov 21, 2017 3:06 am

More wishes - error messages

Postby pireddag » Fri Nov 09, 2018 3:56 pm

There are two mistakes that I make sometimes when I write in LaTeX (that is, I forget about these rules every so often and I have to re-learn them), and every time it takes me a bit to figure them out again (the last time it took more than 10 minutes for each).

It would be very, very nice if the LaTeX error messages would highlight the problem, so that I could correct it immediately.

Mistake #1.

I input an empty line inside the equation environment. LaTeX tells me as an answer that he inserted a $ sign and then the compilation fails; a more helpful error message would point out that there is an empty line in the equation environment.

Mistake #2

Sometimes it is necessary to delete the auxiliary files so that LaTeX compiles correctly. I have not yet learnt when this is necessary. The last time that happened to me was when I added the hyperref package to a document that did not have it at the beginning; the previous time was when I added a cross-reference to an equation in a document. In the case of the cross-reference, LaTeX kept telling me that there was a undefined reference. After a while I figured out that I should delete the auxiliary files.
I feel that for this case an error message would help; an error that would be triggered when these two conditions are both fulfilled: 1) there are undefined references 2) the auxiliary files are not updated by the compilation (I guess this is what is happening).

Although for this "mistake #2" I do not understand why LaTeX does not understand that it needs to update the files.

pireddag
Posts: 20
Joined: Tue Nov 21, 2017 3:06 am

Postby pireddag » Fri Nov 09, 2018 4:25 pm

I realize now that this section of the forum is about "Wishes" for the forum, and not "Wishes" for LaTeX.

Perhaps LaTeX/General would be a better section???

User avatar
Johannes_B
Site Moderator
Posts: 3905
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri Nov 09, 2018 5:39 pm

I think it is all about reading the aux file. TeX, as an engine, was developed in the last 30 to 40 years. Computing power and memory was very scarce back then.

  1. \documentclass{article}
  2. \begin{document}
  3. \begin{equation}
  4. a+b
  5. \end{equation}
  6. \end{document}



The example above produces the log file below
  1. This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded format=pdflatex 2018.3.6) 9 NOV 2018 16:29
  2. entering extended mode
  3. restricted \write18 enabled.
  4. %&-line parsing enabled.
  5. **pireddagErrors.tex
  6. (./pireddagErrors.tex
  7. LaTeX2e <2017-04-15>
  8. Babel <3.18> and hyphenation patterns for 84 language(s) loaded.
  9. (/usr/local/texlive/2017/texmf-dist/tex/latex/base/article.cls
  10. Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
  11. (/usr/local/texlive/2017/texmf-dist/tex/latex/base/size10.clo
  12. File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
  13. )
  14. \c@part=\count79
  15. \c@section=\count80
  16. \c@subsection=\count81
  17. \c@subsubsection=\count82
  18. \c@paragraph=\count83
  19. \c@subparagraph=\count84
  20. \c@figure=\count85
  21. \c@table=\count86
  22. \abovecaptionskip=\skip41
  23. \belowcaptionskip=\skip42
  24. \bibindent=\dimen102
  25. )
  26. (./pireddagErrors.aux)
  27. \openout1 = `pireddagErrors.aux'.
  28.  
  29. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 2.
  30. LaTeX Font Info: ... okay on input line 2.
  31. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 2.
  32. LaTeX Font Info: ... okay on input line 2.
  33. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 2.
  34. LaTeX Font Info: ... okay on input line 2.
  35. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 2.
  36. LaTeX Font Info: ... okay on input line 2.
  37. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 2.
  38. LaTeX Font Info: ... okay on input line 2.
  39. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 2.
  40. LaTeX Font Info: ... okay on input line 2.
  41. LaTeX Font Info: External font `cmex10' loaded for size
  42. (Font) <7> on input line 3.
  43. LaTeX Font Info: External font `cmex10' loaded for size
  44. (Font) <5> on input line 3.
  45.  
  46. ! Missing $ inserted.
  47. <inserted text>
  48. $
  49. l.5
  50.  
  51. ?
  52. ! Display math should end with $$.
  53. <to be read again>
  54. \par
  55. l.5
  56.  
  57. ?
  58. ! You can't use `\eqno' in vertical mode.
  59. \endequation ->\eqno
  60. \hbox {\@eqnnum }$$\@ignoretrue
  61. l.6 \end{equation}
  62. ?
  63. ! Missing $ inserted.
  64. <inserted text>
  65. $
  66. l.6 \end{equation}
  67. ?
  68. ! Display math should end with $$.
  69. <to be read again>
  70. \endgroup
  71. l.6 \end{equation}
  72.  
  73. ?
  74. [1
  75. {/usr/local/texlive/2017/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
  76. (./pireddagErrors.aux) )
  77. Here is how much of TeX's memory you used:
  78. 203 strings out of 492982
  79. 2259 string characters out of 6132513
  80. 54251 words of memory out of 5000000
  81. 3855 multiletter control sequences out of 15000+600000
  82. 3640 words of font info for 14 fonts, out of 8000000 for 9000
  83. 1141 hyphenation exceptions out of 8191
  84. 23i,4n,17p,138b,107s stack positions out of 5000i,500n,10000p,200000b,80000s
  85. </usr/local/texlive/2017/texmf-dist/fonts/type1/public/
  86. amsfonts/cm/cmmi10.pfb></usr/local/texlive/2017/texmf-dist/fonts/type1/public/a
  87. msfonts/cm/cmr10.pfb>
  88. Output written on pireddagErrors.pdf (1 page, 16121 bytes).
  89. PDF statistics:
  90. 16 PDF objects out of 1000 (max. 8388607)
  91. 10 compressed objects within 1 object stream
  92. 0 named destinations out of 1000 (max. 500000)
  93. 1 words of extra memory for PDF output out of 10000 (max. 10000000)


The second error message hints in this case, that there is a paragraph break introduced by the blank line, which is forbidden for an equation. The third error is triggered by the fact, that you cannot use math things in normal text (TeX went back to normal mode when the paragraph break happened).

There is not much to do here for the LaTeX team.

Concerning the auxialiary files, sometimes something is written to them which isn't correct. They are only recreated properly, when the compile run is succesful. But here again, a look at the log-file will make it very clear, where the error happens and which file to delete.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

pireddag
Posts: 20
Joined: Tue Nov 21, 2017 3:06 am

Postby pireddag » Fri Nov 09, 2018 6:14 pm

Johannes_B wrote:I think it is all about reading the aux file. TeX, as an engine, was developed in the last 30 to 40 years. Computing power and memory was very scarce back then.


This is fair. I know it because when I was writing my Laurea thesis (1996/97) the system administrator refused me 80 Mb in hard drive quota (he did not have them). TeX was written even before.

I know that no-one is going to modify the TeX code, as far as I understand modifying it will cause a chaos.

But one could work on the LaTeX macros; I know that the LaTeX team is at work to release LaTeX3 :-)

Johannes_B wrote:The second error message hints in this case, that there is a paragraph break introduced by the blank line, which is forbidden for an equation. The third error is triggered by the fact, that you cannot use math things in normal text (TeX went back to normal mode when the paragraph break happened).

There is not much to do here for the LaTeX team.


I do not understand if with "There is not much to do here for the LaTeX team." you mean "The LaTeX team cannot do anything about this" or "The LaTeX team should not do anything about this". Of course I disagree in both cases ;-)

\{equation} is a LaTeX environment as far as I know, and the error message could be handled by LaTex. The error message should say

"LaTeX:No blank lines are allowed in the \{equation} environment".

By the way it would also be helpful if the error message would be clearly marked as coming out from LaTeX (I have written it so).

Johannes_B wrote:Concerning the auxialiary files, sometimes something is written to them which isn't correct. They are only recreated properly, when the compile run is succesful. But here again, a look at the log-file will make it very clear, where the error happens and which file to delete.


Here the puzzling thing is that the compile run looks at least partially successful: one gets a pdf with question marks in place of the reference for example.
I have the feeling that here too LaTeX could (and should, I think) do something. But it could be more complicated, as LaTeX would have to know whether the file has been regenerated or not; if it is able to do so, then it could point out that there is the possibility. Something like

"LaTeX:the aux file was not regenerated and there were undefined references; please delete the aux file and try again".

By the way there is a strong difference in "philosophy" between what I think is right and what you think is right (judging from your answer). For me the right thing to do is to make at least some error messages as clear as possible, so that they can be interpreted by reading them, without knowing how LaTeX works; which error messages then ... it is a matter of a usability analysis. As far as I see, for you (and this could be a common position in the LaTeX world) the right thing to do is that the user needs to become an expert.

User avatar
Johannes_B
Site Moderator
Posts: 3905
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Nov 10, 2018 8:48 am

LaTeX is not throwing an error because there is a blank line. It is TeX.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

pireddag
Posts: 20
Joined: Tue Nov 21, 2017 3:06 am

Postby pireddag » Sat Nov 10, 2018 6:06 pm

Johannes_B wrote:LaTeX is not throwing an error because there is a blank line. It is TeX.


I get that. The point that I am raising is that the error thrown by TeX and the consequent fix in the LaTeX code is clear only for the people that know TeX; LaTeX itself could intervene and issue an error message - labelling it as a LaTeX error.

In my opinion it is fair that the LaTeX error would "superpose" itself to the TeX error in the sense that it lead necessarily to the TeX error. It would make things clearer for me and maybe for others too.

User avatar
Johannes_B
Site Moderator
Posts: 3905
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Nov 10, 2018 6:17 pm

I pinged part of the team, please see the chat transcript.

https://chat.stackexchange.com/transcri ... 1#47556311
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

pireddag
Posts: 20
Joined: Tue Nov 21, 2017 3:06 am

Postby pireddag » Sat Nov 10, 2018 7:18 pm

Johannes_B wrote:I pinged part of the team, please see the chat transcript.

https://chat.stackexchange.com/transcri ... 1#47556311


Thanks for this

Which one is the "right page" Ulrike Fischer is referring to?
(https://chat.stackexchange.com/transcri ... 0#47556930)

pireddag
Posts: 20
Joined: Tue Nov 21, 2017 3:06 am

Postby pireddag » Sat Nov 10, 2018 7:26 pm

And I also get the story of quitting with x in the aux file error.

https://chat.stackexchange.com/transcri ... 9#47556959

Probably the critical thing is to substitute S for the X that I am using.

If I do like I do (press X) then I have a corrupt aux file, that TeX will try to read again and this will cause again an error. As far as I understand.
Since this can happen, it would be nice to have it documented (IMHO).

User avatar
Johannes_B
Site Moderator
Posts: 3905
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sun Nov 11, 2018 8:13 am

pireddag wrote:Which one is the "right page" Ulrike Fischer is referring to?
(https://chat.stackexchange.com/transcri ... 0#47556930)

Probably https://www.latex-project.org/


The different things to press when an error happens, h or q, or s, or x are all documented. In the TeXbook. When you are interacting, you are interacting with TeX.

As Ulrike and David said, it is possible to make adjustments ... which will probably cause havoc in thousands of documents ... automated error parsing/detection by some guis worthless.


Maybe LaTeX3 can do something about it in the future, but no need to wait impatientely. It will take a while.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.


Return to “General”

Who is online

Users browsing this forum: No registered users and 9 guests