![為什麼 \printbibliography[keyword=key1] 沒有如預期般運作?](https://rvso.com/image/472283/%E7%82%BA%E4%BB%80%E9%BA%BC%20%5Cprintbibliography%5Bkeyword%3Dkey1%5D%20%E6%B2%92%E6%9C%89%E5%A6%82%E9%A0%90%E6%9C%9F%E8%88%AC%E9%81%8B%E4%BD%9C%EF%BC%9F.png)
\documentclass{article}
\usepackage[backend=biber,style=ieee,sorting=ynt,defernumbers=true]{biblatex}
\addbibresource{references.bib}
\begin{document}
\section{Introduction}
\nocite{*}
\subsection*{Conference Articles}
\printbibliography[heading=none, resetnumbers,keyword={key1}]
\subsection*{Conference Abstracts}
\printbibliography[heading=none, resetnumbers,notkeyword={key1}]
\end{document}
有引文
@inproceedings{citation1,
author = "last1 , First1",
title = "title1",
booktitle = "book1",
pages = "0333",
year = "2022",
keyword="key1"
}
@inproceedings{citation2,
author = "Last2, First2",
title = "title2",
booktitle = "book2",
pages = "0045",
year = "2022"
}
沒有預期的輸出。根本無法辨識該關鍵字。因此,第一個 \printbibliography 不列印任何內容,而第二個 \printbibliography 則列印兩者。我究竟做錯了什麼?
答案1
.bib 檔案中的鍵應該是keywords
,而不是keyword
。您可以在此處放置多個關鍵字,因此得名。
\documentclass{article}
\begin{filecontents}{references.bib}
@inproceedings{citation1,
author = "last1 , First1",
title = "title1",
booktitle = "book1",
pages = "0333",
year = "2022",
keywords = "key1"
}
@inproceedings{citation2,
author = "Last2, First2",
title = "title2",
booktitle = "book2",
pages = "0045",
year = "2022"
}
\end{filecontents}
\usepackage[
backend=biber,
style=ieee,
sorting=ynt,
defernumbers=true
]{biblatex}
\addbibresource{references.bib}
\begin{document}
\section{Introduction}
\nocite{*}
\subsection*{Conference Articles}
\printbibliography[
heading=none,
resetnumbers,
keyword={key1}
]
\subsection*{Conference Abstracts}
\printbibliography[
heading=none,
resetnumbers,
notkeyword={key1}
]
\end{document}