[tex4ht] what would cause " Can't close file `index.tmp' (file is not open)" --- error --- Illegal storage address

Nasser M. Abbasi nma at 12000.org
Fri May 25 08:27:59 CEST 2018


Found the problem !

It is
          \usepackage{pdfpages}

Even though I do not use this package at all in tex4ht mode,
(it does not work) but by simply just loading, causes this
problem with tex4ht. It seems to redefine things which causes
problem with tex4ht.

So I changed it

\ifdefined\HCode
\else
    \usepackage{pdfpages}   %MAKE SURE YOU DO NOT USE THIS WITH htlatex
\fi

And now the error went away.

The funny thing I knew about this issue with this
package and tex4ht long time ago, but I forgot about it
earlier today when I added the pdfpages package
in order to use it in non-tex4ht mode.

case closed. Thanks.
--Nasser

On 5/25/2018 12:34 AM, Nasser M. Abbasi wrote:
> This is on texlive 2017. I have large index.tex file, compiling
> to HTML. It compiles OK to pdf. about 600 pages.
> 
> Near the end, with make4ht, after this command
> 
> make4ht --shell-escape --lua -u -c nma.cfg  -e main.mk4 index.tex "htm,3,pic-align,notoc*"
> 
> I keep getting an error on a file called index.tmp:
> 
> ---------------
> Compiler:       dvilualatex
> Latex options:  -shell-escape -jobname=index
> tex4ht.sty :    /cygdrive/x/data/HOME/nma.cfg,htm,3,pic-align,notoc*,charset=utf-8
> tex4ht   -cmozhtf -utf8
> build_file      /cygdrive/x/data/HOME/main.mk4
> Using build file        /cygdrive/x/data/HOME/main.mk4
> setting param correct_exit
> Adding:         packages        \RequirePackage[dvipdfmx]{graphicx}
> setting param correct_exit
> setting param correct_exit
> setting param correct_exit
> setting param ext
> setting param ext
> Adding:         ext     dvi
> LaTeX call: dvilualatex -shell-escape -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.{\g at addto@macro\@documentclasshook{\RequirePackage[#1,html]{tex4ht}\RequirePackage[dvipdfmx]{graphicx}}\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 /cygdrive/x/data/HOME/nma.cfg,htm,3,pic-align,notoc*,charset=utf-8.a.b.c.\input index.tex'
> This is LuaTeX, Version 1.0.4 (TeX Live 2017)
>    system commands enabled.
> .....
> 
> Output written on index.dvi (402 pages, 2412000 bytes).
> Transcript written on index.log.
> Make4ht: tex4ht  -cmozhtf -utf8 "index.dvi"
> ----------------------------
> tex4ht.c (2012-07-25-19:36 kpathsea)
> tex4ht -cmozhtf
>     -utf8
>     index.dvi
> .....
> ......
>    file index.tmp
>    file index.tmp
>    file index.tmp
> ] [21 file index.tmp
> --- warning --- Can't close file `index.tmp' (file is not open)
> --- error --- Illegal storage address
> Make4ht: Fatal error. Command tex4ht returned exit code 256
> -----------------
> 
> I removed all temporary files. Tried this on both linux and
> cygwin. And still get this error.
> 
> Has any one seen such an error before. I am not sure where
> to look to debug this more now. THe file index.tmp at the end
> looks to be corrupted. It has size of one byte only.
> 
> At the end, I see index.idv having zero byte size and index.tmp
> having 1 byte size. So something went wrong.
> 
> Any idea what to look for or try? I put index.log and
> index.tmp  files here
> 
>           https://www.12000.org/tmp/052418/
> 
> if someone wants to look at them.
> 
> Will keep trying to find what is wrong.
> thanks for any hints.
> 
> --Nasser
> 
>    
> 



More information about the tex4ht mailing list