![尝试使用 BibLaTeX 抑制 URL,使用简单的个人方法](https://linux22.com/image/267971/%E5%B0%9D%E8%AF%95%E4%BD%BF%E7%94%A8%20BibLaTeX%20%E6%8A%91%E5%88%B6%20URL%EF%BC%8C%E4%BD%BF%E7%94%A8%E7%AE%80%E5%8D%95%E7%9A%84%E4%B8%AA%E4%BA%BA%E6%96%B9%E6%B3%95.png)
根据此处的其他问题,我正在尝试使用 创建一个带注释的参考书目\fullcite
,其中我想隐藏所有 URL。
我正在使用一个看似简单的解决方案,它适用于“正常”参考书目,但不适用于\fullcite
(我已经包含了正常参考书目以供说明):
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{mwe82.bib}
@MANUAL{wilson2009,
author = {Peter Wilson},
title = {A Few Notes on Book Design},
year = {2009},
organization = {The Herries Press},
url = {http://mirrors.ctan.org/info/memdesign/memdesign.pdf},
address = {Normandy Park, WA},
urlaccessdate = {19.12.2012}
}
\end{filecontents*}
\usepackage[%
citestyle=authoryear,
bibstyle=authoryear,
backend=biber,
bibencoding=utf8,
]{biblatex}
\addbibresource{mwe82.bib}
\AtEveryBibitem{%
\clearfield{url}%
}
\begin{document}
\fullcite{wilson2009}
\printbibliography
\end{document}
给出这个:
有人能告诉我我做错了什么吗?
答案1
有不同的方法。
首先在 LaTeX 级别上你可以使用
\AtEveryCitekey{\clearfield{url}}
\AtEveryBibitem
仅适用于\printbibliography
。
或者你使用 Biber 解决方案:
\DeclareSourcemap{
\maps[datatype=bibtex ]{
\map{
\step [ fieldset = url , null ]
}
}
}
梅威瑟:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{mwe82.bib}
@MANUAL{wilson2009,
author = {Peter Wilson},
title = {A Few Notes on Book Design},
year = {2009},
organization = {The Herries Press},
url = {http://mirrors.ctan.org/info/memdesign/memdesign.pdf},
address = {Normandy Park, WA},
urlaccessdate = {19.12.2012}
}
\end{filecontents*}
\usepackage[%
citestyle=authoryear,
bibstyle=authoryear,
backend=biber,
bibencoding=utf8,
]{biblatex}
\addbibresource{mwe82.bib}
\DeclareSourcemap{
\maps[datatype=bibtex ]{
\map{
\step [ fieldset = url , null ]
}
}
}
\begin{document}
\fullcite{wilson2009}
\printbibliography
\end{document}