[tex4ht] Using texfot with make4ht, how to make it stop at error in compiling?

Nasser M. Abbasi nma at 12000.org
Tue Jun 27 22:20:10 CEST 2023


I am back to using the nice package texfot by Karl Berry to help reduce
amount of display on the screen.

https://ctan.org/pkg/texfot?lang=en

Here is background: I wanted first to use `-a warning` with
make4ht to reduce the output on screen, but the side effect
of this is that it no longer stops on error.  I asked
about this here:

https://tex.stackexchange.com/questions/689582/using-a-warning-in-make4ht-does-not-stop-at-first-error

So I have to use `-a debug` as I must stop my build on error.

But the output is too much and slows the build and makes it
hard to see where it is by looking at monitor.

So I changed to using texfot which does reduce the output alot and
I still can use `-a debug` with make4ht. But now I find
it also does not stop on error.

It keeps going, compiling one more time. Same when using `-a warning`.

Is there a way to use texfot but make it stop on first error?

Here is MWE, with an error in it
--------------------------------
\documentclass[12pt]{book}
\usepackage{graphicx}
\begin{document}
My document
\includegraphics[width=\textwidth]{ZZZ}%file does not exist
\end{document
------------------------------

When I compile without texfot and using `-a debug` it stops
on error which is what I want

-------------------------
make4ht -ulm default -a debug a.tex "mathjax,htm"

! 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}
                                           %file does not exist
?

-----------------------------

When I use texfot it does not stop on error (command all on one line)

--------------------------
texfot --tee=/dev/null --ignore="Overfull"
     make4ht -ulm default -a debug a.tex "mathjax,htm"

/usr/local/texlive/2022/bin/x86_64-linux/texfot: invoking: make4ht -ulm default -a debug a.tex mathjax,htm
This is LuaTeX, Version 1.15.1 (TeX Live 2023/dev)
l.864 --- TeX4ht warning --- nonprimitive \everypar ---
l.12 --- TeX4ht warning --- File `"B//image.xbb"' not found ---
l.12 --- TeX4ht warning --- Cannot determine size of graphic in "B//image.xbb"
! LaTeX Error: File `ZZZ' not found.

l.15 \includegraphics[width=\textwidth]{ZZZ}
! Emergency stop.
  ...
l.15 \includegraphics[width=\textwidth]{ZZZ}
!  ==> Fatal error occurred, bad output DVI file produced!
No pages of output.
[FATAL]   make4ht-lib: Fatal error. Command htlatex returned exit code 1
>
----------------------------

You see from above, it compiled again and again.

So I am back to square one. Same issue as if I use `-a warning`,
it keeps running, here is output with `-a warning`

-------------------------
make4ht -ulm default -a warning a.tex "mathjax,htm"

[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.
----------------------------

The question is: is there a way to make texfot stop on first error?

I need to do this, as my build takes long time and I need to stop if
error shows up to save time and not wait to the end to find out my
build was not completed correctly.

Too much output is not only slowing the build, it makes it very
hard to see where it is by looking at screen now.

Any ideas?

Thank you,
--Nasser




More information about the tex4ht mailing list.