Como as citações do biblatex podem ser usadas nas legendas da classe de documentos tufte-book?
O seguinte MWE não funciona porque o \autocite
comando na legenda da imagem não é tratado corretamente pelo tufte-book. Presumo que a nota de margem precise ser enfileirada em algum lugartufte-common.def.
% !TeX program = pdflatex
% !TeX encoding = UTF-8
% !TeX spellcheck = en-US
% !BIB program = biber
\documentclass[a4paper,twoside,justified,marginals=raggedright,nobib]{tufte-book}
\usepackage{graphicx}
\usepackage[%
backend=biber,
bibstyle=authoryear,
citestyle=authortitle-icomp,
]{biblatex}%
\addbibresource{biblatex-examples.bib}
\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}
Responder1
Por padrão, as classes Tufte não gostam muito que você use um \footnote
arquivo \caption
. Como biblatex
não sabemos que estamos usando \autocite
de dentro de a , \caption
o padrão é \footcite
; na verdade, desde que o patch do \footnote
comando falhou, biblatex
não consigo nem detectá-lo em uma nota de rodapé e usá-lo \parencite
lá.
Com
\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
uma bastardização das tufte-common.def
definições de , partes do que hyperref.sty
faz e correção feita por biblatex
, a detecção de notas de rodapé funcionará e \caption
s serão tratados como se fossem notas secundárias pelo biblatex
rastreador de .
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}
Responder2
Encontrei uma solução alternativa manual baseada emUsando \footnote na \caption de uma figura, mas eu preferiria uma solução automatizada.
% !TeX program = pdflatex
% !TeX encoding = UTF-8
% !TeX spellcheck = en-US
% !BIB program = biber
\documentclass[a4paper,twoside,justified,marginals=raggedright,nobib]{tufte-book}
\usepackage{graphicx,lipsum}
\usepackage[%
backend=biber,
bibstyle=authoryear,
citestyle=authortitle-icomp,
]{biblatex}%
\addbibresource{biblatex-examples.bib}
\usepackage{ftnxtra}
\begin{document}
Citation in text.\autocite{westfahl:space}
\begin{figure}
\includegraphics{example-grid-100x100pt}
\caption{Citation in caption.\footnotemark}
\end{figure}
\footnotetext{\cite{westfahl:space}}
\end{document}