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}
\addbibresource{\jobname.bib}
\renewbibmacro*{begentry}{\ifkeyword{ownwork}{\textasteriskcentered\addspace}{}}
\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}{%
\setlength{\dimen0}{-\widthof{\textasteriskcentered\addspace}}%
\hspace{\dimen0}\textasteriskcentered\addspace%
}{}}
What am I doing wrong? How can I put the marker slightly to the left of the bibliography entry?



\makebox[0pt][r]{\textasteriskcentered\addspace}– Ulrike Fischer Nov 23 '17 at 16:54marginparor 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\newcommand{\hangleft}[1]{\makebox[0pt][r]{#1}}and\newcommand{\hangright}[1]{\makebox[0pt][l]{#1}}in similar circumstances, but did not test with your MWE. – Oleg Lobachev Nov 23 '17 at 16:58