BibLaTeX 允許創建條目集它由一系列參考文獻組成,例如
@set{set1,
entryset = {member1, member2}
}
但是,當使用 引用這些內容時\cite{set1}
,所有參考文獻都會在最終參考書目中顯示為單一項目。是否可以選擇將集合中的每個成員顯示為單獨的項目?本質上,我想達到與 相同的效果\cite{member1,member2}
,但通過引用集合名稱而不是單個成員。
答案1
從評論中可以看出,條目集不是相關概念,您只是在尋找列出幾個參考文獻的簡寫。簡單的 LaTeX 巨集就夠了。只需定義
\newcommand{\myreflist}{key1,key2,...}
然後您可以\cite{\myreflist}
根據需要使用 等來引用這些條目。
這是一個範例,證明此類引文排序功能仍然有效。
\documentclass{article}
\usepackage[sortcites=true]{biblatex}
\addbibresource{biblatex-examples.bib}
\newcommand{\myreflist}{westfahl:space,glashow,baez/article}
\begin{document}
Here some citations \cite{\myreflist}.
\printbibliography
\end{document}
答案2
您可以使用usebib
封裝者@egreg以此目的。包文檔幾乎包含了所需的所有解釋,即以下步驟,應按順序添加到序言中:
- 包含
\usepackage{usebib}
(載入後hyperref
); - 使用啟用該
entryset
密鑰\newbibfield{entryset}
; \bibinput{filename}
使用不帶擴展名的方式將其指向 bib 檔案.bib
;entryset
然後您可以使用訪問鍵的值\usebibentry{cite_key}{entryset}
。
總而言之,您可以透過 獲得您想要的東西\cite{\usebibentry{set1}{entryset}
。當然,如果需要,您也可以定義一個簡單的 new 命令來縮短它,例如
\newcommand{\citeset}[1]{\cite{\usebibentry{#1}{entryset}}}
那你就可以使用\citeset{set1}
.下面是一個最小的工作範例。
測試圍脖
@misc{foo1,
author = {Foo, F. and Bar, B.},
year = {2021},
title = {Foo 1},
}
@misc{foo2,
author = {Foo, F. and Bar, B.},
year = {2021},
title = {Foo 2},
}
@set{foo,
entryset = {foo1, foo2}
}
測試文件
\documentclass{article}
\usepackage{biblatex}
\addbibresource{test.bib}
\usepackage{usebib}
\newbibfield{entryset}
\bibinput{test}
\begin{document}
This is the entryset key: \usebibentry{foo}{entryset}
Here we cite foo as individual references.\autocite{\usebibentry{foo}{entryset}}
\printbibliography
\end{document}