![在 MWE.tex 中使用脚注时,tex4ebook 出现错误](https://linux22.com/image/473229/%E5%9C%A8%20MWE.tex%20%E4%B8%AD%E4%BD%BF%E7%94%A8%E8%84%9A%E6%B3%A8%E6%97%B6%EF%BC%8Ctex4ebook%20%E5%87%BA%E7%8E%B0%E9%94%99%E8%AF%AF.png)
运行 tex4ebook 时出现以下 MWE 错误:The "a" element cannot contain any nested "a" elements.
电子书中的脚注如何发挥作用?
梅威瑟:
\documentclass{report}
\usepackage{footmisc}
\renewcommand*{\thefootnote}{\fnsymbol{footnote}}
\usepackage{tex4ebook}
\begin{document}
A sentence\footnote[3]{Some footnotetext}
Another sentence\footnotemark[3]
\end{document}
答案1
这是默认脚注处理中的一个错误。它在脚注标记中插入嵌套链接,从而导致此问题。尝试此配置文件:
\Preamble{xhtml}
\catcode`\:=11
\Configure{footnotetext}
{\ifTag{fn\FNnum x\minipageNum
}
{\expandafter\ifx\csname (fn\FNnum x\minipageNum
)\endcsname\def
\:warning{Multiple footnote texts for mark \FNnum}%
\else \csname a:footnote-text\endcsname\fi
}
{}%
%
\csname a:footnote-mark\endcsname
\AnchorLabel
\Link{}{fn\FNnum x\minipageNum
}%
\NoFonts%
}
{\EndNoFonts \EndLink\csname b:footnote-mark\endcsname
}
{\ifTag{fn\FNnum x\minipageNum
}
{\expandafter\ifx\csname (fn\FNnum x\minipageNum
)\endcsname\def
\else \csname b:footnote-text\endcsname\fi
}
{}%
\expandafter\global\expandafter
\let\csname (fn\FNnum x\minipageNum
)\endcsname\def
}
\catcode`\:=12
\begin{document}
\EndPreamble