[Tex/LaTex] autocite + mcite functionality in Biblatex

biberbiblatexciting

When using Biblatex's autocite command, I sometimes come across instances when I need to format the citations as a reference set. There is the option of using mcite, but then I lose the high level markup that autocite offers, .e.g. switching between plain, inline and superscript. If I use autocite or autocites, each reference would get it's own citation in the bibliography. Is there a solution that offers something like what I call \mautocite in this example?

\usepackage[backend=biber,mcite,subentry,autocite=plain]{biblatex}
...
\begin{document}
Some text here\autocite{key1}. More text here\mautocite{set1,*key2,*key3,*key4}. 

Cite a subentry\autocite{key3}.

\end{document

In the text, it would appear as

Some text here [1]. More text here [2].

Cite a subentry [2b].

And this would give two entries in the bibliography, where the second reference, [2], would be a set. Is there a way to get biblatex to do this?

Best Answer

The mcite-like commands are defined in the biblatex module blx-mcite.def. There you will find a citation command modifier \mcitelike, used as follows.

\newrobustcmd*{<new mcite command>}{\mcitelike<existing citation command>}

An mcite-like \autocite is somewhat odd because \autocite is intended to be style-independent, but mcite-like commands are relevant only to numeric citation styles. That said you can define an mcite-variant of \autocite with:

\newrobustcmd*{\mautocite}{\mcitelike\autocite}

Here's an example.

\documentclass{article}
\usepackage[backend=biber,style=numeric,mcite,subentry,autocite=superscript]{biblatex}

% just for demo
\ExecuteBibliographyOptions{firstinits,sorting=none}

% define mcite-like variant of \autocite
\newrobustcmd*{\mautocite}{\mcitelike\autocite}

\addbibresource{biblatex-examples.bib}
\begin{document}
\mtextcite{companion,bertram,knuth,*knuth:ct:a,*knuth:ct:b} showed that...
Filler text \autocite{knuth:ct:a}.
Filler text \mautocite{model,*weinberg,*glashow}. 
Filler text \autocite{weinberg}.
\printbibliography
\end{document}

enter image description here

Note that here \mtextcite{companion,bertram,knuth,*knuth:ct:a,*knuth:ct:b} is the equivalent of:

\defbibentryset{knuth}{knuth:ct:a,knuth:ct:b}
\textcite{companion,bertram,knuth}

Similarly \mautocite{model,*weinberg,*glashow} becomes:

\defbibentryset{model}{weinberg,glashow}
\autocite{model}

Futher details can be found in the biblatex manual sections "mcite-like Citation Commands" and "Dynamic Entry Sets". Various label number and entry set bugs were introduced/fixed between versions 1.1 and 2.7, so you should upgrade to the latest biblatex and biber releases to get all relevant features working properly.