
{readon}
セクションの最後に追加の記事や Web サイトを表示するためにカスタム環境を使用しています。このリストのエントリの\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
citeマクロを変更してエントリの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}}
{}}
これは bibmacro を変更するためcite
、ソリューションはauthoryear
スタイルに固有ですが、一般的な考え方はすべてのスタイルに適用できます。