Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have the following test.tex:

\documentclass{article}
\usepackage{tex4ht}
\usepackage{bmpsize}
\usepackage{graphicx}
\begin{document}
\includegraphics[natwidth=1594.7871bp,natheight=1147.85222bp,width=0.65\textwidth,height=0.65\textwidth]{torus-lores-bw.png}
\end{document}

Running latex gives:

D:\Documents\GitHub\book\foo>latex test.tex
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9 64-bit)
entering extended mode
(D:\Documents\GitHub\book\foo\test.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
 lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
german-x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
ishmax, welsh, loaded.
("D:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
("D:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\tex4ht.sty")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\usepackage.4ht")
("D:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\bmpsize.sty"
("D:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty")
("D:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\pdftexcmds.sty"
("D:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty")
("D:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifluatex.sty")
("D:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"))
("D:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
("D:\Program Files\MiKTeX 2.9\tex\latex\graphics\trig.sty")
("D:\Program Files\MiKTeX 2.9\tex\latex\00miktex\graphics.cfg")
("D:\Program Files\MiKTeX 2.9\tex\latex\graphics\dvips.def"))
("D:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty")
("D:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\bmpsize-base.sty"
("D:\Program Files\MiKTeX 2.9\tex\latex\fp\fp-basic.sty"
`Basic Fixed Point Arithmetic',  Version 1.2d (C) Michael Mehlich             )
 ("D:\Program Files\MiKTeX 2.9\tex\latex\fp\fp-snap.sty"
`Fixed Point Snap Off',          Version 1.0a (C) Michael Mehlich             )
) ("D:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\bmpsize-dvips.def"))
("D:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphicx.sty")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\tex4ht.4ht"
::::::::::::::::::::::::::::::::::::::::::
 TeX4ht info is available in the log file
::::::::::::::::::::::::::::::::::::::::::
) ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\tex4ht.sty"
--- needs --- tex4ht test ---
(D:\Documents\GitHub\book\foo\test.tmp)
l.1437 --- TeX4ht warning --- No file test.xref ---
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\latex.4ht"
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\fontmath.4ht"
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\article.4ht"
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\graphics.4ht"
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\dvips.4ht"
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\graphicx.4ht"
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
No file test.aux.

LaTeX Warning: File `torus-lores-bw.png' not found on input line 6.

<torus-lores-bw.png>
! Undefined control sequence.
\b:graphics ...ght !*?: " }\egroup \fi \fi \E:IMG
                                                  \HCode {<!--tex4ht:graphic...
l.6 ...,height=0.65\textwidth]{torus-lores-bw.png}

?

If I remove the tex4ht package, or the bmpsize package, everything works fine. (Well, it works fine if there's a .png file with the right name available. But you get this error even if there isn't.)

share|improve this question

1 Answer 1

It seems that both tex4ht and bmpsize tries to redefine \includegraphics and these redefinition clash. There are two options:

  1. make tex4ht configuration file for bmpsize package and resolve conflicts here
  2. edit your document to not include bmpsize with tex4ht

option 2 is much easier to do, option 1 would require someone with knowledge of graphicx, bmpsize and tex4ht packages. if you only include png images, which are supported by tex4ht, I don't think you need bmpsize package anyway:

\documentclass{article}
\makeatletter
\@ifpackageloaded{tex4ht}{}
{\usepackage{bmpsize}}
\usepackage{graphicx}
\begin{document}
\includegraphics[natwidth=1594.7871bp,natheight=1147.85222bp,width=0.65\textwidth,height=0.65\textwidth]{torus-lores-bw.png}
\end{document}
share|improve this answer
    
If I don't specify natwidth and natheight, then htlatex gives me errors about not being able to compute the bounding boxes of .png files. I want to use bmpsize to autocalculate such sizes. –  Jason Gross Mar 28 at 12:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.