将自定义 .bib 条目添加到参考书目

将自定义 .bib 条目添加到参考书目

我想将书页总数(例如“,543 S.”)添加到每个书目条目(如果该字段已填充)。我已将 .bib 字段命名为“nop”

例如:“PAIL, R. (2017) [...] Springer Spektrum, 217–257, 543 S.”

而不是“PAIL, R. (2017) [...] Springer Spektrum, 217–257。”。

我删除了很多实际书目设计的代码,因为我觉得这里没必要这么做。代码如下:

\documentclass[10pt,a4paper]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}

\usepackage{csquotes}
\usepackage[style=ext-authoryear-ibid, giveninits=true, uniquelist=false, 
backend=biber, natbib=true]{biblatex}
\addbibresource{Quellen.bib}

\begin{document}
\parencite[220]{Pail.2017}
\printbibliography
\end{document}

@book{Pail.2017,
 author = {Pail, Roland},
 title = {Globale Schwerefeldmodellierung am Beispiel von GOCE},
 pages = {217--257},
 booktitle = {Erdmessung und Satellitengeod{\"a}sie},
 year = {2017},
 address = {Berlin}
 nop = {543}
}

答案1

您正在寻找的字段是pagetotalpagetotal保存作品的总页数。标准样式仅打印pagetotal类似@book的独立作品(@book@collection@manual@thesis……)。

例如从biblatex-examples.bib

@book{companion,
  author       = {Goossens, Michel and Mittelbach, Frank and Samarin, Alexander},
  title        = {The {LaTeX} Companion},
  date         = 1994,
  edition      = 1,
  publisher    = {Addison-Wesley},
  location     = {Reading, Mass.},
  pagetotal    = 528,
}

如果您坚持在 之前使用逗号pagetotal,那么您将需要修补 bibdrivers。

\documentclass[10pt,a4paper]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}

\usepackage{csquotes}
\usepackage[style=ext-authoryear-ibid, giveninits=true, uniquelist=false, 
backend=biber, natbib=true]{biblatex}

\usepackage{xpatch}
\newcommand*{\commapagetotal}[1]{%
  \xpatchbibdriver{#1}
    {\newunit\printfield{pagetotal}}
    {\setunit{\addcomma\space}\printfield{pagetotal}}
    {}{}}
\forcsvlist{\commapagetotal}{book,booklet,collection,manual,proceedings,report,thesis}

\addbibresource{biblatex-examples.bib}

\begin{document}
\parencite{companion}
\printbibliography
\end{document}

在此处输入图片描述


原始问题有一个@incolletion条目作为示例。事情有点棘手...

对于像 这样的作品@inbook@incollection@article使用该字段,因为可以根据该字段轻松计算出总页数pages

在用封闭作品的总页数填充类型作品pagetotal的字段时,存在轻微的语义怪癖,但类似的事情也会发生在或上,因此......@in...editorisbn

您需要修补 的驱动程序@incollection以将其包括在内。这可以通过的pagetotal来完成。xpatch\xpatchbibdriver

\documentclass[10pt,a4paper]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}

\usepackage{csquotes}
\usepackage[style=ext-authoryear-ibid, giveninits=true, uniquelist=false, 
backend=biber, natbib=true]{biblatex}

\usepackage{xpatch}
\newcommand*{\addpagetotalto}[1]{%
  \xpatchbibdriver{#1}
    {\usebibmacro{chapter+pages}}
    {\usebibmacro{chapter+pages}\newunit\printfield{pagetotal}}
    {}{}}
\forcsvlist{\addpagetotalto}{inbook,incollection,inproceedings}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@incollection{Pail.2017,
 author    = {Pail, Roland},
 title     = {Globale Schwerefeldmodellierung am Beispiel von GOCE},
 pages     = {217--257},
 publisher = {Springer Spektrum},
 editor    = {Rummel, Reinhard and Freeden, Willi},
 booktitle = {Erdmessung und Satellitengeodäsie},
 year      = {2017},
 address   = {Berlin},
 pagetotal = 543,
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
\parencite[220]{Pail.2017}
\printbibliography
\end{document}

在此处输入图片描述

我个人认为这些信息是多余的,但如果你喜欢它......

相关内容