如何在 postnote 后显示 biblatex 字段?

如何在 postnote 后显示 biblatex 字段?

蓝皮书风格允许印刷资料的引用包含对 URL 的“平行”引用,只要这能改善访问。我不是遵循蓝皮书,但我同意这个原则,总结如下推介会

互联网来源的平行引用(规则 18.2.3)

  • 无论原文来源是什么,都要使用常规引用
  • 然后用逗号将该引文与互联网引文分开,“可从以下网址获取” 斜体,后面没有逗号和网址 * 例如:Am. Mining Cong. v. US Army Corps of Eng'rs,No. CIV.A. 93-1754 SSH (DDC Jan. 23, 1997)(强调)(引用 James v. Perry,285 US 360 (1944))可从以下网址获取 http://www.wetlands.com/fed/tulloch1.htm
    • 如果引用需要括号,则在括号后加上“可在何处获取”。换句话说,“可从以下网址获取” 出现在完整引用来源之后

在 Biblatex 中,我通常会使用 postnote 选项插入我用粗体突出显示的内容。这在没有平行引用的情况下是可以的(尽管我注意到该citepages=omit选项在添加括号后不起作用,这是一个不相关的问题)。

问题是,我使用字段快速而粗糙地实现了并行 URL 引用eprint(如果您有更好的建议,请告诉我),字段显示在后记之前,从语义角度来看这足够合乎逻辑,但这不是我想要的。我怎样才能让我的自定义字段最后显示,按照上述蓝皮书规定的格式?

最小工作示例:

\documentclass{article}
\usepackage[style=verbose-ibid, citepages=omit]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{hyperref}
\DeclareFieldFormat{eprint:paraurl}{\emph{available at} \textsc{url}: \url{#1}}

\begin{filecontents}{\jobname.bib}

@article{bertram,
  author       = {Bertram, Aaron and Daskalopoulos, Georgios and Wentworth, Richard},
  title        = {Gromov invariants for holomorphic maps on {Riemann} surfaces to Grassmannians},
  journaltitle = {Journal of the American Mathematical Society},
  date         = 1996,
  volume       = 9,
  number       = 2,
  pages        = {529--571},
}

@article{bertram_url,
  crossref     = {bertram},
  eprint       = {https://www.ams.org/journals/jams/1996-09-02/S0894-0347-96-00190-7/S0894-0347-96-00190-7.pdf},
  eprinttype   = {paraurl},
}

\end{filecontents}


\begin{document}

Foo\autocite[555 (this is fine)]{bertram}

Bar\autocite[555 (this is no good)]{bertram_url}

\end{document}

在此处输入图片描述

答案1

如果要将postnotepages字段一起打印,则必须修改打印的 bibmacros pages

以下解决方案使用选项的思想,并以相关方式citepages修改chapter+pages和bibmacros。note+pages

\documentclass{article}
\usepackage[style=verbose-ibid]{biblatex}

\usepackage{hyperref}

\DefineBibliographyStrings{english}{
  urlfrom = {available at},
}
\DeclareFieldFormat{url}{\bibstring[\emph]{urlfrom}\space\url{#1}}

\providetoggle{cbx:fullcite}%
\renewbibmacro*{cite:citepages}{%
  \global\togglefalse{cbx:fullcite}}%
\renewbibmacro*{cite:full:citepages}{%
  \global\toggletrue{cbx:fullcite}}%
\renewbibmacro*{cite:postnote}{%
  \iftoggle{cbx:fullcite}
    {}
    {\usebibmacro{postnote}}}

\newbibmacro*{pre:postnote}{%
  \ifnumequal{\value{citecount}}{\value{citetotal}}
    {\setunit{\printdelim{postnotedelim}}%
     \printfield{postnote}%
     \clearfield{postnote}}
    {}%
}
    
\renewbibmacro*{chapter+pages}{%
  \printfield{chapter}%
  \setunit{\bibpagespunct}%
  \printfield{eid}%
  \setunit{\bibpagespunct}%
  \printfield{pages}%
  \usebibmacro{pre:postnote}%
  \newunit}

\renewbibmacro*{note+pages}{%
  \printfield{note}%
  \setunit{\bibpagespunct}%
  \printfield{pages}%
  \usebibmacro{pre:postnote}%
  \newunit}

\begin{filecontents}{\jobname.bib}
@article{bertram,
  author       = {Bertram, Aaron and Daskalopoulos, Georgios and Wentworth, Richard},
  title        = {Gromov invariants for holomorphic maps on {Riemann} surfaces to Grassmannians},
  journaltitle = {Journal of the American Mathematical Society},
  date         = 1996,
  volume       = 9,
  number       = 2,
  pages        = {529--571},
}
@article{bertram_url,
  crossref = {bertram},
  url      = {https://www.ams.org/journals/jams/1996-09-02/S0894-0347-96-00190-7/S0894-0347-96-00190-7.pdf},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
Foo\autocite[555 (this is fine)]{bertram}

Bar\autocite[555 (this is also fine)]{bertram_url}
\end{document}

Aaron Bertram、Georgios Daskalopoulos 和 Richard Wentworth。“从黎曼曲面到格拉斯曼流形的全纯映射的 Gromov 不变量”。《美国数学学会杂志》9.2(1996 年),第 529–571、555 页(此页也可以)。可访问 https://www.ams.org/journals/jams/1996-09-02/S0894-0347-96-00190-7/S0894-0347-96-00190-7.pdf。

为了获得更citepages=omit-y 的感觉,使用

\renewbibmacro*{cite:full:citepages}{%
  \global\toggletrue{cbx:fullcite}%
  \ifboolexpr{
    test {\ifnumequal{\value{citecount}}{\value{citetotal}}}
    and
    test {\iffieldpages{postnote}}
  }
    {\clearfield{pages}%
     \clearfield{pagetotal}}
    {}}%

代替

\renewbibmacro*{cite:full:citepages}{%
  \global\toggletrue{cbx:fullcite}}%

在上面的代码中。但请注意,此代码明确检查是否是页面范围,并且仅在那种情况下postnote删除该字段。在您的示例中,它们都不会作为页面范围传递,因为它们包含非页面内容。如果您不想检查页面范围并希望在所有情况下都删除,请选择pages555 (this is fine)555 (this is no good)pages

\renewbibmacro*{cite:full:citepages}{%
  \global\toggletrue{cbx:fullcite}%
  \ifboolexpr{
    test {\ifnumequal{\value{citecount}}{\value{citetotal}}}
    and
    not test {\iffieldundef{postnote}}
  }
    {\clearfield{pages}%
     \clearfield{pagetotal}}
    {}}%

相关内容