![强制在不同的引用部分中引用相同](https://linux22.com/image/454854/%E5%BC%BA%E5%88%B6%E5%9C%A8%E4%B8%8D%E5%90%8C%E7%9A%84%E5%BC%95%E7%94%A8%E9%83%A8%E5%88%86%E4%B8%AD%E5%BC%95%E7%94%A8%E7%9B%B8%E5%90%8C.png)
我有一份文件,其末尾有通用参考书目,每个部分都有简短参考书目。如何强制同一论文的参考文献 ID 在整份文件中保持一致?
以下是 MWE:
\documentclass{article}
\usepackage[
backend=biber,
style=alphabetic,
sorting=nyt,
natbib=false,
]{biblatex}
\addbibresource{test.bib}
\begin{filecontents}[force]{test.bib}
@Article{test1,
author = {First Author},
title = {First very interesting paper},
journal = {International Journal},
year = 2022,
}
@Article{test2,
author = {First Author},
title = {Second very interesting paper},
journal = {International Journal},
year = 2022,
}
\end{filecontents}
\begin{document}
\section{Introduction}
The material in this section is based on paper \cite{test1} (paper \cite{test2} is not relevant here).
\begin{refsection}
\nocite{test1}
\newrefcontext[sorting=ynt]
\printbibliography[
heading=none
]
\end{refsection}
\section{Body of the paper}
...
\nocite{*}
\printbibliography
\end{document}
我希望第一篇论文在整个文档中以相同的方式引用(“[Aut22a]”)。我不想将第 1 节的文本(“材料...”)放在 内refsection
,因为这样会将第二篇论文包含在引用中。
答案1
refsection
创建具有自己标签的独立单元。使用refsegment
然后按段进行过滤:
\documentclass{article}
\usepackage[
backend=biber,
style=alphabetic,
sorting=nyt,
natbib=false,
]{biblatex}
\addbibresource{test.bib}
\begin{filecontents}[force]{test.bib}
@Article{test1,
author = {First Author},
title = {First very interesting paper},
journal = {International Journal},
year = 2022,
}
@Article{test2,
author = {First Author},
title = {Second very interesting paper},
journal = {International Journal},
year = 2022,
}
\end{filecontents}
\begin{document}
\section{Introduction}
The material in this section is based on paper \cite{test1} (paper \cite{test2} is not relevant here).
\begin{refsegment}
\nocite{test1}
\newrefcontext[sorting=ynt]
\printbibliography[segment=\therefsegment,
heading=none
]
\end{refsegment}
\section{Body of the paper}
...
\nocite{*}
\printbibliography
\end{document}