[tex4ht] [bug #590] tex4ht fails when adding \centering after \begin{figure}

Nasser M. Abbasi puszcza-hackers at gnu.org.ua
Fri Dec 30 02:56:28 CET 2022


URL:
  <http://puszcza.gnu.org.ua/bugs/?590>

                 Summary: tex4ht fails when adding \centering after
\begin{figure}
                 Project: tex4ht
            Submitted by: nma123
            Submitted on: Fri Dec 30 01:56:27 2022
                Category: None
                Priority: 5 - Normal
                Severity: 7 - Important
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:


Reference:

https://tex.stackexchange.com/questions/670089/tex4ht-fails-when-adding-centering-after-beginfigure

This is related to 

https://tex.stackexchange.com/questions/669581/tex4ht-fails-on-including-image-with-math-in-caption-after-loading-hyperref-pack

but now fails under new conditions.

This is summary of what is going on. There was a bug in the above link where
tex4ht failed when adding math in the caption of the image when hyperref was
loaded. Thanks to michal.h21 this is fixed now in latest TL as I no longer get
the error using the MWE in the above, which is

-----------------------------
\documentclass{article}
\usepackage{amsmath} 
\usepackage{graphicx}
\usepackage{hyperref}

\begin{document}

\begin{figure}
\includegraphics[width=0.5\textwidth]{example-image-a}
\caption{Phase plot $y^{\prime \prime}\left(t \right)+9 y \left(t
\right)-\left(\left\{\begin{array}{cc}
8 \sin \left(t \right) & 0<t <\pi  
\\
 0 & \pi <t  
\end{array}\right.\right) = 0$}
\end{figure}

\end{document}
----------------------

Using the command

make4ht -ulm default -a debug  foo.tex 'mathjax,htm'

No errors. Great. But once I added \centering, the error came back

----------------------
\documentclass{article}
\usepackage{amsmath} 
\usepackage{graphicx}
\usepackage{hyperref}

\begin{document}

\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{example-image-a}
\caption{Phase plot $y^{\prime \prime}\left(t \right)+9 y \left(t
\right)-\left(\left\{\begin{array}{cc}
8 \sin \left(t \right) & 0<t <\pi  
\\
 0 & \pi <t  
\end{array}\right.\right) = 0$}
\end{figure}

\end{document}
--------------------

And now the same command

make4ht -ulm default -a debug  foo.tex 'mathjax,htm'

Gives

[INFO]    mkparams: Output dir: 
[INFO]    mkparams: Compiler: dvilualatex
[INFO]    mkparams: Latex options: -jobname='foo'  
[INFO]    mkparams: tex4ht.sty: xhtml,mathjax,htm,charset=utf-8
[INFO]    mkparams: tex4ht:  -cmozhtf -utf8
[INFO]    mkparams: build_file: foo.mk4
[INFO]    mkparams: Output format: html5
[STATUS]  make4ht: Conversion started
....
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/unicode.4ht)
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/html4-math.4ht)
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/html5.4ht))
(/usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
(./foo.aux) (/usr/local/texlive/2022/texmf-dist/tex/latex/base/ts1cmr.fd)17
nil

[1] [2]
l.10 --- TeX4ht warning --- File `"example-image-a.xbb"' not found ---
l.10 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
a.xbb" (no BoundingBox) ---
! Argument of \@caption has an extra }.
<inserted text> 
\par 
l.15 \end{array}\right.\right) = 0$}
                                  
? 

Which is the same error fixed in the earlier question linked above.

Any workaround for this problem as I use \centering in my code.

TL 2022 Updated just 1/2 hr ago.

>which make4ht
/usr/local/texlive/2022/bin/x86_64-linux/make4ht
>make4ht --version
make4ht version v0.3l
>which tex4ht
/usr/local/texlive/2022/bin/x86_64-linux/tex4ht





    _______________________________________________________

Reply to this item at:

  <http://puszcza.gnu.org.ua/bugs/?590>

_______________________________________________
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



More information about the tex4ht mailing list.