Putting a cross-reference inside a caption prompts a bunch of scary error messages from make4ht
, though somehow the example still converts. In a larger document, it would abort or hang.
Take this document, ref.tex
:
\documentclass{article}
\begin{document}
\section{An Airplane}
See figure \ref{fig:airplane}.
\begin{figure}
\caption{Airplane}
\label{fig:airplane}
\begin{center}
\begin{picture}(200,100) % thanks, @DavidCarlisle
\put(30,40){\line(1,0){150}}
\put(30,40){\line(0,1){60}}
\put(30,100){\line(1,0){20}}
\put(50,100){\line(1,-4){10}}
\put(60,60){\line(1,0){100}}
\put(160,60){\line(1,-1){20}}
\put(100,50){\line(0,-1){80}}
\put(130,50){\line(0,-1){80}}
\put(100,-30){\line(1,0){30}}
\put(100,61){\line(0,1){49}}
\put(130,61){\line(0,1){49}}
\put(100,110){\line(1,0){30}}
\end{picture}
\end{center}
\end{figure}
\section{A Smaller Airplane}
See figure \ref{fig:airplane2}.
\begin{figure}
\caption{Smaller airplane (cf. figure \ref{fig:airplane})}
\label{fig:airplane2}
\begin{center}
\begin{picture}(100,50)
\put(15,20){\line(1,0){75}}
\put(15,20){\line(0,1){30}}
\put(15,50){\line(1,0){10}}
\put(25,50){\line(1,-4){5}}
\put(30,30){\line(1,0){50}}
\put(80,30){\line(1,-1){10}}
\put(50,25){\line(0,-1){40}}
\put(65,25){\line(0,-1){40}}
\put(50,-15){\line(1,0){15}}
\put(50,30){\line(0,1){25}}
\put(65,30){\line(0,1){25}}
\put(50,55){\line(1,0){15}}
\end{picture}
\end{center}
\end{figure}
\end{document}
It compiles fine with pdflatex
. Try converting with make4ht ref
. I get this console output:
[37m[STATUS] [0mmake4ht: Conversion started
[37m[STATUS] [0mmake4ht: Input file: ref
[31m[ERROR] [0mhtlatex: Compilation errors in the htlatex run
[31m[ERROR] [0mhtlatex: Filename Line Message
[31m[ERROR] [0mhtlatex: ./ref.tex 50 Incomplete \iffalse; all text was ignored after line 50.
[31m[ERROR] [0mhtlatex: ./ref.tex 50 Forbidden control sequence found while scanning text of \write.
[31m[ERROR] [0mhtlatex: ./ref.tex 50 Forbidden control sequence found while scanning text of \write.
[31m[ERROR] [0mhtlatex: ./ref.tex 50 Forbidden control sequence found while scanning text of \write.
[31m[ERROR] [0mhtlatex: Compilation errors in the htlatex run
[31m[ERROR] [0mhtlatex: Filename Line Message
[31m[ERROR] [0mhtlatex: ./ref.tex 50 Incomplete \iffalse; all text was ignored after line 50.
[31m[ERROR] [0mhtlatex: ./ref.tex 50 Forbidden control sequence found while scanning text of \write.
[31m[ERROR] [0mhtlatex: ./ref.tex 50 Forbidden control sequence found while scanning text of \write.
[31m[ERROR] [0mhtlatex: ./ref.tex 50 Forbidden control sequence found while scanning text of \write.
[31m[ERROR] [0mhtlatex: Compilation errors in the htlatex run
[31m[ERROR] [0mhtlatex: Filename Line Message
[31m[ERROR] [0mhtlatex: ./ref.tex 50 Incomplete \iffalse; all text was ignored after line 50.
[31m[ERROR] [0mhtlatex: ./ref.tex 50 Forbidden control sequence found while scanning text of \write.
[31m[ERROR] [0mhtlatex: ./ref.tex 50 Forbidden control sequence found while scanning text of \write.
[31m[ERROR] [0mhtlatex: ./ref.tex 50 Forbidden control sequence found while scanning text of \write.
[37m[STATUS] [0mmake4ht: Conversion finished
Line 50, referred to in the error messages, is the final line of the second figure.