如何使用 bibtopic 重置引用計數器

如何使用 bibtopic 重置引用計數器

一切都在標題中。假設books.bib檔案中有 n 個引用,我希望第二部分的引用從 1 開始,而不是預設產生的 n+1 處。要重置的計數器的名稱是什麼?

\documentclass[a4paper,12pt]{report}
\usepackage{bibtopic}
\usepackage{filecontents}

\begin{filecontents}{books.bib}
@Book{Knuth1969,
    Title                    = {{The Art of Computer Programming}},
    Author                   = {Donald Knuth},
    Year                     = {1969},
    Volume                   = {2. Seminumerical Algorithms}
}

@Book{Knuth1968,
    Title                    = {{The Art of Computer Programming}},
    Author                   = {Donald Knuth},
    Year                     = {1968},
    Volume                   = {1. Fundamental Algorithms}
}
\end{filecontents}

\begin{filecontents}{articles.bib}
@Article{Doe2018,
    Title                    = {My beautiful paper},
    Author                   = {John Doe},
    Journal                  = {Any Journal},
    Year                     = {2018}
}
\end{filecontents}

\begin{document}
\begin{btSect}[unsrt]{books}
    \section{References from books}
    \btPrintAll
\end{btSect}

\begin{btSect}[unsrt]{articles}
    \section{References from articles}
    \btPrintAll
\end{btSect}

\end{document}

答案1

若要重置每個部分的參考文獻編號,您可以使用bibtopic的選項sectcntreset

來自bibtopic手動的(“2.2 封裝選項”,第 7 頁):

sectcntreset將每個 bt-Sect 環境的參考書目項目的數位標籤重設為「1」。 (預設為連續編號。)筆記\btPrintCited:只有在所有 btSect 環境中最多有一個指令時,這才有意義 ;否則,文檔中的引文標籤將不再是唯一的!壞事是你會得到沒有警告在這種情況下,來自 LaTeX multiply-defined labels- 所以請小心使用此選項。

相關內容