Biblatex:仅向一个参考书目添加评论

Biblatex:仅向一个参考书目添加评论

我必须为我的论文添加两个不同的参考书目:一个是评论,它添加了论文上方的评论,并包含我自己的出版物;最后一个是一般的,它包含所有引用的出版物。使用\AtEveryBibitem{\printfield{note}\clearfield{note}\item(来自当我在一个线程中编写一个注释时,我可以从中读出该note字段.bib并将注释放到我需要的地方。

问题在于,我的“标准”书目是根据 PubMed 的记录建立的,并且包含每个条目的注释。我不想在常规书目中显示这些注释,有没有办法在“原始出版物列表”中显示它们,并在常规书目中隐藏它们?

我的 MWE 如下所示:

\documentclass{scrreprt}
\usepackage[bibstyle=authoryear, backend=bibtex8]{biblatex}
\usepackage{filecontents}

\begin{filecontents}{jobname.bib}
@misc{A2011,
  author = {Author, A.},
  year = {2011},
  title = {A short title.},
  note = {Some information from the journal}

}
@misc{A2012,
  author = {Buthor, B.},
  year = {2012},
  title = {Systems biology and personalized medicine are two emerging research areas, which promise to transform our health system.},
  note = {This gives some additional information},
  keywords = {test}
}
@misc{A2013,
  author = {Cuthor, C.},
  year = {2013},
  title = {This title is short.},
  note = {This is a comment to this article.},
  keywords = {test}
}
@misc{C2000,
  author = {Duthor, D.},
  year = {2000},
  title = {Title for this reference.},
  note = {No further comment.}
}
\end{filecontents}
\addbibresource{jobname.bib}

%add the note field before each entry in the "Original Publications" bibliography
\AtEveryBibitem{\printfield{note}\clearfield{note}\item} 

\begin{document}
 \defbibnote{myprenote}{This thesis is based on the following original publications:}
 %\begin{refsection}
  \printbibliography[prenote=myprenote,title={List of original publications}, keyword=test]
 %\end{refsection}

 \section*{Test}
  This is a chapter to \textcite{A2011} and also cite some other publications \parencite{A2012, A2013, C2000}

  \printbibliography
\end{document}

答案1

由于您想有条件地打印某些书目中的注释,而不是其他书目中的注释,因此条件似乎是可行的方法

\newif\ifnoteRefSection
\AtEveryBibitem{\ifnoteRefSection\printfield{note}\item\fi\clearfield{note}}

然后,您需要在每次\printbibliography

\documentclass{scrreprt}
\usepackage[bibstyle=authoryear, backend=bibtex8]{biblatex}
\usepackage{filecontents}

\begin{filecontents}{jobname.bib}
@misc{A2011,
  author = {Author, A.},
  year = {2011},
  title = {A short title.},
  note = {Some information from the journal}

}
@misc{A2012,
  author = {Buthor, B.},
  year = {2012},
  title = {Systems biology and personalized medicine are two emerging research areas, which promise to transform our health system.},
  note = {This gives some additional information},
  keywords = {test}
}
@misc{A2013,
  author = {Cuthor, C.},
  year = {2013},
  title = {This title is short.},
  note = {This is a comment to this article.},
  keywords = {test}
}
@misc{C2000,
  author = {Duthor, D.},
  year = {2000},
  title = {Title for this reference.},
  note = {No further comment.}
}
\end{filecontents}
\addbibresource{jobname.bib}

%add the note field before each entry in the "Original Publications" bibliography
\newif\ifnoteRefSection
\AtEveryBibitem{\ifnoteRefSection\printfield{note}\fi\clearfield{note}\item}
% \AtEveryBibitem{\printfield{note}\clearfield{note}\item} 

\begin{document}
 \defbibnote{myprenote}{This thesis is based on the following original publications:}
 %\begin{refsection}
  \noteRefSectiontrue
  \printbibliography[prenote=myprenote,title={List of original publications}, keyword=test]
 %\end{refsection}


 \section*{Test}
  This is a chapter to \textcite{A2011} and also cite some other publications \parencite{A2012, A2013, C2000}

  \noteRefSectionfalse
  \printbibliography
\end{document}

相关内容