
(幾乎相關)
我有一個.bib
文件。我的文件有兩個部分,我想在每個部分的末尾列印參考書目僅該部分中引用的項目。當然,如果兩個部分都引用了某個項目,則可能存在交叉。
沒有偏好,可能是bibtex
,biblatex
或額外的東西。
微量元素
\begin{filecontents}{mybib.bib}
@article{faa,
title={Faa Something important},
author={Faa Big Guy and Another Big Guy},
journal={Prestigious Journal},
volume={47},
number={7},
pages={966--978},
year={2001},
publisher={Institute}
}
@article{foo,
title={Foo Something important},
author={Foo Big Guy and Another Big Guy},
journal={Prestigious Journal},
volume={47},
number={7},
pages={966--978},
year={2001},
publisher={Institute}
}
\end{filecontents}
\documentclass{report}
\usepackage{filecontents}
\begin{document}
\part{Faa}
\cite{faa}
\bibliographystyle{plain}
\bibliography{mybib}
\part{Foo}
\cite{foo}
%% I tried to insert twice, but got an error
%\bibliographystyle{plain}
%\bibliography{mybib}
\end{document}
答案1
biblatex
定義一個refsection
環境。請參閱文件中的第 3.7.4 節,參考書目部分,第 88-89 頁。
答案2
伯納德refsection
他的回答中已經提到了s 。
請注意,biblatex
有一個名為 的選項refsection
,可用於refsection
在某些部分自動啟動新命令。例如將為每個refsection=part
建立一個新的.不需要額外的程式碼。refsection
\part
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear, backend=biber, refsection=part]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
\part{One}
\cite{sigfridsson,worman,knuth:ct:b}
\printbibliography
\part{Two}
\cite{sigfridsson,nussbaum,knuth:ct:c}
\printbibliography
\end{document}
您可以開始一個新的refsection
,直到下一個refsection
為止
\newrefsection
如果您想更好地控制refsection
s 及其結尾,可以使用環境形式。
\begin{refsection}
\end{refsection}
請注意,refsection
s 不能嵌套,並且特定之外的所有內容refsection
都發生在第 0 節中。
refsection
讓它們的內容完全分開並且彼此獨立。這意味著同一條目可能在每個部分中具有不同的引用標籤,反之亦然,即兩個不同的條目具有相同的標籤。
如果這不是您想要的(或者您正在尋找一種在最後創建總體參考書目的方法),您可能需要查看refsegment
s.refsegment
本質上只是標記文檔特定部分中引用的條目。同樣,有一個名為 的選項可以為特定類型的每個切片命令refsegment
啟動一個新命令。refsegment
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear, backend=biber, refsegment=part]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
\part{One}
\cite{sigfridsson,worman,knuth:ct:b}
\printbibliography[segment=\therefsegment]
\part{Two}
\cite{sigfridsson,nussbaum,knuth:ct:c}
\printbibliography[segment=\therefsegment]
\printbibliography[title=Overall \bibname]
\end{document}
例如refsection
, refsegment
s 可以這樣開始
\newrefsegment
或可當環境
\begin{refsegment}
\end{refsegment}