我在这个问题中问了如何创建双重参考书目类型。从中得出了一个很酷的代码示例,我没有注意到其中的特殊情况。如果我没有引用某个项目,它就不会出现在完整的参考书目中。我希望在完整的参考书目中看到 .bib 文件中写的所有项目,无论它是否\cite{ref1}
在文档中被引用(带有)。
以下是与我一起开发的 MWE koleygr:
\documentclass{article}
\usepackage[backend=bibtex, style=numeric, defernumbers]{biblatex}
\usepackage{lipsum}
\addbibresource{./latexfiles/ref.bib}
\DeclareBibliographyCategory{skipbibliography}
\DeclareCiteCommand{\cite}[\mkbibfootnote]
{\usebibmacro{prenote}}
{\addtocategory{skipbibliography}{\thefield{entrykey}}%
\usedriver
{\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\begin{document}
This is text with \cite{Goossens} and %\cite{adams}.
\lipsum[1-8]
here is a last footcite \cite{einstein}
\printbibliography[notcategory=skipbibliography]
\pagebreak %<- Remove these lines if you dont nead a bibliography at the end
\printbibliography %<- 2md line to remove
\end{document}
在子文件夹中有一个名为“latexfiles/ref.bib”的文件
@Book{Goossens,
author = {Goossens, Michel and Mittelbach, Frank and
Samarin, Alexander},
title = {The LaTeX Companion},
edition = {1},
publisher = {Addison-Wesley},
location = {Reading, Mass.},
year = {1994},
}
@Book{adams,
title = {The Restaurant at the End of the Universe},
author = {Douglas Adams},
series = {The Hitchhiker's Guide to the Galaxy},
publisher = {Pan Macmillan},
year = {1980},
}
@article{einstein,
author = {Albert Einstein},
title = {{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]},
journal = {Annalen der Physik},
volume = {322},
}
您可以看到我删除了 \cite{adams} 作为示例。它没有出现在完整的参考书目中。
答案1
用 biber 回答(我将 bibtex 改为 biber 并在最后的 printbibliography 之前添加了'\nocite{*}'。请参阅评论):
\documentclass{article}
\usepackage[backend=biber, style=numeric, defernumbers]{biblatex} %<- changed "bibtex" to "biber"
\usepackage{lipsum}
\addbibresource{./latexfiles/ref.bib}
\DeclareBibliographyCategory{skipbibliography}
\DeclareCiteCommand{\cite}[\mkbibfootnote]
{\usebibmacro{prenote}}
{\addtocategory{skipbibliography}{\thefield{entrykey}}%
\usedriver
{\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\begin{document}
This is text with \cite{Goossens} and %\cite{adams}.
\lipsum[1-8]
here is a last footcite \cite{einstein}
\nocite{*} %<-Added this command to "cite un-cited citations" (lol)
\pagebreak
\printbibliography
\end{document}