I'm using the tufte-book
document class and the biblatex
package,
and would like to add margin notes indicating a
near-full reference the "first time" a citation is made. Specifically, I'd like for the in-text citation itself to act as a sort of note call. The closest
thing I've been able to achieve is:
Note two undesired things. First, the second margin note shouldn't exist. Second, the margin note's citation information should be exactly the same as the one in the main text. That is, no initials for first names.
I wrote first time between quotes because I'd like to reset the behavior for i) each page, ii) each even-odd pair of pages except the first page of the chapter which is odd (and should include the behavior), and iii) each chapter. Of course, only one case should hold for any complete document.
I tried, unsuccessfully, to adapt code from here, here, and here. I suspect two sources for the problem:
1) citetracker
being disabled in all floats (p. 59 of the biblatex manual - version 3.11). I think the marginfix
package arranges the margin notes using floats so I tried to set \citetrackertrue
in several ways but all failed.
2) The \newbibmacro*
section having incorrect syntax. More precisely, inside the \ifciteseen
section.
Another strategy I tried was using \AtEveryCitekey
to add additional code (\marginnote{}
) the first time a key is used, but that didn't bring out the desired result.
Finally, please note I can't prescind from the fixmargin
package, that I need to maintain APA style, and that I'm compiling with overleaf.com.
My minimal working example is:
\RequirePackage{filecontents}
\begin{filecontents}{mybib.bib}
@article{acemoglu2001colonial,
title={The colonial origins of comparative development: An empirical investigation},
author={Acemoglu, Daron and Johnson, Simon and Robinson, James A},
journal={American Economic Review},
volume={91},
number={5},
pages={1369--1401},
year={2001}
}
\end{filecontents}
% ---------------------------------------
\documentclass[nobib]{tufte-book}
\usepackage[T1]{fontenc}
\usepackage[
style=apa,
citestyle=apa,
backend=biber
]{biblatex}
\addbibresource{mybib.bib}
\ExecuteBibliographyOptions{citetracker,sorting=none}
\DeclareCiteCommand{\fullcite}
{\usebibmacro{prenote}}
{\usedriver
{\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\newbibmacro*{fullcite}{%
\ifciteseen
{}
{\fullcite{\thefield{entrykey}}\addperiod}
}
\usepackage{xargs}
\newcommandx{\mytextcite}[3][1={0pt},2={}]{
\textcite{#3}\marginnote[#1]{\fullcite[#2]{#3}.}
}
\AtEveryCitekey{\clearfield{pages}}
\AtEveryCitekey{\clearfield{volume}}
\AtEveryCitekey{\clearfield{number}}
% For Apa to work
\DeclareLanguageMapping{english}{english-apa}
\usepackage{marginfix}
\begin{document}
\mytextcite{acemoglu2001colonial} argue that the evidence is not robust.
This new paragraph repeats a citation. We now want to check how repeated in-text citations are treated in the margin. \mytextcite{acemoglu2001colonial} are the only authors that \ldots
\printbibliography
\end{document}
biblatex-apa
or would a standard style likestyle=authoryear
also be OK? Sincebiblatex-apa
has to work hard to implement all particularities of the APA guidelines it is harder to modify and tweak than the standard styles.