我使用自定义环境{readon}
在章节末尾提供一些额外的文章和网站供阅读。我该如何更改以便它还打印此列表中条目\cite
的 URL ?@ONLINE
\documentclass{scrbook}
\usepackage[style=authortitle]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{lipsum}
\begin{filecontents}{\jobname.bib}
@Online{penalties,
author = {David Carlisle},
title = {What are penalties and which ones are defined?},
date = {2012-04-09},
url = {https://tex.stackexchange.com/a/51264/4918},
urldate = {2017-06-28},
}
@Book{texbytopic,
author = {Eijkhout, Victor},
title = {\TeX{} by Topic},
address = {Berlin},
year = {2014},
}
\end{filecontents}
\newenvironment{readon}{%
\par\bigskip\noindent
\footnotesize
\textbf{Further reading \dots}
\begin{itemize}
}{
\end{itemize}
}
\begin{document}
\lipsum[1-3]
\begin{readon}
\item \cite[155\psqq]{texbytopic}
\item \cite{penalties} [[add URL here]]
\end{readon}
\printbibliography
\end{document}
答案1
@online
您可以修改引用宏以打印条目的 URL
\renewbibmacro*{cite}{%
\iffieldundef{shorthand}
{\ifnameundef{labelname}
{}
{\printnames{labelname}%
\setunit{\printdelim{nametitledelim}}}%
\usebibmacro{cite:title}}%
{\usebibmacro{cite:shorthand}}%
\usebibmacro{cite:url}}
\newbibmacro{cite:url}{%
\ifentrytype{online}
{\setunit{\addspace}%
\printfield{url}}
{}}
由于这修改了cite
bibmacro,因此解决方案特定于authoryear
样式,但总体思路可应用于所有样式。