
次のMWEを考えてみましょう
\documentclass{article}
\usepackage[style=authoryear-comp,backend=biber,backref=true]{biblatex}
\addbibresource{biblatex-examples.bib}
\newbibmacro*{mypageref}{%
\addperiod
\iflistundef{pageref}
{}
{\printtext[brackets]{%
\ifnumgreater{\value{pageref}}{1}
{\bibstring{backrefpages}\ppspace}
{\bibstring{backrefpage}\ppspace}%
\printlist[pageref][-\value{listtotal}]{pageref}}}}
\renewbibmacro{pageref}{}
\renewbibmacro{finentry}{%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{mypageref}%
\finentry}
\begin{document}
\fullcite{knuth:ct:e}
\printbibliography
\end{document}
これにより、バックリファレンスを希望どおりにフォーマットできます (括弧内など)。また、コマンドでバックリファレンスも出力されます\fullcite
。 を使用する場合、参考文献でバックリファレンス (およびフォーマット) を保持しながら、ドキュメントの本文でバックリファレンスを無効にするにはどうすればよいでしょうか\fullcite
。
答え1
理論的には、citeコマンド内か参考文献内かを確認することは可能だが(および\ifcitation
、\ifbibliography
185-186ページ)、biblatex
ドキュメンテーション、ここで実際には必要ありません。pageref
マクロを変更して必要な操作を実行できるからです (新しい は必要ありませんmypageref
)。また、ピリオドを使用してページ参照を参考文献エントリの残りの部分から分離できます。
\renewcommand{\bibpagerefpunct}{\addperiod\space}
\renewbibmacro*{pageref}{%
\iflistundef{pageref}
{}
{\printtext[brackets]{%<--- here we had parens before
\ifnumgreater{\value{pageref}}{1}
{\bibstring{backrefpages}\ppspace}
{\bibstring{backrefpage}\ppspace}%
\printlist[pageref][-\value{listtotal}]{pageref}}}}
標準はspageref
では使用されていない\fullcite
ため、ここでは問題ありません。
ムウェ
\documentclass{article}
\usepackage[style=authoryear-comp,backend=biber,backref=true]{biblatex}
\addbibresource{biblatex-examples.bib}
\renewcommand{\bibpagerefpunct}{\addperiod\space}
\renewbibmacro*{pageref}{%
\iflistundef{pageref}
{}
{\printtext[brackets]{%
\ifnumgreater{\value{pageref}}{1}
{\bibstring{backrefpages}\ppspace}
{\bibstring{backrefpage}\ppspace}%
\printlist[pageref][-\value{listtotal}]{pageref}}}}
\begin{document}
\fullcite{knuth:ct:e}
\printbibliography
\end{document}