根據帶註釋的參考書目的新字段在輸入後添加文本

根據帶註釋的參考書目的新字段在輸入後添加文本

添加

\DeclareDatamodelFields[type=field,datatype=literal]{cstatement}
\AtEveryBibitem{[\printfield{cstatement}]}

biblatex.cfg幾乎我想要的是。對於每個帶有關鍵字的 bibtex 條目cstatement="This is a foo",此程式碼使 biblatex 預先在參考書目熵中列印「This is a foo」。

但我什麼實際上需要的是這個新條目出現在該條目之後,就像在帶有註釋的參考書目中一樣。 「附錄」條目也是幾乎我想要什麼,但是,但不完全是因為 1)我想使用這個自訂關鍵字,2)我想要對格式有更多的控制。也就是說,我希望 cstatement 中的文字文字看起來像

\item [bibentry here]\\\ \\[cstatement literal text here]

其中\\\ \\導致 cstatement 的文字和 bibentry 之間有一個空白行。 (除非 cstatement 存在,否則換行符號不應該在那裡。)這應該適用於任何 bibtex 條目類型(文章、訴訟中等)

任何意見,將不勝感激。

答案1

我會\par在場前發出一個。然後您可以控制實際條目和註釋之間的距離\bibparsep。在參考書目條目末尾添加內容的一個非常簡單的方法是重新定義finentry所有好的參考書目樣式都應該使用的 bibmacro。

在這裡的範例中,我使用了該字段annotation而不是cstatement,但是如果您在資料模型檔案中聲明該字段,則可以簡單地交換所有提及的 annotationfor cstatement

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, backend=biber]{biblatex}

\setlength{\bibparsep}{.5\baselineskip}

\renewbibmacro*{finentry}{%
  \setunit{\finentrypunct\par}%
  \printfield{annotation}%
  \finentry}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{appleby,
  author     = {Humphrey Appleby},
  title      = {On the Importance of the Civil Service},
  date       = {1980},
  annotation = {This is a foo},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
\cite{appleby}
\printbibliography
\end{document}

附註釋的參考書目條目。

相關內容