htlatex 在 '\:temp{rm}' 处中断

htlatex 在 '\:temp{rm}' 处中断

使用TL2013,我无法再使用htlatex编译文档。

例如,使用:

\documentclass{scrbook}

\begin{document}
test

\end{document}

我得到:

$ htlatex test.tex 
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)
... output ...
(/usr/local/texlive/2013/texmf-dist/tex/generic/tex4ht/scrbook.4ht
! Missing \endcsname inserted.
<to be read again> 
                   \MessageBreak 
l.201 \:temp{rm}

这是已知错误吗?我是不是漏掉了什么(以前 TL2012 可以正常工作)?

答案1

** 另一项编辑 **

我发现tex4ht-4ht.tex文件链接指向的是相当旧的版本,因此提供的补丁可能无法解决此文件的问题。请下载此版本

编辑:

原始补丁已经应用于tex4ht源存储库中的源。正如 Ulrike 指出的那样,scrartcl仍然不起作用。所以我制作了新版本:

--- tex4ht-4ht.tex  (revision 129)
+++ tex4ht-4ht.tex  (working copy)
@@ -17032,6 +17032,7 @@
 % scrartcl.4ht (|version), generated from |jobname.tex
 % Copyright |CopyYear.1999. Eitan M. Gurari
 |<TeX4ht copywrite|>
+|<scr old fonts|>
 \input article.4ht
 |<scr artcl, reprt, book|>
 \Hinput{scrartcl}
@@ -17218,24 +17219,7 @@
 \ifx \@openbib@code\:UnDef \else
  \pend:def\@openbib@code{\labelsep\z@}
 \fi
-\def\:temp#1#2!*?: {\def\:temp{#1}}
-\expandafter\:temp\usepackage!*?: 
-\def\:tempa{\@latex@e@error}
-\ifx \:temp\:tempa \else
-   \def\popthree#1#2#3#4{#4}
-   \def\:tempa#1#2#3#4{\tmp:toks{#1{#2}}%
-   \long\expandafter\edef\csname #4 \endcsname{\the\tmp:toks
-        {\expandafter\noexpand
-    \csname o:\expandafter\expandafter\:gobble\expandafter\string \popthree#3:\endcsname}}} 
-\def\:temp#1{%
-  \expandafter\expandafter\expandafter\:tempa\csname #1 \endcsname{#1}}
-\:temp{rm}
-\:temp{sf}
-\:temp{tt}
-\:temp{bf}
-\:temp{it}
-
-\fi
+|<scr old fonts|>
   \let\:tempc\listoffigures
 \pend:def\:tempc{\begingroup \a:listoffigures
    \def\@starttoc{\:tableofcontents[lof]\:gobble}}
@@ -17434,24 +17418,7 @@
 \ifx \@openbib@code\:UnDef \else
  \pend:def\@openbib@code{\labelsep\z@}
 \fi
-\def\:temp#1#2!*?: {\def\:temp{#1}}
-\expandafter\:temp\usepackage!*?: 
-\def\:tempa{\@latex@e@error}
-\ifx \:temp\:tempa \else
-   \def\popthree#1#2#3#4{#4}
-   \def\:tempa#1#2#3#4{\tmp:toks{#1{#2}}%
-   \long\expandafter\edef\csname #4 \endcsname{\the\tmp:toks
-        {\expandafter\noexpand
-  \csname o:\expandafter\expandafter\:gobble\expandafter\string \popthree#3:\endcsname}}}
-\def\:temp#1{%
-  \expandafter\expandafter\expandafter\:tempa\csname #1 \endcsname{#1}}
-\:temp{rm}
-\:temp{sf}
-\:temp{tt}
-\:temp{bf}
-\:temp{it}
-
-\fi
+|<scr old fonts|>
   \let\:tempc\listoffigures
 \pend:def\:tempc{\begingroup \a:listoffigures
    \def\@starttoc{\:tableofcontents[lof]\:gobble}}
@@ -17607,7 +17574,26 @@
 }
 >>>

+\<scr old fonts\><<<
+\def\:temp#1#2!*?: {\def\:temp{#1}}
+\expandafter\:temp\usepackage!*?: 
+\def\:tempa{\@latex@e@error}
+\ifx \:temp\:tempa \else
+   \def\popthree#1#2#3#4{#4}
+   \def\:tempa#1#2#3#4{\tmp:toks{#1{#2}}%
+   \long\expandafter\edef\csname #4 \endcsname{\the\tmp:toks
+        {\expandafter\noexpand
+  \csname o:\expandafter\expandafter\:gobble\expandafter\string \popthree#3:\endcsname}}}
+\def\:temp#1{%
+  \expandafter\expandafter\expandafter\:tempa\csname #1 \endcsname{#1}}
+\:temp{rm}
+\:temp{sf}
+\:temp{tt}
+\:temp{bf}
+\:temp{it}

+\fi
+>>>

 \<addchap confic\><<<
 \ifx \@@maybeautodot\:UnDef

使用以下方法应用补丁

patch tex4ht-4ht.tex < koma-new.patch
tex tex4ht-4ht.tex

并将生成的scr*.4ht文件复制到您的文档目录中。

我明天会把这个补丁发到tex4ht邮件列表,这样源代码就能尽快更新,我希望,这个新补丁将不再需要


旧版本:

是的,这是一个已知的错误,它是由 TL 2013 中的新 Koma Script 版本引起的。您可以阅读更多信息这里.我为tex4ht创建了补丁文学来源scrfonts.patch

--- /home/mint/Downloads/tex4ht-4ht(1).tex  2014-01-20 10:10:43.922759293 +0100
+++ tmp/tex4ht-4ht.tex  2014-01-20 10:15:29.566168889 +0100
@@ -17243,10 +17243,11 @@
 \expandafter\:temp\usepackage!*?: 
 \def\:tempa{\@latex@e@error}
 \ifx \:temp\:tempa \else
+   \def\popthree#1#2#3#4{#4}
    \def\:tempa#1#2#3#4{\tmp:toks{#1{#2}}%
    \long\expandafter\edef\csname #4 \endcsname{\the\tmp:toks
         {\expandafter\noexpand
-   \csname o:\expandafter\:gobble\string #3:\endcsname}}}
+    \csname o:\expandafter\expandafter\:gobble\expandafter\string \popthree#3:\endcsname}}} 
 \def\:temp#1{%
   \expandafter\expandafter\expandafter\:tempa\csname #1 \endcsname{#1}}
 \:temp{rm}
@@ -17458,10 +17459,11 @@
 \expandafter\:temp\usepackage!*?: 
 \def\:tempa{\@latex@e@error}
 \ifx \:temp\:tempa \else
+   \def\popthree#1#2#3#4{#4}
    \def\:tempa#1#2#3#4{\tmp:toks{#1{#2}}%
    \long\expandafter\edef\csname #4 \endcsname{\the\tmp:toks
         {\expandafter\noexpand
-   \csname o:\expandafter\:gobble\string #3:\endcsname}}}
+  \csname o:\expandafter\expandafter\:gobble\expandafter\string \popthree#3:\endcsname}}}
 \def\:temp#1{%
   \expandafter\expandafter\expandafter\:tempa\csname #1 \endcsname{#1}}
 \:temp{rm}

您需要下载该文件tex4ht-4ht.tex,将其移动到某个临时目录并运行:

patch tex4ht-4ht.tex
tex tex4ht-4ht.tex

这将生成一堆.4ht文件,scrbook.4ht以及scratcl.4ht其中scrreport.4ht。我希望这个补丁能够找到tex4ht来源,将所需的文件放入文档目录中,而不是本地 texmf 树中

相关内容