htlatex 和 biblatex 之间不兼容的问题似乎永无止境。目前情况如何?
我似乎无法让 htlatex 提取 biblatex 引文。它总是抱怨Citation *** on page * undefined on input line **
我什么时候提取
latex draft1
biber draft1
htlatex draft1
有什么方法可以实现这个功能吗?或者这根本就不可能?
答案1
有可能某些biblatex
样式不起作用,但我们基于标准样式的测试套件可以正确编译。mwe
在这种情况下,我们确实需要一个。
make4ht
顺便说一句,对于这种东西,最好使用它,因为你可以轻松控制应该调用哪些命令。将以下代码保存为mybuild.mk4
:
Make:add("biber","biber ${input}")
if mode=="draft" then
Make:htlatex {}
else
Make:htlatex {}
Make:biber {}
Make:htlatex {}
Make:htlatex {}
Make:htlatex {}
end
此构建文件添加了对biber
命令的支持,默认情况下会调用它。如果要快速编译,可以使用 的-m draft
命令行选项make4ht
。
因此,要进行完整的编译,请调用
make4ht -ue mybuild.mk4 filename.tex
并进行快速编译
make4ht -ue mybuild.mk4 -m draft filename.tex
对于以下 TeX 文件:
%
% This file briefly presents the main citation commands. It also
% illustrates the typical structure of a document based on biblatex.
%
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
%
% We load the babel package and specify the main language of the
% document. If babel is detected, biblatex will automatically adjust
% to the default language of the document.
\usepackage[american]{babel}
%
% We load the csquotes package, which is required for
% language-specific quotation marks. See the csquotes manual for
% further information about this package.
\usepackage{csquotes}
%
% We are using the 'authoryear' style in this example.
% The default is the 'numerical' style.
\usepackage[style=authoryear,backend=biber]{biblatex}
\usepackage[colorlinks]{hyperref}
%
% We use the database biblatex-examples.bib.
\addbibresource{biblatex-examples.bib}
%
% Some generic settings.
\newcommand{\cmd}[1]{\texttt{\textbackslash #1}}
\setlength{\parindent}{0pt}
\begin{document}
\section*{Standard citation commands}
\subsection*{The \cmd{cite} command}
% The \cite command prints a bare citation without parentheses.
\cite{companion}
\cite[59]{companion}
\cite[see][]{companion}
\cite[see][59--63]{companion}
\subsection*{The \cmd{parencite} command}
% The \parencite command, which is intended for in-text citations,
% encloses the citation in parentheses. Note that the 'numeric' and
% 'alphabetic' styles use square brackets instead.
This is just filler text \parencite{companion}.
This is just filler text \parencite[59]{companion}.
This is just filler text \parencite[see][]{companion}.
This is just filler text \parencite[see][59--63]{companion}.
\subsection*{The \cmd{footcite} command}
% The \footcite command is similar to \parencite, except that the
% citation is given in a footnote.
This is just filler text.\footcite{companion}
This is just filler text.\footcite[59]{companion}
This is just filler text.\footcite[See][]{companion}
This is just filler text.\footcite[See][59--63]{companion}
\subsection*{The \cmd{textcite} command}
% The \textcite command is intended for citations integrated in the
% flow of text, replacing the subject of the sentence.
\textcite{companion} show that this is just filler text.
\textcite[59]{companion} show that this is just filler text.
% With \textcite, the first optional argument is of limited use
% only, since you could simply place the prenote in front of the
% citation. It is still supported for the sake of consistency.
\textcite[see][]{companion} show that this is just filler text.
\textcite[see][59--63]{companion} show that this is just filler text.
\section*{Style-independent commands}
\subsection*{The \cmd{autocite} command}
% The point of the \autocite command is that it automatically adapts
% to the predominant citation format (inline or footnote) normally
% used with the selected citation style. It should be used at the
% end of the sentence and usually works like \parencite or
% \footcite, depending on the citation style and the setting of the
% 'autocite' package option. With the author-year style used in this
% example, it works like \parencite:
This is just filler text \autocite{companion}.
\section*{Text commands}
% There are a few predefined commands for bibliographic data which
% is frequently used in the flow of text. Note that biblatex also
% grants access to all lists and fields at a lower level, see below.
\citeauthor{companion} show that this is just filler text.
% Note that \citetitle will use the 'shorttitle' field, if
% available.
See the \citetitle{companion} for more filler text.
% \citetitle*, on the other hand, always prints the 'title'
% field.
See also: \citetitle*{companion}. It has more filler text.
\citetitle*{companion} by \citeauthor{companion} was
published in \citeyear{companion}.
\section*{Special commands}
% The \nocite command adds an entry to the bibliography without
% printing any citation. If the argument is an asterisk (i.e.,
% '\nocite{*}'), all entries found in the bib file are added to the
% bibliography.
No citation here.\nocite{knuth:ct}
% The \fullcite command prints a verbose citation similar to the
% full bibliography entry.
\fullcite{companion}
% \footfullcite is similar to \fullcite, except that the citation is
% put in a footnote.
This is just filler text.\footfullcite{companion}
\section*{Low-level commands}
% The commands in this section grant low-level access to all
% bibliographic data. See the biblatex manual for details about the
% different data types (name lists, literal lists, fields).
% The \citename command prints a name list. For example, the
% \citeauthor command shown above is similar to the following
% low-level command:
\citename{companion}{author}
% The \citelist command is similar to \citename but prints literal
% lists.
\citelist{companion}{publisher}
% The \citefield command prints fields. For example, the
% \citetitle* command shown above is similar to the following
% low-level command (except for the formatting):
\citefield{companion}{title}
% The list of references is printed by way of \printbibliography.
\printbibliography
\end{document}
您将获得以下结果: