bugtex4ht - Bugs: bug #590, tex4ht fails when adding...

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

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

Submitted by:  Nasser M. Abbasi <nma123>
Submitted on:  Fri Dec 30 01:56:27 2022  
 
Category: NonePriority: 5 - Normal
Severity: 7 - ImportantStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

Sat Dec 31 13:57:16 2022, comment #1:

I've fixed this issue in TeX4ht sources and posted some more info at TeX.sx. I've also updated the FAQ in the documentation with an example of a new configuration for commands that cause issues:

https://www.kodymirus.cz/tex4ht-doc/FAQandTroubleshooting.html#hyperref-issues

Michal Hoftich <michal_h21>
Project Member
Fri Dec 30 01:56:27 2022, original submission:

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
\\

  1. & \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
\\

  1. & \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

Nasser M. Abbasi <nma123>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by michal_h21 (Posted a comment)
  • -unavailable- added by nma123 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    1 latest change follows.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue Jan 10 15:06:35 2023michal_h21Open/ClosedOpen=>Closed
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray