章節末的參考書目

章節末的參考書目

我想在每章最後都有參考書目(後來也在書的最後)。

在這個 MWE 中這不起作用。我預計最後會出現“[1] AB,測試日誌...”Bibtex 運行時顯示“進程正常退出”。

\documentclass{book}

\usepackage[ngerman]{babel}

\usepackage[sorting=none, backend=bibtex]{biblatex} % load the package

\begin{filecontents}{bibliography_file.bib}
@ARTICLE{myref,
  AUTHOR       = "A B",
  TITLE        = "Test",
  JOURNAL      = "Journal",
  YEAR         = "2019",
  NUMBER       = "1"
}
\end{filecontents}

\addbibresource{bibliography_file.bib} % add a bib-reference file

\begin{document}

\chapter{First Chapter}

Hello. We cite \cite{myref}

\begin{refsection} % refsection environment
Citation section \thesection: \cite{myref} % collect citations
\printbibliography[heading=subbibliography] % print section bibliography
\end{refsection}

\end{document}

答案1

如果您想將refsections 與 BibTeX 一起使用,您不僅需要在主文件上運行 BibTeX,還需要在每個refsection.

事實上,MWE 會發出警告

Package biblatex Warning: Please (re)run BibTeX on the file(s):
(biblatex)                refsectbibtex
(biblatex)                refsectbibtex1-blx
(biblatex)                and rerun LaTeX afterwards.

第一次運轉時。因此,您不僅可以運行 BibTeX refsectbibtex,還可以運行 BibTeX refsectbibtex1-blx(對於其他參考文獻也是如此)。

正常的編譯順序

latex <file>
bibtex <file>
latex <file>
latex <file>

從而變成

latex <file>
bibtex <file>
bibtex <file>1-blx
...
bibtex <file>n-blx
latex <file>
latex <file>

其中n是 s 的數量refsection


如果您使用 Biber 而不是 BibTeX,則不需要額外的 Biber 運行,您可以擁有任意多個refsections 並且仍然可以使用

latex <file>
biber <file>
latex <file>
latex <file>

只需更改backend=bibtex,backend=biber,並運行 Biber 而不是 BibTeX (Biblatex 與 Biber:配置我的編輯器以避免未定義的引用可以為您的編輯提供協助)。

由於某些高級biblatex功能僅適用於 Biber,因此切換到 Biber 將是解決此問題的首選方法。

相關內容