
我的myconfig.cfg
程式碼區塊是:
\Preamble{xhtml}
\Configure{AddCss}{blitz-lite.css}
\begin{document}
\EndPreamble
我的命令列是tex4ebook -c myconfig test2.tex -f epub3 mathml
我得到以下內容:
[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
\begin{document}
設定檔中沒有遺失。我在記事本中將文件另存為UTF-8
.
我也blitz-lite.css
保存在工作目錄中。
可能是什麼問題呢?
更新:@michal.h21 正確地表明我可能有舊版本tex4ht
這是我在 MikTex2.9 控制台中看到的
``tex4ht`` 有兩個版本。也許工作流程正在呼叫舊的工作流程?
答案1
我猜這個問題可能是由於\Configure{AddCss}
Miktex 中缺少定義造成的。當您\Configure
在設定檔中使用 undefined 時,參數以文件內容結尾,您將得到Missing \begin{document} in
myconfig.cfg' error. You would get more detailed listing with the
-a debug argument to
tex4ebook`:
tex4ebook -a debug -c myconfig test2.tex -f epub3 mathml
\Configure{AddCss}
無論如何,作為一種解決方法,您可以使用TeX4ht 來源中的定義:
\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
配置\Configure{Needs}
將 CSS 檔案註冊為已使用的檔案。這是包含在 Epub 檔案中所必需的。