首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用标题字段而不是消除标题字段时,使用\url的记录的make4ht将失败

使用标题字段而不是消除标题字段时,使用\url的记录的make4ht将失败
EN

Stack Overflow用户
提问于 2020-07-25 04:57:23
回答 1查看 165关注 0票数 2

当我使用make4ht (或htlatex)编译一个包含biblatex书目的.tex文件时,我得到以下错误:

代码语言:javascript
运行
复制
! 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):

代码语言:javascript
运行
复制
\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文件为:

代码语言:javascript
运行
复制
@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是

代码语言:javascript
运行
复制
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的答案帮助我解决了其他一些问题,但不是我目前的问题。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-07-30 09:21:51

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

而不是:

代码语言:javascript
运行
复制
note = {\url{https://mail.yahoo.com/} Accessed 24 July 2020},

我应该说:

代码语言:javascript
运行
复制
url = {https://mail.yahoo.com/},
urldate = {2020-07-24},

因此,.bib文件应该是:

代码语言:javascript
运行
复制
@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},
}

那么一切都很好。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63081369

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档