One (at least I find) elegant and quite usable way would be a new command, say \sidecite
.
It will use the same syntax as all the \cite
command, but features an optional offset argument enclosed in <>
at the beginning.
We will use xparse
to implement it.
First we copy the definition of \footcite
from the relevant .cbx
style file (in your case verbose.cbx
), rename it to \sidecitehelper
and replace \mkbibfootnote
by \bibfootnotewrapper
(so we don't actually get a footnote, but consistent output).
\DeclareCiteCommand{\sidecitehelper}[\bibfootnotewrapper]
{\usebibmacro{prenote}%
\toggletrue{blx@footnote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}
Then we define \sidecite
\ExplSyntaxOn
\NewDocumentCommand\sidecite{D<>{}O{}om}{%
\iftoggle{blx@footnote}
{\cs_set_protected_nopar:Npn \__sct_wrapper:nn ##1 ##2 {\mkbibparens{##2}}}
{\cs_set_protected_nopar:Npn \__sct_wrapper:nn ##1 ##2 {\sidenote[][##1]{##2}}}
{\IfNoValueTF{#3}
{\__sct_wrapper:nn{#1}{\sidecitehelper[#2]{#4}}}
{\__sct_wrapper:nn{#1}{\sidecitehelper[#2][#3]{#4}}}}
}
\ExplSyntaxOff
With this updated definition of \sidecite
we now check if we are in a side note (footnote) and if so only wrap the citation in parentheses instead of creating nested foot/side notes.
We have a dummy command \__sct_wrapper:nn
that in footnotes just wraps things in parentheses and outside of footnotes creates a side note.
In biblatex
the command \mkbibfootnote
takes care of that, and if we hadn't wanted \sidenote
to be able to take its optional argument, an approach with a wrapper command mirroring \mkbibfootnote
would have been easier; but since we need the optional argument, all this handling has been moved to \sidecite
.
There is one problem left with that: tufte-latex
's \footnote
command can by default not be patched by biblatex
, so we need to do that ourselves.
We use xpatch
for that
\makeatletter
\xpatchcmd{\@footnotetext}%
{\color@begingroup}
{\color@begingroup\toggletrue{blx@footnote}}
{}
{}
\makeatother
MWE
\documentclass[nobib]{tufte-handout}
\usepackage{xparse}
\usepackage{xpatch}
\usepackage[
style=verbose,
autocite=footnote,
backend=biber
]{biblatex}
\addbibresource{biblatex-examples.bib}
\makeatletter
\xpatchcmd{\@footnotetext}%
{\color@begingroup}
{\color@begingroup\toggletrue{blx@footnote}}
{}
{}
\makeatother
\DeclareCiteCommand{\sidecitehelper}[\bibfootnotewrapper]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}
\ExplSyntaxOn
\NewDocumentCommand\sidecite{D<>{}O{}om}{%
\iftoggle{blx@footnote}
{\cs_set_protected_nopar:Npn \__sct_wrapper:nn ##1 ##2 {\mkbibparens{##2}}}
{\cs_set_protected_nopar:Npn \__sct_wrapper:nn ##1 ##2 {\sidenote[][##1]{##2}}}
{\IfNoValueTF{#3}
{\__sct_wrapper:nn{#1}{\sidecitehelper[#2]{#4}}}
{\__sct_wrapper:nn{#1}{\sidecitehelper[#2][#3]{#4}}}}
}
\ExplSyntaxOff
\begin{document}
This,\sidecite[8]{springer} should\autocite{springer} be a side note and this\sidecite[see][8]{springer} should too.
Lorem ipsum\sidecite<2cm>[9]{geer} dolor\sidecite[cf.][]{springer}.
Sit\sidenote{amet \sidecite{geer}}.
\printbibliography
\end{document}
Note the 2cm offset of footnote 3 (\sidecite<2cm>[9]{geer}
), as well as the natural "if there is only one optional argument, it is the postnote" behaviour standard biblatex
cite commands in footnote 1 (\sidecite[8]{springer}
).
The \sidecite
in footnote 6 (\sidenote{amet \sidecite{geer}}
) becomes a citation in parentheses to avoid nested footnotes.
\cite
and\autocite
?