By default, the Tufte classes are not too fond of you using a \footnote
from within a \caption
.
Since biblatex
doesn't know we are using \autocite
from within a \caption
it defaults to \footcite
; indeed since patching the \footnote
command failed, biblatex
can't even detect it is in a footnote and use \parencite
there.
With
\makeatletter
\long\def\@caption#1[#2]#3{%
\expandafter\ifx\csname if@capstart\expandafter\endcsname
\csname iftrue\endcsname
\global\let\@currentHref\hc@currentHref
\else
\hyper@makecurrent{\@captype}%
\fi
\@ifundefined{NR@gettitle}{%
\def\@currentlabelname{#2}%
}{%
\NR@gettitle{#2}%
}%
\par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
}%
\begingroup
\toggletrue{blx@footnote}%
\@parboxrestore
\if@minipage
\@setminipage
\fi
\@tufte@caption@font\@tufte@caption@justification%
\expandafter\ifx\csname if@capstart\expandafter\endcsname
\csname iftrue\endcsname
\global\@capstartfalse
%\@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}%
\noindent\csname fnum@#1\endcsname: \ignorespaces#3%
\else
%\@makecaption{\csname fnum@#1\endcsname}{%
\noindent\csname fnum@#1\endcsname:
\ignorespaces
\ifHy@nesting
\expandafter\hyper@@anchor\expandafter{\@currentHref}{#3}%
\else
\Hy@raisedlink{%
\expandafter\hyper@@anchor\expandafter{%
\@currentHref
}{\relax}%
}%
#3%
\fi
%}%
\fi
\par
\endgroup
}
\renewcommand\@footnotetext[2][0pt]{%
\marginpar{%
\hbox{}\vspace*{#1}%
\def\baselinestretch {\setspace@singlespace}%
\reset@font\footnotesize%
\@tufte@margin@par% use parindent and parskip settings for marginal text
\vspace*{-1\baselineskip}\noindent%
\protected@edef\@currentlabel{%
\csname p@footnote\endcsname\@thefnmark%
}%
\color@begingroup%
\toggletrue{blx@footnote}%
\@makefntext{%
\ignorespaces#2%
}%
\color@endgroup%
}%
}%
\makeatother
a bastardisation of tufte-common.def
's definitions, bits of what hyperref.sty
does and patching done by biblatex
, footnote detection will work and \caption
s will be treated as if they were sidenotes by biblatex
's tracker.
MWE
\documentclass[a4paper,twoside,justified,marginals=raggedright,nobib]{tufte-book}
\usepackage{graphicx}
\usepackage{mwe}
\usepackage[%
backend=biber,
bibstyle=authoryear,
citestyle=authortitle-icomp,
]{biblatex}%
\addbibresource{biblatex-examples.bib}
\makeatletter
\long\def\@caption#1[#2]#3{%
\expandafter\ifx\csname if@capstart\expandafter\endcsname
\csname iftrue\endcsname
\global\let\@currentHref\hc@currentHref
\else
\hyper@makecurrent{\@captype}%
\fi
\@ifundefined{NR@gettitle}{%
\def\@currentlabelname{#2}%
}{%
\NR@gettitle{#2}%
}%
\par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}%
}%
\begingroup
\toggletrue{blx@footnote}%
\@parboxrestore
\if@minipage
\@setminipage
\fi
\@tufte@caption@font\@tufte@caption@justification%
\expandafter\ifx\csname if@capstart\expandafter\endcsname
\csname iftrue\endcsname
\global\@capstartfalse
%\@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}%
\noindent\csname fnum@#1\endcsname: \ignorespaces#3%
\else
%\@makecaption{\csname fnum@#1\endcsname}{%
\noindent\csname fnum@#1\endcsname:
\ignorespaces
\ifHy@nesting
\expandafter\hyper@@anchor\expandafter{\@currentHref}{#3}%
\else
\Hy@raisedlink{%
\expandafter\hyper@@anchor\expandafter{%
\@currentHref
}{\relax}%
}%
#3%
\fi
%}%
\fi
\par
\endgroup
}
\renewcommand\@footnotetext[2][0pt]{%
\marginpar{%
\hbox{}\vspace*{#1}%
\def\baselinestretch {\setspace@singlespace}%
\reset@font\footnotesize%
\@tufte@margin@par% use parindent and parskip settings for marginal text
\vspace*{-1\baselineskip}\noindent%
\protected@edef\@currentlabel{%
\csname p@footnote\endcsname\@thefnmark%
}%
\color@begingroup%
\toggletrue{blx@footnote}%
\@makefntext{%
\ignorespaces#2%
}%
\color@endgroup%
}%
}%
\makeatother
\begin{document}
Citation in text.\autocite{westfahl:space}
\begin{figure}
\includegraphics{example-grid-100x100pt}
\caption{Citation in caption. \autocite{westfahl:space}}
\end{figure}
\end{document}

biblatex
's footnote detection does not work with the tufte classes (with the tufte classes one should probably consider a caption to be a footnote as well). So\autocite
(which branches depending on whether we're in a footnote or not) goes miss, just use\cite
and everything is tickety-boo.