[tex4ht] How to increase number of strings ? make4ht-lib: Fatal error. Command htlatex returned exit code 1

Nasser M. Abbasi nma at 12000.org
Fri Apr 22 07:35:22 CEST 2022


Finally managed to make it build.

Just needed to increase max_strings and hash size. Here
are the values needed

---------------------
>cat /usr/local/texlive/2022/texmf.cnf
buf_size=9000000
pool_size=9000000
main_memory=80000000
save_size=1000000
max_strings = 5000000
strings_free = 1000000
strings_free = 100000
hash_extra=1000000
--------------------------

It now compiled the MWE given below. It does take a long
time. This is another issue for another email. But tex4ht took
110 minutes to compile this file, (which is empty, but has
lots of empty chapters and sections), while lualatex about 2 minutes.

Tex4ht is really slow.

Now for the issue of losing links.

I used this command

make4ht  -ulm default foo.tex "mathjax,htm,fn-in,4"

On the MWE below.

This MWE does now show the problem I am now seeing in my actual file.
After some long chapters with many sections and subsections, the links
are missing and the HTML body seems corrupted with lots of empty space
in the middle.

Please find the zip file in this folder

<https://12000.org/tmp/tex4ht_problem_april_20_2022/>

called current_test.zip

All build files are in there. Openining the file foo.htm in
the browser, I found that after chapter 19, section 3,
subsection 93 is where the problem starts. Clicking on any
link after that gives

     Your file couldn’t be accessed
     It may have been moved, edited, or deleted.
     ERR_FILE_NOT_FOUND


This is a big problem. Any suggestions or something I should try or
any infoemation, please let me know.

TL 2022.

--Nasser

On 4/21/2022 8:15 PM, Nasser M. Abbasi wrote:
> I am getting lost sections in the table of content for
> the very last chapter in the HTML.
> 
> It shows only the first 2 sections in the last chapter. But
> there are 9 sections there.  It only happens when the document is large.
> 
> It seems to be related to some limit buildin.
> 
> So I made a MWE to try to find out why. Now on the MWE I get
> this error
> 
> -----------------------------------------
> [27910]
> l.36 --- TeX4ht warning --- \Link{ }? ---
> ! TeX capacity exceeded, sorry [number of strings=477757].
> \:aplus ...dafter \noexpand \:temp {\the \tmp:cnt
>                                                      }}\egroup \:temp
> l.36 }
> 
>     1508 words of node memory still in use:
>       17 hlist, 2 vlist, 2 rule, 1 disc, 4 local_par, 1 dir, 22 glue, 5 kern, 4 pe
> nalty, 30 glyph, 33 attribute, 116 glue_spec, 33 attribute_list, 1 temp, 4 if_s
> tack, 4 write, 26 special nodes
>       avail lists: 1:1,2:502,3:885,4:5,5:25,6:67,7:1336,9:158,10:4,11:3
> !  ==> Fatal error occurred, bad output DVI file produced!
> Output written on foo.dvi (27910 pages, 173384940 bytes).
> --------------------
> 
> I searched and do not see where to increase number of strings.
> 
> My current .cnf is
> 
>> cat /usr/local/texlive/2022/texmf.cnf
> buf_size=90000000
> pool_size=90000000
> main_memory=80000000
> save_size=1000000
> 
> 
> How does one increase "number of strings"?  I have 128 GB of ram.
> 
> On a related possible issue: does tex4ht uses lualatex in any way?
> I know it uses dvilualatex. does dvilualatex uses lualatex?
> 
> Here is the MWE and the command I used.
> 
> =======================
> \documentclass[12pt]{book}
> \usepackage{pgffor}
> 
> \begin{document}
> \ifdefined\HCode
> \Configure{tableofcontents*}{chapter,section}
> \else
> \setcounter{tocdepth}{1}
> \tableofcontents
> \fi
> 
> \ifdefined\HCode
> \TocAt{chapter,section}
> \TocAt{section,subsection}
> \fi
> 
> \foreach \n in {1,...,50}%
> {
>      \chapter{\n}
>      \foreach \m in {1,...,10}%
>      {
>          \section{\m}
>          \foreach \k in {1,...,200}%
>          {
>             \subsection{\k}
>          }
>      }
> }
> \end{document}
> ====================================
> 
>> make4ht  -ulm default foo.tex "mathjax,htm,fn-in,4"
> [STATUS]  make4ht: Conversion started
> [STATUS]  make4ht: Input file: foo.tex
> [ERROR]   htlatex: Compilation errors in the htlatex run
> [ERROR]   htlatex: Filename     Line    Message
> [ERROR]   htlatex: ?    36       TeX capacity exceeded, sorry [number of strings=477757].
> [ERROR]   htlatex: ?    36        ==> Fatal error occurred, bad output DVI file produced!
> [FATAL]   make4ht-lib: Fatal error. Command htlatex returned exit code 1
>>
> 
> 
> Thanks
> --Nasser



More information about the tex4ht mailing list.