[Tex/LaTex] Separate bibliography in Roman numerals, citeable everywhere

biblatex

I would like to have two bibliographies in my PhD thesis, where the first one lists my own publications that are included in the thesis, and appears in the beginning, numbered by roman numerals. The main body of the text should then be able to cite this bibliography, with the roman numerals, and the main bibliography with ordinary numerals.

My best attempt this far, following Subbibliography with roman numbers and Biblatex and some other threads, has two faults: the citations to the first bibliography are numbered with latin numerals, and I cannot cite the first bibliography at all from within the main text (which is where I'd like to cite it).

Minimal (not quite) working example:

\documentclass{article}
\usepackage[backend=biber]{biblatex}
\DeclareFieldFormat{Roman}{\RN{#1}}
% The following definition is copied from numeric.bbx
\defbibenvironment{roman-numerals}
  {\list
     {\printtext[labelnumberwidth]{%
    \printfield{prefixnumber}%
    \printfield[Roman]{labelnumber}}}
     {\setlength{\labelwidth}{\labelnumberwidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\item}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{B02,
  author = {Buthor, B.},
  year = {2002},
  title = {Bravo},
}
\end{filecontents}

\begin{filecontents}{\jobname-mine.bib}
@misc{Mine1,
  author = {Me, M.},
  year = {2001},
  title = {Alpha},
}
@misc{Mine2,
  author = {Me, M.},
  year = {2002},
  title = {Bravo},
}
@misc{Mine3,
  author = {Me, M.},
  year = {2003},
  title = {Charlie},
}

\end{filecontents}

\addbibresource{\jobname.bib}
\addbibresource{\jobname-mine.bib}

\begin{document}
\begin{refsection}[\jobname-mine.bib]
\nocite{*}
\printbibliography[title={My publications}, env=roman-numerals]
\end{refsection}
Some text that won't be here, but note roman numerals don't work even here \cite{Mine1, Mine3}.

\section{Main text}

\begin{refsection}[\jobname.bib]
Citing things in body \cite{A01, B02}. Would like to cite things in section mine    \cite{Mine1}
\printbibliography[title=References]
\end{refsection}

\end{document}

Best Answer

I found a solution that's good enough for my own purposes, so I'm answering my own question. As @cfr suggested, using the shorthand field for the roman numerals basically does the trick. The separation part works by not using a refsection for the main text.

Remaining downsides, for anyone who's interested in trying to improve on this:

  • need to manually enter the roman numerals in the shorthand fields
  • the DeclareSourceMap feels like a bit of overkill for just preventing my publications from re-appearing in the main bibliography. Is there any better way to do this?
  • this will not work as is if one wants to use separate refsections in the main body (I don't, luckily)

The code:

\documentclass{article}
\usepackage[backend=biber]{biblatex}

%test data: other references
\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{B02,
  author = {Buthor, B.},
  year = {2002},
  title = {Bravo},
}
\end{filecontents}

%test data: my papers
\begin{filecontents}{\jobname-mine.bib}
@misc{Mine1,
  author = {Me, M.},
  year = {2001},
  title = {My Alpha},
  shorthand={\RN{1}}
}
@misc{Mine2,
  author = {Me, M.},
  year = {2002},
  title = {My Bravo},
  shorthand={\RN{2}}
}
@misc{Mine3,
  author = {Me, M.},
  year = {2003},
  title = {My Charlie},
  shorthand={\RN{3}}
}

\end{filecontents}

%Auto-add the keyword thpaper. Not strictly necessary, but saves some trouble
\DeclareSourcemap{
 \maps[datatype=bibtex]{
  \map{\perdatasource{\jobname-mine.bib} \step[fieldset = keywords, fieldvalue = {thpaper}]
  }
 }
}


\addbibresource{\jobname.bib}    
\addbibresource{\jobname-mine.bib}

\begin{document}

%Print the references to my papers. Refsection allows easy shortcutting with nocite{*} limited to the correct file
\begin{refsection}[\jobname-mine.bib]
\nocite{*}
\printbibliography[title={My publications}]
\end{refsection}

\section{Main text}

Citing things in body \cite{A01, B02}. Would like to cite my own publications \cite{Mine1}, and now it works, with the roman numerals even.
%Print the main bibliography, notkeyword=thpaper keeps my papers from re-appearing. 
%Using a refsection with a filename would be nicer, but that breaks the citations to my 
%publications.
\printbibliography[title=References, notkeyword=thpaper]

\end{document}