使用 biblatex/biber 仅在一个“refsection”中在引用前插入字母

使用 biblatex/biber 仅在一个“refsection”中在引用前插入字母

我想在正文和参考书目中的引用前插入一个字母(例如“S”)。我在这里发现了一个类似的问题:

如何在文中引用编号前添加字母?

然而:

  • 我只想做一件事refsection
  • 使用biblatex/ biber

但我不知道该怎么做。我的 MWE:

\documentclass{article}

\usepackage[sorting=none,backref=false]{biblatex}
\bibliography{\jobname.bib}

\begin{document}

\section{Considered as refsection 0}
This is a normal citation: \cite{NiInt_3}.

\section{Refsection1}
\begin{refsection}
I want to cite this \cite{NiInt_1} as [S1] here and in the bibliography.

\printbibliography[keyword=withletter, title={With letter}]
\end{refsection}

\printbibliography[title={Without letter}]

\end{document}

在此处输入图片描述

答案1

您可以\newrefcontext[labelprefix=S]在 refcontext 中使用:

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
  @book{lamport1994latex,
    title={LATEX: a document preparation system: user's guide and reference manual},
    author={Lamport, Leslie},
    year={1994},
    publisher={Addison-wesley}
  }
  @book{mittelbach2004latex,
    title={The LATEX companion},
    author={Mittelbach, Frank and Goossens, Michel and Braams, Johannes and Carlisle, David and Rowley, Chris},
    year={2004},
    publisher={Addison-Wesley Professional}
  }
\end{filecontents*}
\usepackage[sorting=none,backref=false]{biblatex}
\bibliography{\jobname.bib}

\begin{document}

\section{Considered as refsection 0}
This is a normal citation: \cite{mittelbach2004latex}.

\section{Refsection1}

\begin{refsection}
\newrefcontext[labelprefix=S]
I want to cite this \cite{lamport1994latex} as [S1] here and in the bibliography.

\printbibliography[title={With letter}]
\end{refsection}

\printbibliography[title={Without letter}]

\end{document}

在此处输入图片描述

相关内容