I am attempting something similar to: Biblatex footnotes to margin To the extend that I can steal their example.
What I would like to do, is have the text cited in the main text normally, then in the side bar using the author name, then the date, then the work name.
For purposes of this MWE I am just using base latex \marginpar.
(In my actual work I am using Koma scrnote-layer stuff.
But that doesn't really matter as I am trying to understand BibLaTeX)
MWE:
\documentclass{article}
\usepackage{blindtext}
% bib-file
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Knu86,
author = {Knuth, Donald E.},
year = {1986},
title = {The \TeX book},
}
@BOOK{KandR,
AUTHOR = {Kernighan, Brian W. and Ritchie, Dennis M.},
TITLE = {{The C Programming Language Second Edition}},
PUBLISHER = {Prentice-Hall, Inc.},
YEAR = {1988},
}
\end{filecontents}
\usepackage[]{biblatex}
\addbibresource{\jobname}
\newcommand{\tcite}[1]{
\textcite{#1}
\marginpar{
\citeauthor{#1},
\citeyear{#1}.
\citetitle{#1}
}
}
% doc
\begin{document}
\blindtext
\tcite{Knu86}
\blindtext
\tcite{Knu86,KandR}
\blindtext
\end{document}
It can be seen that the Blue circled text is perfect. But the red cirled text is wrong, because it is collated by fields. The reason for this is obvious of course. My command does not process per key, it processes all the keys together.
My current command is:
\newcommand{\tcite}[1]{
\textcite{#1}
\marginpar{
\citeauthor{#1},
\citeyear{#1}.
\citetitle{#1}
}
}
I believe that I want to replace it with something made using BibLaTeX's \DeclareCiteCommand
So I took a swing at it:
\DeclareCiteCommand{\tcite}
{ % prenote
\usebibmacro{prenote}%
}
{ %loopcode
\printnames{author}%
\marginpar{
\printnames{author},
\printfield{year}.
\printfield{title}
}
}
{ %sepcode
\multicitedelim%
}
{\usebibmacro{postnote}}
This works, we can see both the blue circled and the red circles is fine as far as being seperate.
But I am not benifiting from the Styling of Author names (eg being abridged to last name only, based on my settings).
And since I haven't uses \textcite but rather just put in printnames{author} then I am not benefiting from any styling there either.
This is (I assume) because I have used the low level commands, for these things. How can I use higher level commands that respect style/configuration





\DeclareCiteCommandis not a bibmacro. You can call it simply with\citeauthor. In another\DeclareCiteCommandyou'd need\citeauthor{\thefield{entrykey}}. But it is easier and more natural to just use the associated bibmacro:\usebibmacro{author}, for example. – moewe Jul 10 '17 at 06:17