# How do I mark bibliography entries in the margin?

I have a Biber bibliography where certain works are marked with a special keyword. When Biblatex prints the list of references (in author–year style), I want it annotate these entries with some marker, such as an asterisk. So I tried the following:

\documentclass{article}
\usepackage{calc}
\usepackage[bibstyle=authoryear]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@inproceedings{foo,
author       = {Foo},
title        = {Foo},
booktitle    = {Foo},
year         = {2017},
}
@inproceedings{bar,
author       = {Bar},
title        = {Bar},
booktitle    = {Bar},
year         = {2017},
keywords     = {ownwork},
}
\end{filecontents}

\begin{document}
\nocite{foo,bar}
\printbibliography
\end{document}


However, I want these asterisks to appear in the left margin, so that the author lists of the references are aligned. I tried changing the definition of begentry to the following, which uses \widthof rather than an absolute width (to avoid my having to guess how much space to use, and to make the command robust against changes in font size). However, it doesn't work:

\renewbibmacro*{begentry}{%
\ifkeyword{ownwork}{%
}{}}


What am I doing wrong? How can I put the marker slightly to the left of the bibliography entry?

• You can't use \widthof like this. Beside this the calculations are not needed, use \makebox[0pt][r]{\textasteriskcentered\addspace} – Ulrike Fischer Nov 23 '17 at 16:54
• Somewhat related: Getting two different bibliographies depending on where the one and the same citation is cited: khirevich.com/latex/bibliography You might want to re-state a short citation in the marin (marginpar or similar) of the main text to rub the reader into the face that these papers are yours. – Oleg Lobachev Nov 23 '17 at 16:57

You only need to put the text in a box of width zero:

\documentclass{article}
\usepackage{calc}
\usepackage[bibstyle=authoryear]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@inproceedings{foo,
author       = {Foo},
title        = {Foo},
booktitle    = {Foo},
year         = {2017},
}
@inproceedings{bar,
author       = {Bar},
title        = {Bar},
booktitle    = {Bar},
year         = {2017},
keywords     = {ownwork},
}
\end{filecontents}

\begin{document}
\nocite{foo,bar}
\printbibliography
\end{document}


• @moewe's answer also works for me, but I prefer this one because of its simplicity. – Psychonaut Nov 24 '17 at 8:49

We can use egreg's solution to Add a marker to the left of the text

\documentclass{article}
\usepackage[bibstyle=authoryear]{biblatex}

\newcommand{\domark}{%
\vbox to 0pt{
\kern-\dp\strutbox
\smash{\llap{*\kern1em}}
\vss
}%
}
\renewbibmacro*{begentry}{\ifkeyword{ownwork}{\impmark}{}}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@inproceedings{foo,
author       = {Foo},
title        = {Foo},
booktitle    = {Foo},
year         = {2017},
}
@inproceedings{bar,
author       = {Bar},
title        = {Bar},
booktitle    = {Bar},
year         = {2017},
keywords     = {ownwork},
}
\end{filecontents}

\begin{document}
\nocite{foo,bar}
\printbibliography
\end{document}