1

My myconfig.cfg code block is:

\Preamble{xhtml}   
\Configure{AddCss}{blitz-lite.css}
\begin{document}
\EndPreamble

My command line is tex4ebook -c myconfig test2.tex -f epub3 mathml I get the following:

[STATUS]  tex4ebook: Conversion started
[STATUS]  tex4ebook: Input file: test2.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7250 64-bit)
entering extended mode
[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename     Line    Message
[ERROR]   htlatex: ?    4        LaTeX Error: Missing \begin{document} in `myconfig.cfg'.
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7250 64-bit)
entering extended mode
[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename     Line    Message
[ERROR]   htlatex: ?    4        LaTeX Error: Missing \begin{document} in `myconfig.cfg'.
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7250 64-bit)
entering extended mode
[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename     Line    Message
[ERROR]   htlatex: ?    4        LaTeX Error: Missing \begin{document} in `myconfig.cfg'.
        1 file(s) copied.
        1 file(s) copied.
        1 file(s) copied.
        1 file(s) copied.
        1 file(s) copied.
        1 file(s) copied.
        1 file(s) copied.
        1 file(s) copied.
HTML Tidy for Windows released on 25 March 2009
        1 file(s) copied.
[STATUS]  tex4ebook: Conversion finished

The \begin{document} is not missing in the config file. I saved the file in NotePad as UTF-8.

I also have blitz-lite.css saved in the working directory.

What could be the problem?

UPDATE: @michal.h21 correctly indicated that I might have an older version of tex4ht This is what I see in the MikTex2.9 console tex4ht packages

There are two versions of ```tex4ht``. Maybe the workflow is calling the old one?

  • I think this is the similar issue to the previous one. It seems TeX4ht files are quite old in Miktex and \Configure{AddCss} isn't available. – michal.h21 Nov 27 '19 at 19:37
  • @michal.h21 You are correct. I removed the \Configure{AddCss} and it compiled with no error. I noticed this in MikTex – MathDilettante Nov 27 '19 at 19:48
  • I will post an answer with a workaround – michal.h21 Nov 27 '19 at 19:49
  • @michal.h21 Just FYI... – MathDilettante Nov 27 '19 at 19:50
1

I guess that this issue may be caused by missing definition for \Configure{AddCss} in Miktex. When you use undefined \Configure in the configuration file, the arguments end in the document content and you will get the Missing \begin{document} inmyconfig.cfg'error. You would get more detailed listing with the-a debugargument totex4ebook`:

tex4ebook -a debug -c myconfig test2.tex -f epub3 mathml 

Anyway, as a workaround, you can use the definition of \Configure{AddCss} from TeX4ht sources:

\Preamble{xhtml}   
\NewConfigure{AddCss}[1]{%
  {\Configure{Needs}{File: #1}\Needs{}}
  \Configure{@HEAD}{\HCode{<link rel="stylesheet" type="text/css" href="#1" />\Hnewline}}
}
\Configure{AddCss}{blitz-lite.css}
\begin{document}
\EndPreamble

The \Configure{Needs} configuration register the CSS file as used file. It is necessary for the inclusion in the Epub file.

|improve this answer|||||
  • this works... Thanks – MathDilettante Nov 27 '19 at 20:10
  • @MathDilettante I hoped so :) did you notice Miktex devels about the obsolete .4ht files? – michal.h21 Nov 27 '19 at 20:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.