[tex4ht] Image processing error: max_count exceeded error from make4ht

Nasser M. Abbasi nma at 12000.org
Thu Dec 31 22:15:49 CET 2015

On 12/31/2015 9:00 AM, Michal Hoftich wrote:
> Hi Nasser,
> On Thu, Dec 31, 2015 at 1:04 PM, Nasser M. Abbasi <nma at 12000.org> wrote:
>> Hello;
>> I am building a large latex file with lots of images included
>   using includegraphics. Over 500 svg images.
>> Question is:  How to fix this error? Do I need to change
>> something in main.mk4?
> it seems that page numbers in the idv file (dvi file which contains
> images) don't equate to filenames generated by dvisvgm. It is strange,
> as it seems that some pages in the idv file weren't processed, they
> are maybe empty. It might be some problem with your configurations or
> document.
> Anyway, it was probably bad idea to depend on page numbers in the idv
> file, as image names from idv file are numbered consequently and image
> names used by tex4ht as well. So there is new version of the .mk4
> file:

Thanks Michal;

I replaced my current main.mk4 with the one you have given below.

I get now a new error:

        No such file or directory

Please see partial listing below (I put the index.log file
also in this folder http://12000.org/tmp/123115/

2051 words of node memory still in use:
    7 hlist, 2 vlist, 2 rule, 2 glue, 1 kern, 82 glue_spec, 1 write nodes
    avail lists: 1:4,2:52849,3:10612,4:1774,5:5706,6:12929,7:3487,8:2,9:8619,10:3
Output written on index.dvi (190 pages, 691032 bytes).
Transcript written on index.log.
Make4ht: tex4ht  -cunihtf -utf8 index
tex4ht.c (2012-07-25-19:36 kpathsea)
tex4ht -cunihtf
Execute script `index.lg'
Make4ht: t4ht  -p index.dvi
t4ht.c (2012-07-25-19:28 kpathsea)
t4ht -p
Entering index.lg
Entering index.css
Entering index.tmp
Make4ht: dvisvgm -v1 -n -c 1.15,1.15 -p 1- index.idv
DVI error: undefined font number 35
Make4ht: tex4ht  -cunihtf -utf8 index can be executed only 1x
Make4ht: t4ht  -p index.dvi can be executed only 1x
Parse LG
mv index-001.svg in2x.svg
mv index-002.svg in3x.svg
mv index-116.svg in117x.svg
mv index-117.svg in118x.svg
mv: cannot stat 'index-117.svg': No such file or directory
mv index-118.svg in119x.svg
mv: cannot stat 'index-118.svg': No such file or directory
mv index-119.svg in120x.svg
mv: cannot stat 'index-119.svg': No such file or directory
mv index-120.svg in121x.svg
mv: cannot stat 'index-120.svg': No such file or directory
mv index-121.svg in122x.svg
mv index-122.svg in123x.svg
mv: cannot stat 'index-122.svg': No such file or directory
mv index-123.svg in124x.svg
mv: cannot stat 'index-123.svg': No such file or directory
mv: cannot stat 'index-510.svg': No such file or directory
mv index-511.svg in512x.svg
mv: cannot stat 'index-511.svg': No such file or directory
parse_lg process file: index.htm
parse_lg process file: index.css
parse_lg process file: index.tmp
tmp file
parse_lg process file: inch1.htm
parse_lg process file: inse1.htm

May be this is all due to the "DVI error: undefined font number 35"?

May be some thing did not get written to the dvi file due to the
above, and things get messed up?

I am not doing anything different in this file from all my
other builds. Same makefile, same .cfg same main.mk4 (the one
you have below, worked fine on another build, no errors).

Only difference, this file generate this DVI error.

I did clean build. Still get this error.

If you have any suggestions what I can try, will be happy to.
Meanwhile, I'll try to see what this DVI error mean and where
it is coming from as it might be the cause of all this.

> -------------
> Make:add("dvisvgm","dvisvgm -v1 -n -c 1.15,1.15 -p 1- ${input}.idv")
> Make:htlatex {packages = "\\RequirePackage[dvipdfmx]{graphicx}"}
> local max_count = 5
> local image_pattern
> local function file_exists(fn)
>    local f = io.open(fn,"r")
>    if f ==  nil then return false else f:close() return true end
> end
> local function search_file(input, ext, count)
>    local pattern = count > 0 and "%s-%0"..count.."i." or "%s."
>    pattern = pattern .. ext
>    local filename = string.format(pattern, input, 1)
>    if file_exists(filename) then
>      return pattern
>    elseif count < 0 then return nil
>    else
>      return search_file(input, ext, count - 1)
>    end
> end
> local img_count = 0
> local function locate_file(par,ext)
>    if  image_pattern then
>      img_count = img_count + 1
>      return string.format(image_pattern, par.input,  img_count)
>    else
>      image_pattern =  search_file(par.input, ext, max_count)
>      if not image_pattern then
>        print("Cannot locate output svg pattern")
>        return nil
>      end
>      return locate_file(par, ext)
>    end
> end
> Make:htlatex{}
> Make:htlatex{}
> Make:htlatex{}
> Make:tex4ht{}
> Make:t4ht{}
> Make:dvisvgm{}
> Make:image("svg$",function(arg)
>    arg.input = arg.source:gsub(".idv$","")
>    local fn,msg = locate_file(arg, "svg")
>    if not fn then
>      print("Image processing error: "..msg)
>    else
>      arg.filename = fn
>      local cmd = "mv ${filename} ${output}" % arg
>      print(cmd)
>      os.execute(cmd)
>    end
> end
> )
> ------------
>> ps. I am also getting
>>      DVI error: undefined font number 35
>> which I never saw before. But this is I do not think it is related
>> to this max_count exceeded error. I think problem with dvisvgm.
>> If I do not find what is causing this DVI error, will send separate
>> email on it. I did not  want to mix the issues in one email.
> OK,
> Best regards,
> Michal


More information about the tex4ht mailing list