使用 tex4ht 时未定义控制序列 \Hy@MakeCurrentHrefAuto

使用 tex4ht 时未定义控制序列 \Hy@MakeCurrentHrefAuto

我正在制作一本小型百科全书,其中的回忆录类很大程度上依赖于 \nameref。

如果相关的话,我会设置我的项目目录,以便有一个名为 articles/ 的文件夹,其中包含一堆 .tex 文件,每个文件都以 \section{} 开头,然后包含文章。然后我有一个构建脚本,它扫描目录中的所有文件,为每个首字母添加章节,并将这些和 \input{} 语句放在 compile/ 目录中的 tex 文件中(在它们周围添加“顶部”和“底部”文件),然后由 pdflatex 编译。(如果这没有意义,请参阅下面的输入文件。)正如我所说,这对 pdflatex 来说非常完美。

现在我想制作一个 html 版本。我以前用过的 latex2html 似乎不支持 \nameref,所以我四处寻找,发现了 tex4ht。我运行了htlatex compile.tex,但当它到达第一个子节时就卡住了:

/home/soren/current/maudiverse/./articles/history_abandonment.tex:4: Undefined 
control sequence.
<argument> \Hy@MakeCurrentHrefAuto 
                                   {section*}\setlength {\Hy@SectionHShift }...
l.4 \subsection{Departure}

(我尝试了在网上找到的几个其他命令,因为似乎有很多不同的调用 tex4ht 的方法;它们都给出了相同的错误。)

梅威瑟:

\documentclass[twocolumn]{memoir}
\usepackage[utf8x]{inputenc}
\usepackage{hyperref}

% headers
%\copypagestyle{maudcyclo}{plain}
%\createmark{section}{both}{shownumber}{\sectionname}{}

\begin{document}

% the dot in the middle of some paths is a funky consequence of how the build
% script combines paths; it does the same thing with it removed
\chapter{C}
\input{articles/communications.tex}
% ...and so on    
\end{document}

当我取消注释标题行(我在文档中使用)时,第一部分出现了略有不同的错误:

./compile.tex:11: Undefined control sequence.
<argument> \sectionname 
                        \@nameuse {thesection}
l.11 \section{Section}

不过,在早些时候,在我将其精简为这个小代码之前,它给出了与该小节相同的错误。

看起来 hyperref 有点问题 —— 知道是什么原因导致它不正常吗?(希望该解决方案也能继续适用于 pdflatex。)

如果有用,这是我之前显示的错误消息之前的完整输出(如果其他日志文件有用,请告诉我)。

soren@Emily:~/current/maudiverse/compile$ htlatex compile.tex
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, lo
aded.
(./compile.tex (/usr/share/texlive/texmf-dist/tex/latex/memoir/memoir.cls
Document Class: memoir 2011/03/06 v3.6j configurable book, report, article docu
ment class
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/share/texlive/texmf-dist/tex/latex/etex-pkg/etex.sty)
(/usr/share/texlive/texmf-dist/tex/latex/memoir/mem10.clo)
(/usr/share/texlive/texmf-dist/tex/latex/memoir/mempatch.sty))
(/usr/share/texmf/tex/generic/tex4ht/tex4ht.sty)
(/usr/share/texmf/tex/generic/tex4ht/usepackage.4ht)
(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/ucs/utf8x.def))
(/usr/share/texlive/texmf-dist/tex/latex/ucs/ucs.sty
(/usr/share/texlive/texmf-dist/tex/latex/ucs/data/uni-global.def))
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty))
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty)
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def)
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/url/url.sty)

Package hyperref Message: Stopped early.

) (/usr/share/texlive/texmf-dist/tex/latex/memoir/memhfixc.sty)

Package hyperref Message: Driver: htex4ht.

(/usr/share/texlive/texmf-dist/tex/latex/hyperref/htex4ht.def)
(/usr/share/texmf/tex/generic/tex4ht/tex4ht.4ht
::::::::::::::::::::::::::::::::::::::::::
 TeX4ht info is available in the log file 
::::::::::::::::::::::::::::::::::::::::::
) (/usr/share/texmf/tex/generic/tex4ht/tex4ht.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/color.sty
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/color.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/dvips.def)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/dvipsnam.def))
--- needs --- tex4ht compile ---
(./compile.tmp) (./compile.xref) (/usr/share/texmf/tex/generic/tex4ht/html4.4ht
) (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht)
(/usr/share/texmf/tex/generic/tex4ht/latex.4ht
(/usr/share/texmf/tex/generic/tex4ht/html4.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))
(/usr/share/texmf/tex/generic/tex4ht/fontmath.4ht
(/usr/share/texmf/tex/generic/tex4ht/html4.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))
(/usr/share/texmf/tex/generic/tex4ht/memoir.4ht
(/usr/share/texmf/tex/generic/tex4ht/book.4ht
(/usr/share/texmf/tex/generic/tex4ht/html4.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))
(/usr/share/texmf/tex/generic/tex4ht/verse.4ht
(/usr/share/texmf/tex/generic/tex4ht/html4.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))
(/usr/share/texmf/tex/generic/tex4ht/html4.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))
(/usr/share/texmf/tex/generic/tex4ht/mempatch.4ht
(/usr/share/texmf/tex/generic/tex4ht/html4.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))
(/usr/share/texmf/tex/generic/tex4ht/inputenc.4ht
(/usr/share/texmf/tex/generic/tex4ht/html4.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))
(/usr/share/texmf/tex/generic/tex4ht/utf8x.4ht)
(/usr/share/texmf/tex/generic/tex4ht/ucs.4ht)
(/usr/share/texmf/tex/generic/tex4ht/hyperref.4ht
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty))
Redoing nameref's sectioning
Redoing nameref's label
(/usr/share/texmf/tex/generic/tex4ht/nameref.4ht
(/usr/share/texmf/tex/generic/tex4ht/html4.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))
(/usr/share/texmf/tex/generic/tex4ht/html4.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))
(/usr/share/texmf/tex/generic/tex4ht/pd1enc.4ht
(/usr/share/texmf/tex/generic/tex4ht/html4.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))
(/usr/share/texmf/tex/generic/tex4ht/url.4ht
(/usr/share/texmf/tex/generic/tex4ht/html4.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))
(/usr/share/texmf/tex/generic/tex4ht/color.4ht
(/usr/share/texmf/tex/generic/tex4ht/html4.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))
(/usr/share/texmf/tex/generic/tex4ht/dvips.4ht
(/usr/share/texmf/tex/generic/tex4ht/html4.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))
(/usr/share/texmf/tex/generic/tex4ht/dvipsnam.4ht
(/usr/share/texlive/texmf-dist/tex/latex/graphics/dvipsnam.def)
(/usr/share/texmf/tex/generic/tex4ht/html4.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))
(/usr/share/texmf/tex/generic/tex4ht/html4.4ht)
(/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht)) (./compile.aux)
(/usr/share/texlive/texmf-dist/tex/latex/ucs/ucsencs.def)
(/usr/share/texmf/tex/generic/tex4ht/utf8x.4ht) [1]
l.68 --- TeX4ht warning --- \halign translated into linear text ---
[2] [3] (./compile.4ct) [4]
(/home/soren/current/maudiverse/articles/communications.tex
/home/soren/current/maudiverse/articles/communications.tex:1: Undefined control
 sequence.
<argument> \Hy@MakeCurrentHrefAuto 
                                   {section*}\setlength {\Hy@SectionHShift }...
l.1 \section{Communications}

? 

相关内容