[tex4ht] [bug #603] 13 figures OK, 14 figures gives ! LaTeX Error: Counter too large. only with tex4ht and subfigure

Nasser M. Abbasi puszcza-hackers at gnu.org.ua
Wed Jun 7 15:08:34 CEST 2023


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

                 Summary: 13 figures OK, 14 figures gives ! LaTeX Error:
Counter too large. only with tex4ht and subfigure
                 Project: tex4ht
            Submitted by: nma123
            Submitted on: Wed Jun  7 13:08:34 2023
                Category: None
                Priority: 5 - Normal
                Severity: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Reference:
https://tex.stackexchange.com/questions/687960/13-figures-ok-14-figures-gives-latex-error-counter-too-large-only-with-tex4

 changed to using subfigure inside figure. Now when I include more than 13
figures in one document, tex4ht gives

! LaTeX Error: Counter too large.

Same document compiles OK with lualatex. I made MWE below to show this. I am
using TL 2022

MWE

---------------
\documentclass[12pt,titlepage]{article}
\errorcontextlines=500
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{forloop}

\newcommand{\R}{\begin{figure}
\centering
\begin{subfigure}{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-a}
\caption{Solution plot}
\end{subfigure}%
\begin{subfigure}{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-b}
\caption{Phase plot}
\end{subfigure}%
\end{figure}}

\begin{document}      

%13 figures OK. 14 figure fails
\newcounter{x}
\forloop{x}{1}{\value{x} < 15}{%change this to 14 it works
    \R
                  
}
\end{document}
-------------------

Compile with

make4ht -ulm default -a debug index.tex "mathjax,htm"

Gives

------------------
make4ht -ulm default -a debug index.tex "mathjax,htm"
[INFO]    mkparams: Output dir: 
[INFO]    mkparams: Compiler: dvilualatex
[INFO]    mkparams: Latex options: -jobname='index'  
[INFO]    mkparams: tex4ht.sty: xhtml,mathjax,htm,charset=utf-8
[INFO]    mkparams: tex4ht:  -cmozhtf -utf8
[INFO]    mkparams: build_file: index.mk4
[INFO]    mkparams: Output format: html5
[STATUS]  make4ht: Conversion started
[STATUS]  make4ht: Input file: index.tex
[INFO]    make4ht: Using configuration file:
/home/me/.config/make4ht/config.lua
[INFO]    mkutils: Using build file /home/me/.config/make4ht/config.lua
[INFO]    mkutils: Load extension   common_domfilters
[INFO]    mkutils: Cannot open config file  index.mk4
[INFO]    make4ht-lib: setting param correct_exit
[INFO]    make4ht-lib: setting param correct_exit
[INFO]    make4ht-lib: setting param correct_exit
[INFO]    make4ht-lib: setting param ext
[INFO]    make4ht-lib: Adding:  ext dvi
[INFO]    htlatex: LaTeX call: dvilualatex --interaction=errorstopmode
-jobname='index'  
'\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\AddToHook{class/before}{\RequirePackage[#1,html]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname
tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode
xhtml,mathjax,htm,charset=utf-8,html5.a.b.c.\input "\detokenize{index.tex}"'
This is LuaTeX, Version 1.15.1 (TeX Live 2023/dev) 
 restricted system commands enabled.
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-01-24> (./index.tex
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/tex4ht.sty)
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2022/07/02 v1.4n Standard LaTeX document class
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/size12.clo))
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/usepackage.4ht)
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/graphics-hooks.4ht)
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics-def/dvips.def)))
(/usr/local/texlive/2022/texmf-dist/tex/latex/caption/subcaption.sty
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/caption-hooks.4ht)
(/usr/local/texlive/2022/texmf-dist/tex/latex/caption/caption.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/caption/caption3.sty)))
(/usr/local/texlive/2022/texmf-dist/tex/latex/forloop/forloop.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/ifthen.sty))
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/tex4ht.4ht
::::::::::::::::::::::::::::::::::::::::::
 TeX4ht info is available in the log file 
::::::::::::::::::::::::::::::::::::::::::
) (/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/tex4ht.sty
l.864 --- TeX4ht warning --- nonprimitive \everypar ---
--- needs --- tex4ht index ---
(./index.tmp) (./index.xref)
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/html4.4ht)
(/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/generic/tex4ht/html4.4ht)
(/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) (index.4tc)
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/latex.4ht
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/lm/t1lmr.fd))
(/usr/local/texlive/2022/texmf-dist/tex/generic/kastrup/binhex.tex)
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/tuenc.def)
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/tuenc-luatex.4ht
(/usr/local/texlive/2022/texmf-dist/tex/luatex/luatexbase/luatexbase.sty
(/usr/local/texlive/2022/texmf-dist/tex/luatex/ctablestack/ctablestack.sty))
(/usr/local/texlive/2022/texmf-dist/tex/lualatex/luacode/luacode.sty
(/usr/local/texlive/2022/texmf-dist/tex/generic/iftex/ifluatex.sty
(/usr/local/texlive/2022/texmf-dist/tex/generic/iftex/iftex.sty)))
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/html4.4ht)
(/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/generic/tex4ht/html4.4ht)
(/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/generic/tex4ht/html4.4ht)
(/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/mathjax-latex-4ht.4ht))
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/html5.4ht))
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/fontmath.4ht
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/html4.4ht)
(/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/generic/tex4ht/article.4ht
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/html4.4ht)
(/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/generic/tex4ht/graphicx.4ht
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/html4.4ht)
(/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/generic/tex4ht/graphics.4ht
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/html4.4ht)
(/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/generic/tex4ht/dvips.4ht
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/html4.4ht)
(/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/generic/tex4ht/subcaption.4ht
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/html4.4ht)
(/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/generic/tex4ht/caption.4ht
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/html4.4ht)
(/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/generic/tex4ht/ifthen.4ht
(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/html4.4ht)
(/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/generic/tex4ht/html4.4ht)
(/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)
(./index.aux) (/usr/local/texlive/2022/texmf-dist/tex/latex/base/ts1cmr.fd)17 
 nil

[1] [2]
l.30 --- TeX4ht warning --- File `"example-image-a.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
a.xbb" (no BoundingBox) ---
l.30 --- TeX4ht warning --- File `"example-image-b.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
b.xbb" (no BoundingBox) ---
18  nil
[3] [4] [5]
l.30 --- TeX4ht warning --- File `"example-image-a.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
a.xbb" (no BoundingBox) ---
l.30 --- TeX4ht warning --- File `"example-image-b.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
b.xbb" (no BoundingBox) ---
[6] [7] [8]
l.30 --- TeX4ht warning --- File `"example-image-a.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
a.xbb" (no BoundingBox) ---
l.30 --- TeX4ht warning --- File `"example-image-b.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
b.xbb" (no BoundingBox) ---
[9] [10] [11]
l.30 --- TeX4ht warning --- File `"example-image-a.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
a.xbb" (no BoundingBox) ---
l.30 --- TeX4ht warning --- File `"example-image-b.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
b.xbb" (no BoundingBox) ---
[12] [13] [14]
l.30 --- TeX4ht warning --- File `"example-image-a.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
a.xbb" (no BoundingBox) ---
l.30 --- TeX4ht warning --- File `"example-image-b.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
b.xbb" (no BoundingBox) ---
[15] [16] [17]
l.30 --- TeX4ht warning --- File `"example-image-a.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
a.xbb" (no BoundingBox) ---
l.30 --- TeX4ht warning --- File `"example-image-b.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
b.xbb" (no BoundingBox) ---
[18] [19] [20]
l.30 --- TeX4ht warning --- File `"example-image-a.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
a.xbb" (no BoundingBox) ---
l.30 --- TeX4ht warning --- File `"example-image-b.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
b.xbb" (no BoundingBox) ---
[21] [22] [23]
l.30 --- TeX4ht warning --- File `"example-image-a.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
a.xbb" (no BoundingBox) ---
l.30 --- TeX4ht warning --- File `"example-image-b.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
b.xbb" (no BoundingBox) ---
[24] [25] [26]
l.30 --- TeX4ht warning --- File `"example-image-a.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
a.xbb" (no BoundingBox) ---
l.30 --- TeX4ht warning --- File `"example-image-b.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
b.xbb" (no BoundingBox) ---
[27] [28] [29]
l.30 --- TeX4ht warning --- File `"example-image-a.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
a.xbb" (no BoundingBox) ---
l.30 --- TeX4ht warning --- File `"example-image-b.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
b.xbb" (no BoundingBox) ---
[30] [31] [32]
l.30 --- TeX4ht warning --- File `"example-image-a.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
a.xbb" (no BoundingBox) ---
l.30 --- TeX4ht warning --- File `"example-image-b.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
b.xbb" (no BoundingBox) ---
[33] [34] [35]
l.30 --- TeX4ht warning --- File `"example-image-a.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
a.xbb" (no BoundingBox) ---
l.30 --- TeX4ht warning --- File `"example-image-b.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
b.xbb" (no BoundingBox) ---
[36] [37] [38]
l.30 --- TeX4ht warning --- File `"example-image-a.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
a.xbb" (no BoundingBox) ---
l.30 --- TeX4ht warning --- File `"example-image-b.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
b.xbb" (no BoundingBox) ---
[39] [40] [41]
l.30 --- TeX4ht warning --- File `"example-image-a.xbb"' not found ---
l.30 --- TeX4ht warning --- Cannot determine size of graphic in
"example-image-
a.xbb" (no BoundingBox) ---

! LaTeX Error: Counter too large.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
\GenericError  ...                                
                                                  \endgroup 
\@alph ...\or v\or w\or x\or y\or z\else \@ctrerr 
                                                  \fi 
\caption at labelformat@parens ...{\nobreakspace }(#2
                                                  )
\cap:ref #1->\cur:lbl {}#1
                          \Tag {\float:cnt cAp\capt:cnt }{\cur:th
\:currentl...

<argument> ...cap:ref {\csname fnum@\@subcaptype \endcsname }
                                                  {\global \let
\caption at tem...

\sbox  #1#2->\setbox #1\hbox {\color at setgroup #2
                                                \color at endgroup }
\caption@@@make ...tempa {gobble\caption at tempb }}}
                                                  \ifdim \wd \@tempboxa
=\z at ...

<argument> ...norespaces \caption at makeanchor {Solution plot}}
                                                  }
\sbox  #1#2->\setbox #1\hbox {\color at setgroup #2
                                                \color at endgroup }
\caption at slc ...empboxa {\caption@@@make {#1}{#2}}
                                                  \ifdim \wd \@tempboxa
>\ca...

<argument> ...eline \caption at multiline }{\caption at multiline }
                                                  \caption at calcmargin
\capti...

\caption at box@none #1#2->#2
                          
\caption@@make@ ...#2}}\caption at make@rightmargin }
                                                  \caption at endhook 
\caption@@make ...ingroup \caption@@make@ {#1}{#2}
                                                  \endgroup
\caption@@make at e...

\@makecaption ...@@make {\cap:ref {#1}}{\cptC: #2}
                                                  \cptD: \caption at make@below 
<argument> ...norespaces \caption at makeanchor {Solution plot}}
                                                  \par \caption at nobreak
\cap...

\caption at setfloatcapt #1->#1
                            
\@caption ...page \@minipagetrue \@minipagefalse }
                                                  \caption at end 
\R ...h ]{example-image-a}\caption {Solution plot}
                                                   \end {subfigure}\begin
{s...

<argument>  \R 
    \par \addtocounter {x}{1}\forloop [1]{x}{\value {x}}{\value {x} < 15}{ \R
\

\@firstoftwo #1#2->#1
                     
l.30 }
    
? 
----------------------------


Since I need to include 1,000's of figures, this limitation will not work for
me. I think the problem started when I changed to using \begin{subfigure}. It
seems there is limitation of number of subfigures in tex4ht in one document? I
need to see if I can find a workaround.

The question is: Why does the above fail in tex4ht and not in lualatex/pdf?

Is this a bug in tex4ht?











    _______________________________________________________

Reply to this item at:

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

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



More information about the tex4ht mailing list.