运行 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