强制在不同的引用部分中引用相同

强制在不同的引用部分中引用相同

我有一份文件,其末尾有通用参考书目,每个部分都有简短参考书目。如何强制同一论文的参考文献 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}

输出如下所示(注意突出显示的引用): 为 MWE 生成的输出

我希望第一篇论文在整个文档中以相同的方式引用(“[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}

在此处输入图片描述

相关内容