0

In quiet mode (latex example.tex -quiet), LaTeX only prints errors; i.e. the following malformed document:

\documentclass{minimal}
\begin{document}
}

Gives in the output:

...
! Too many }'s.
l.3 }
...

And in quiet mode:

example.tex:3: Too many }'s

However, this is only the case for TeX errors, i.e. syntax and other low-level errors. LaTeX errors printed with \errmessage don’t show any message; the following contrived example:

\documentclass{minimal}
\begin{document}
\errmessage{example error}
\end{document}

Prints in normal mode

...
! example error.
l.3 \errmessage{example error}
...

But in quiet mode just

example.tex:3:

With no trace of the error message. Is there any way to print the error message as well while silencing includes and other output?

  • latex does not have a -quiet option (at least in texlive implementations) which tex system are you using? – David Carlisle Mar 5 '18 at 20:04
1

TL;DR

The "quiet" mode is probably the combination of -interaction=batchmode with -c-style-errors in MiKTeX. That a part of the error message is shown, is likely a bug, because nothing should be shown on the console (quiet).

The full error message can be read in the .log file.

Long version

TeX has some interaction modes and an additional command line option in some TeX distributions like TeX Live or MiKTeX for the style of the error message.

Interaction modes:

-interaction=MODE           Set the interaction mode; MODE must be one
                            of: batchmode, nonstopmode, scrollmode,
                            errorstopmode.

A backslash in front of the names are commands in TeX.

batchmode silences the console output including error messages, but the .log file is written with the messages.

The normal error message is in interaction mode with pressing h for further details:

! example error.
l.3 \errmessage{example error}

? h
This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.

?

In batch mode the console shows nothing, but the .log file contains:

! example error.
l.3 \errmessage{example error}

This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.

Style of error message:

  • MiKTeX:

    -c-style-errors         Enable file:line:error style messages.
    

    Batch mode shows the full error in the .log file:

    test.tex:3: example error
    This error message was generated by an \errmessage
    command, so I can't give any explicit help.
    Pretend that you're Hercule Poirot: Examine all clues,
    and deduce the truth by order and method.
    

    The console shows in batch mode:

    test.tex:3:
    

    This is IMHO a bug and should be empty. Batch mode is for unattended runs without someone looking on the screen. Errors are detected by the exit value of the program and can be reviewed in the .log file.

    Tested with 3.14159265-2.6-1.40.16 (MiKTeX 2.9).

  • TeX Live:

    [-no]-file-line-error   disable/enable file:line:error style messages
    

    Instead of the exclamation mark, the file name and line number is shown in the .log file in batch mode:

    ./test.tex:3: example error.
    l.3 \errmessage{example error}
    
    This error message was generated by an \errmessage
    command, so I can't give any explicit help.
    Pretend that you're Hercule Poirot: Examine all clues,
    and deduce the truth by order and method.
    

    The console does not show the error in batch mode.

  • Hm, I see. Thank you for your help! I’ve submitted a bug report to the MikTeX repo. – 9999years Mar 5 '18 at 20:52
  • 1
    The underlying question is interesting. AFAIK, the user has a choice: Either display the entire log output in real time (terminal or GUI), or wait until everything stops (good or error) and look at the log file. It would be nice if the user could write "highway markers" in the document, which would display in terminal when encountered, even when nothing else is displayed. Example: "Compiled chapter N." Probably wishful thinking. – user139954 Mar 6 '18 at 0:05
  • Yeah, that would be a nice feature in tandem with the bracketed page numbers, especially if it was automatic for chapters or sections. I’m really considering writing a stream processing layer now to read LaTeX output line by line and ignore everything that’s not an error. (Do all error lines start with !?) – 9999years Mar 6 '18 at 3:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.