# [tex4ht] Can’t find/open file ‘xxx.dvi’ or ‘xxx.lg’

Michal Hoftich michal.h21 at gmail.com
Sun Apr 11 16:34:34 CEST 2021

I've originally sent my reply only to OP, so here it is again. Sorry
for the noise.

Hi,

I get the same error as you with this TeX file, so the issue is not
caused by a wrong installation of teX4ebook or make4ht. I've found
that the fatal error is caused by this line at the beginning of the TeX
file:

\pdfoutput=1

As TeX4ht works in the DVI mode, this causes everything to fail. I don't
think that it has any meaning, so I would remove it. If it has some use,
you can disable it just for TeX4ht, using:

\ifdefined\HCode\else
\pdfoutput=1
\fi

With this change, I can compile the file. There are still problems
though. One seems to be caused by a wrong configuration for eqnarray,
the other is caused by \maketitle redefinition in the custom package.

Here is the mycfg.cfg file, it should fix these issues:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Preamble{xhtml}
\ConfigureEnv{eqnarray}
{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="eqnarray">}}
{\ifvmode\IgnorePar\fi\EndP\HCode{</div>}\par}{}{}

% fix clash with \maketitle
\Configure{maketitle}{\ifvmode\IgnorePar\fi\EndP\HCode{<div
class="maketitle">}}{}{}{}{}{}{}{}
% close <div> before \tableofcontents
\renewcommand\beforetochook{\ifvmode\IgnorePar\fi\EndP\HCode{</div>}}
% put \title in <h1> element
\renewcommand\afterProceedingsSpace{\ShowPar\par\HCode{<h1>}}%
\renewcommand\afterTitleSpace{\HCode{</h1>}}
% disable \hrule
\special{t4ht at _}
\begin{document}
\EndPreamble
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Compile the document using:

tex4ebook -c mycfg.cfg -f epub3+dvisvgm_hashes draft

I've used the dvisvgm_hashes extension. It requires the SVG output for
math and included PDF images. It is also faster, as it converts several
images at once.

Best regards,
Michal

On Sun, Apr 11, 2021 at 4:03 AM 世纪初的魔术 <1019191262 at qq.com> wrote:
>
> I used the source attached to the annex, or you can download it from https://arxiv.org/format/2104.03341.
> the command I use is "./tex4ebook -f epub3 draft.tex". since i never used lua before, I don't know how to configure the location of tex4ebook(I tried adding package.path='/usr/local/lib/lua/5.2/?.lua;/home/amo/epub/tex4ebook/?.lua;' to tex4ebook, which didn't work), make4ht, and luaxml. So I just copy the source code of make4ht and luaxml to tex4ebook, and untar the arxiv source in tex4ebook. This is not elegant, but it's what I could finish for now. For texlive, mk4ht, htlatex I installed them by sudo apt-get.
>
>