当我使用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{此处有链接})时,就会出现此错误,而且似乎与记录有多少字段有关,例如标题、已发布(或@misc的how published ),因为当我创建一个没有很多字段的简单书目记录时,不会出现此错误。
此外,当我为latex编译时,我对参考书目没有任何问题。
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等,都会发生相同的行为。
此外,使用latex,然后使用biber,然后使用latex,然后使用latex,即使引用了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 here https://tex.stackexchange.com/questions/244828/illegal-parameter-with-biblatex的答案
顺便说一句,Michael.h21的答案帮助我解决了其他一些问题,但不是我目前的问题。
发布于 2020-07-30 09:21:51
显然,对于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},
}
那么一切都很好。
https://stackoverflow.com/questions/63081369
复制相似问题