1

I'm working on an article: main text (M) + appendix (X), both citing from two .bib files A.bib, B.bib, using biblatex.

I want to produce two separate bibliographies for M and X with different label prefixes for each (e.g. M1, M2, M3; and X1, X2, X3).

With refsection I was able to get separate bibliographies, but not different label prefixes.

\documentclass{article}

\usepackage{filecontents}
\usepackage{biblatex}

\begin{filecontents}{A.bib}
    @Book{Knuth:1990,
        author    = {Knuth, Donald E.},
        title     = {The {\TeX}book},
        year      = {1990},
        isbn      = {0-201-13447-0},
        publisher = {Addison\,\textendash\,Wesley},
    }   
\end{filecontents}
\begin{filecontents}{B.bib}
    @Book{Lamport:94,
        author    = {Lamport, Leslie},
        title     = {\LaTeX: A Document Preparation System},
        year      = {1994},
        isbn      = {0-021-52983-1},
        publisher = {Addison\,\textendash\,Wesley},
    }
\end{filecontents}

\addbibresource{A.bib}
\addbibresource{B.bib}

\begin{document}

    \section{Section One}
    Text \parencite{Lamport:94}.

    \section{Section Two}
    Text \parencite{Knuth:1990}.

    \printbibliography

    \appendix

    \section{Appendix One}
    \begin{refsection}
        Text \parencite{Knuth:1990}
        Text \parencite{Lamport:94}

        \printbibliography
    \end{refsection}

\end{document}

screenshot Any (simple) way to do that?

  • Can you show us a very short MWE of what you have so far? Without a code I can only recommend to look at the labelprefix option to \newrefcontext. – moewe Dec 3 '16 at 10:58
1

You can use the labelprefix option to \newrefcontext.

Just add \newrefcontext[labelprefix=M] for the main part and \newrefcontext[labelprefix=X] for the appendix.

\begin{document}
\newrefcontext[labelprefix=M]
\section{Section One}
Text \parencite{Lamport:94}.

\section{Section Two}
Text \parencite{Knuth:1990}.

\printbibliography

\appendix
\section{Appendix One}
\begin{refsection}
\newrefcontext[labelprefix=X]
  Text \parencite{Knuth:1990}
  Text \parencite{Lamport:94}

  \printbibliography
\end{refsection}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.