# Problem with inserting graphics with HtLaTeX on Debian buster

I've been tasked with porting some software to Debian buster. The software has pretty extensive documentation using latex.

I'm mainly a sysadmin/software guy and only know a little TeX.

When building the documentation on buster, it has no problem generating PDF output with pdflatex, but when generating the html documentation with htlatex it fails when it gets to the first time graphics are inserted. The document uses \epsfig but I've tried replacing that with \includegraphics with the same results.

Here's the error I get where it stops:

! Undefined control sequence.
<recently read> \int:pt

l.63   \epsfig{file=flow, width=\textwidth}

?
! Emergency stop.
<recently read> \int:pt

l.63   \epsfig{file=flow, width=\textwidth}


The odd part is that I have no idea where the \int:pt comes from. It's not in any of the latex code for the document. I've only been able to find it in the file:

/usr/share/texlive/texmf-dist/tex/generic/tex4ht/html4.4ht


But I have no idea why that's showing up in the error.

Any clues on where I should look next?

EDIT: Here's a minimal set of files that illustrate the issue

The document in question has a main document file that does a \usepackage on a custom package that has some global definitions and pulls in other packages. Then it just has \include commands to pull in the separate chapter files. I've replicated this for my test. Here's the main document:

\documentclass[11pt]{book}
\usepackage{mintest}

\begin{document}

\include{test2}

\end{document}


Here's the mintest.sty file:

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mintest}[2004/09/17 v0.4 mintest style]

\usepackage{epsfig}
\usepackage{graphics}

\endinput


and here's the test2.tex file:

\chapter{Operation}
\label{chap:operation}

\section{Principles of Operation}

Blah blah blah

\begin{figure}[H]
%  \includegraphics[width=\textwidth]{flow}
\epsfig{file=flow, width=\textwidth}
\label{fig:flow}
\caption{Flow of traffic}
\end{figure}


I then run htlatex with this commandline:

htlatex test.tex "xhtml,2,fn-in,graphics-"


The resulting test.log file is 425 lines so I won't put all of that here (unless someone wants to see it) but here's the error:

! Undefined control sequence.
<recently read> \int:pt

l.10   \epsfig{file=flow, width=\textwidth}

?
! Emergency stop.
<recently read> \int:pt

l.10   \epsfig{file=flow, width=\textwidth}

End of file on the terminal!

• I run Debian Bullseye, maybe I can help. It is customary to post a MWE (well, MnWE in your case) so we can tinker around with the code. Mar 6, 2021 at 1:25
• Yeah, I've been working on that, but the documentation is pretty complicated. I was hoping someone would have seen something like this previously. I'll keep working on it though. Mar 6, 2021 at 1:38

## 1 Answer

The problem is with your command line options. You use this command:

htlatex test.tex "xhtml,2,fn-in,graphics-"


There is a problem with the graphics- option. It expects resolution number, so the correct usage is graphics-300, for example.

I don't get an error with the following command:

make4ht test.tex "2,fn-in,graphics-300"


Unfortunately, it doesn't change the resolution of the image, because it isn't taken into account currently. You will need a configuration that uses thins information:

\Preamble{xhtml}
\makeatletter
\Configure{EpsConvert}{"rungs -dSAFER    -dBATCH    -dNOPAUSE    -dEPSCrop    -r\csname gr:density\endcsname\space  -sDEVICE=pngalpha -sOutputFile="\Gin@base.png" "\Gin@base.eps" "}
\makeatother
\Configure{Gin-dim}{}
\Css{img {
max-width: 100\%;
height: auto;
}}
\begin{document}
\EndPreamble


Save this code as myconfig.cfg. Before you run another compilation, you need to remove the flow.png file, because the EPS to PNG conversion is executed only when the destination PNG file doesn't exist.

\Configure{EpsConvert} specifies command that is used for the EPS to PNG conversion. -r\csname gr:density\endcsname contains the resolution passed from the graphics- option.

\Configure{Gin-dim}{} disables output of image dimensions in the HTML file. The \Css command specifies that the image shouldn't overflow the screen. See this how-to for some details.

Now execute

make4ht -c myconfig.cfg test.tex "2,fn-in,graphics-300"


This is a result with a test image from TeX Live:

• I'm wondering if there isn't something already setup for this -- the document I created this example from generates HTML fine on Debian versions prior to Buster, all the way back to a at least Debian squeeze. Mar 6, 2021 at 19:02
• @DavidGood yes, it is possible that something changed. we changed way how graphics dimensions are handled not so long ago. but the graphics- option was definitely wrong even before the changes, as the code that handles this option is quite old. Mar 6, 2021 at 19:14
• That worked. I don't know how it's still working on the older Debian versions, but it's probably been this way for ages -- probably back to Etch based on some of the other stuff I see in the build setup, possibly back to Sarge. Now I just need to test and make sure the '300' value will work OK. Is the myconfig.cfg just a standard file that will be found automatically or do I need to do something to get htlatex to see it? Mar 9, 2021 at 1:52
• Oh wait -- I see. I was still using htlatex. I installed make4ht and that seems to work. Making the changes for buster that won't break it for older Debian releases is going to be fun :-) Mar 9, 2021 at 4:07
• @DavidGood if you want to use htlatex instead, try htlatex test.tex "myconfig,2,fn-in,graphics-". The config file without extension should be used instead of xhtml in the option string. make4ht gives better results in general, because it uses UTF-8 and HTML 5 by default. It also post-process the HTML files and fixes some common issues. Mar 9, 2021 at 8:24