fullcite でバックリファレンス印刷を無効にする

fullcite でバックリファレンス印刷を無効にする

次の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\ifbibliography185-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}

ここに画像の説明を入力してください

関連情報