[tex4ht] [bug #257] \includegraphics fails with LuaLaTeX backend

Michal Hoftich michal.h21 at gmail.com
Tue Jul 14 22:11:00 CEST 2015


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

                 Summary: \includegraphics fails with LuaLaTeX backend
                 Project: tex4ht
            Submitted by: michal_h21
            Submitted on: Tue 14 Jul 2015 11:11:00 PM EEST
                Category: None
                Priority: 5 - Normal
                Severity: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

This is an crosspost from http://tex.stackexchange.com/q/255220/2891. The
problem shows when we try to include some image in format which is not
supported in dvi mode: 

\documentclass{article}
\usepackage{graphicx}

\begin{document}
\includegraphics{someimage.png}
\end{document}

It turns out that graphicx package tries to find the bounding box of the
image. It tries that by reading the image data. But because images are binary,
this cause LuaLaTeX to complain about incorrect utf8 value. It easily exceeds
100 errors and the document fails to compile.

David Carlisle proposed a solution using \DeclareGraphicsRule:

\DeclareGraphicsRule{.png}{bmp}{.xbb}{}
\DeclareGraphicsRule{.jpg}{bmp}{.xbb}{}
\DeclareGraphicsRule{.gif}{bmp}{.xbb}{}

with this code, images aren't parsed for the bounding box, but .xbb files are
used instead. They can be created using 

    ebb -x imagename

This solution fixes also behavior with normal LaTeX, as bounding boxes weren't
loaded with it as well. 

More details are provided in my answer to the question on TeX.sx

Patch for literate sources is attached.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tue 14 Jul 2015 11:11:00 PM EEST  Name: graphicx.patch  Size: 412B   By:
michal_h21

<http://puszcza.gnu.org.ua/bugs/download.php?file_id=215>

    _______________________________________________________

Reply to this item at:

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

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



More information about the tex4ht mailing list