I am only starting to learn how to beat on biblatex
. In general, you are trying to declare a new multicite command. For the numeric
style the \cites
is defined by
\DeclareMultiCiteCommand{\cites}[\mkbibbrackets]{\cite}{\multicitedelim}
so we want
\DeclareMultiCiteCommand{\mycites}[\mkbibbrackets]{\mycite}{\multicitedelim}
We now need to define \mycite
to do what we want. Again starting from teh original numeric
style
\DeclareCiteCommand{\cite}[\mkbibbrackets]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
we can go to
\DeclareCiteCommand{\mycite}[\mkbibbrackets]
{\usebibmacro{myprenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{mypostnote}}
leaving us to define \myprenote
and \mypostnote
. The originals are defined in biblatex.def
as
\newbibmacro*{prenote}{%
\iffieldundef{prenote}
{}
{\printfield{prenote}%
\setunit{\prenotedelim}}}
\newbibmacro*{postnote}{%
\iffieldundef{postnote}
{}
{\setunit{\postnotedelim}%
\printfield{postnote}}}
This is where I am not exactly sure what is best. One solution is
\newbibmacro*{myprenote}{x\space}
\newbibmacro*{mypostnote}{, y}
where x
and y
are whatever you want them to be. I don't think this is really the bibltex
way and I think slightly better is
\newbibmacro*{myprenote}{\printtext{x}\setunit{\prenotedelim}}
\newbibmacro*{mypostnote}{\printtext{\addcomma\space y}\setunit{\postnotedelim}}
but I don't really understand what this is doing and I think we should be using field formatting. Putting it all together
\documentclass{article}
\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}
\newbibmacro*{myprenote}{\printtext[prenote]{x}\setunit{\prenotedelim}}
\newbibmacro*{mypostnote}{\printtext[postnote]{\addcomma\space y}\setunit{\postnotedelim}}
\DeclareCiteCommand{\mycite}[\mkbibbrackets]
{\usebibmacro{myprenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{mypostnote}}
\DeclareMultiCiteCommand{\mycites}[\mkbibbrackets]{\mycite}{\multicitedelim}
\begin{document}
\cites(a)(b)[x][y]{angenendt}[x][y]{bertram}
\mycites(a)(b){angenendt}{bertram}
\end{document}