2

当我使用 make4ht(或 htlatex)编译包含 biblatex 参考书目的 .tex 文件时,出现错误:

! Illegal parameter number in definition of \blx@tempa.
<to be read again> 
                   1
l.19 \printbibliography[heading=bibintoc]

当 .bib 文件中的书目记录包含一个 url(我使用 \url{link is here})时会发生此错误,并且似乎与该记录有多少字段有关,例如标题,已发布(或如何发布 @ misc),因为当我制作一个没有很多字段的更简单的书目记录时,不会发生此错误。

另外,当我为乳胶编译时,我对参考书目没有任何问题。

MWE(main_test_file.tex):

\documentclass[11pt]{article}

% Use Chicago Manual of Style:
\usepackage[authordate,autocite=inline,backend=biber,natbib]{biblatex-chicago}
\usepackage[colorlinks]{hyperref}
% References file:
\addbibresource{bib_test_file.bib}
%

\begin{document}

Some writing stuff: \autocite{trialurl1} works with make4ht when no extra stuff before $\backslash$url, but doesn't work when add another feature, like a title or howpublished, etc.
% Uncomment the following line, and the make4ht fails:
, as in \cite{trialurl2}.

More interesting stuff: \autocite{vanier} should have no problems with make4ht.

% The list of references is printed:
\printbibliography[heading=bibintoc]

\end{document}

引用trialurl2时,以下失败并出现上述错误:

make4ht -ue mybuild.mk4 main_test_file.tex

但在没有引用 trialurl2 时工作正常。在这两种情况下,我是否使用 \cite、\autocite、\citeauthor 等都无关紧要。会发生相同的行为。

此外,使用乳胶,然后是 biber,然后是乳胶,然后是乳胶,即使引用了 trialurl2,也可以正常工作。

bib_test_file.bib 文件是:

@misc{trialurl1,
author = {George, Birdie},
note = {\url{https://mail.yahoo.com/} Accessed 24 July 2020},
year = {2020},
}

@misc{trialurl2,
author = {George, Birdie},
title = {Hi},
note = {\url{https://mail.yahoo.com/} Accessed 24 July 2020},
year = {2020},
}

@book{vanier,
title = {Living Gently in a Violent World: The Prophetic Witness of Weakness},
author = {Vanier, Jean and Hauerwas, Stanley},
edition = {Second},
year = {2018},
publisher = {InterVarsity Press},
}

而 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

mybuild.mk4 取自 michael.h21 的答案 https://tex.stackexchange.com/questions/244828/illegal-parameter-with-biblatex

顺便说一句,michael.h21 的回答帮助我解决了一些其他问题,但对我目前的问题没有帮助。

4

1 回答 1

1

显然,对于 biblatex,.bib 文件需要更改(请参阅 moewe 的回答: https ://tex.stackexchange.com/questions/345175/bibtex-url-problem, 即使问题本身不相关)。

代替:

note = {\url{https://mail.yahoo.com/} Accessed 24 July 2020},

我应该说:

url = {https://mail.yahoo.com/},
urldate = {2020-07-24},

所以 .bib 文件应该是:

@misc{trialurl1,
author = {George, Birdie},
url = {https://mail.yahoo.com/},
urldate = {2020-07-24},
year = {2020},
}

@misc{trialurl2,
author = {George, Birdie},
title = {Hi},
url = {https://mail.yahoo.com/},
urldate = {2020-07-24},
year = {2020},
}

@book{vanier,
title = {Living Gently in a Violent World: The Prophetic Witness of Weakness},
author = {Vanier, Jean and Hauerwas, Stanley},
edition = {Second},
year = {2018},
publisher = {InterVarsity Press},
}

那么一切都很好。

于 2020-07-30T01:21:50.890 回答