I need in a tufte-book citations with author-year and used the recommendations for the author-year style. Unlike the case there, I want
- the simple citation in regular text as sidenote (as is automatically produced with
autocite=footnoteand the tufte style) and - a plain citation in footnotes.
I have tried to change the code given there to have autocite a footnote in regular text and a plain citation in a footnote, but have not succeeded.
What must be changed?
% \documentclass[a4paper,openany,nobib]{tufte-book}
\documentclass{article}
\usepackage[style=authoryear,
autocite=footnote]{biblatex}
\DeclareAutoCiteCommand{inlineplainfootnote}{\mysmartcite}{\mysmartcites}
\DeclareCiteCommand{\mysmartcite}[\iffootnote\textnormal\mkbibparens]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareMultiCiteCommand{\mysmartcites}
[\iffootnote\textnormal\mkbibparens]{\mysmartcite}{\multicitedelim}
\ExecuteBibliographyOptions{autocite=inlineplainfootnote}
% \usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@misc{B02,
author = {Poet, B.},
year = {2002},
title = {Beta},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\null\vfill% just for the example
Some text with a reference \autocite{A01} which should become a sidenote i.e. 1 and the sidenote should say: (Author 2001) .
Some more text with a citation which should become a footnote or sidenote saying: Author 2001, Poet 2002 \autocite{A01, B02}.
Some text with a footnote \footnote{A footnote with \autocite{B02}.} which should say: 1 A footnote with (Poet 2002).
And some text with a footnote with two citations \footnote{Two citations\autocite{B02, A01}} which should say: 2 Two citations(Poet 2002; Author 2001).
\printbibliography
\end{document}
Aside: I have added a second bib entry, but it cannot be found. what is wrong there?

filecontentsdoes not overwrite an existing file. So if you started out with a.bibfile of the same basename as your.texfile or edited thefilecontentslater to include the second reference, the old file with the old contents will stick around. I get two working citations in your example. Delete the test.bibfile (and the.aux,.bbland.bcf) and try again. – moewe Jul 14 '23 at 15:40clean updid not delete the .bib file - I expected the error in missing,or similar. – user855443 Jul 14 '23 at 18:53