\documentclass[ebook,12pt,oneside,openany]{memoir}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{xurl}
\usepackage[hyperindex=true]{hyperref}
\hypersetup{
colorlinks = true, %Colours links instead of ugly boxes
urlcolor = blue, %Colour for external hyperlinks
linkcolor = blue, %Colour of internal links
citecolor = red %Colour of citations
}
\title{Test}
\author{Author}
\date{}
\begin{document}
\maketitle
\frontmatter
\tableofcontents \newpage
\mainmatter
\pagenumbering{arabic}
\chapter{New Chapter}
I am citing a book \footnote{sample footnote}.
\backmatter
\end{document}
我收到以下错误信息。
! LaTeX Error: No counter 'Hfootnote' defined.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
我的.mk4
文件如下:
Make:htlatex {}
Make:htlatex {}
答案1
在脚注定义中Memoir
,Hyperref
和之间存在冲突。最简单的解决方法是在 中定义计数器。这可以在自定义配置文件中完成。将以下代码保存为:tex4ht
Hfootnote
tex4ht
mycfg.cfg
\Preamble{xhtml}
\makeatletter
\@ifpackageloaded{hyperref}{%
\ifHy@hyperfootnotes
\newcounter{Hfootnote}
\fi
}{}
\makeatother
\begin{document}
\EndPreamble
使用以下方式请求配置文件
tex4ebook -c mycfg.cfg filename.tex
编译运行应该不会出现错误。