sometimes I like to use -a warning
with make4ht to reduce the amount of information printed.
The big problem is that it does not stop at first error. It keeps running.
When I change to -a debug
it stops at the error.
How can one use -a warning
but make it stop at the first error? Here is an example of a.tex
which loads image ZZZ
which does not exist. This is run using the command
make4ht -ulm default -a warning a.tex "htm,mathjax"
Here is MWE
\documentclass[12pt]{book}
\usepackage{graphicx}
\begin{document}
My document
\includegraphics[width=\textwidth]{ZZZ}
\end{document}
Notice now what happens when I use -a warning
>make4ht -ulm default -a warning a.tex "htm,mathjax"
[ERROR] htlatex: Compilation errors in the htlatex run
[ERROR] htlatex: Filename Line Message
[ERROR] htlatex: ./a.tex 15 LaTeX Error: File `ZZZ' not found.
[ERROR] htlatex: Compilation errors in the htlatex run
[ERROR] htlatex: Filename Line Message
[ERROR] htlatex: ./a.tex 15 LaTeX Error: File `ZZZ' not found.
[ERROR] htlatex: Compilation errors in the htlatex run
[ERROR] htlatex: Filename Line Message
[ERROR] htlatex: ./a.tex 15 LaTeX Error: File `ZZZ' not found.
Those are 3 passes it did. It did not stop at first error but kept going. Compare to what happens when using -a debug
make4ht -ulm default -a debug a.tex "htm,mathjax"
[INFO] mkparams: Output dir:
[INFO] mkparams: Compiler: dvilualatex
etc...
(./a.aux) (/usr/local/texlive/2022/texmf-dist/tex/latex/base/ts1cmr.fd)
! LaTeX Error: File `ZZZ' not found.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.15 \includegraphics[width=\textwidth]{ZZZ}
?
And compilation stops and does not go to next phase. This is what I want. I just want the same with -a warning
.
How to do that? In my builds, one tex4ht pass can take hrs. I do not want to wait many hrs only to find later that there was an error and I did not see it. I want my makefile to stop at the first error to save time.
ps. I did try all a
options
debug, info, status, warning, error, fatal
And only -a debug
stops at first error. fatal
does not display anything. So I have no idea where it stops as nothing at all is printed on screen (maybe because there was no FATAL error?)
>make4ht -ulm default -a status a.tex "htm,mathjax"
[STATUS] make4ht: Conversion started
[STATUS] make4ht: Input file: a.tex
[ERROR] htlatex: Compilation errors in the htlatex run
[ERROR] htlatex: Filename Line Message
[ERROR] htlatex: ./a.tex 15 LaTeX Error: File `ZZZ' not found.
[ERROR] htlatex: Compilation errors in the htlatex run
[ERROR] htlatex: Filename Line Message
[ERROR] htlatex: ./a.tex 15 LaTeX Error: File `ZZZ' not found.
[ERROR] htlatex: Compilation errors in the htlatex run
[ERROR] htlatex: Filename Line Message
[ERROR] htlatex: ./a.tex 15 LaTeX Error: File `ZZZ' not found.
[STATUS] make4ht: Conversion finished
And
>make4ht -ulm default -a error a.tex "htm,mathjax"
[ERROR] htlatex: Compilation errors in the htlatex run
[ERROR] htlatex: Filename Line Message
[ERROR] htlatex: ./a.tex 15 LaTeX Error: File `ZZZ' not found.
[ERROR] htlatex: Compilation errors in the htlatex run
[ERROR] htlatex: Filename Line Message
[ERROR] htlatex: ./a.tex 15 LaTeX Error: File `ZZZ' not found.
[ERROR] htlatex: Compilation errors in the htlatex run
[ERROR] htlatex: Filename Line Message
[ERROR] htlatex: ./a.tex 15 LaTeX Error: File `ZZZ' not found.
And
>make4ht -ulm default -a fatal a.tex "htm,mathjax"
>
It will be great if there is an option that shows same level of output as -a warning but also stops on error just -a debug does
TL 2022
-a
options, and if none of them fits your need, make a feature request. You should know by now that the maintainer is quite nice and willing to adapt things.