I would like to highlight changes in a specific entry (or even a part of the entry) of a reference list created with biblatex, e.g., by changing the font color to red. (Unfortunately such a feature is not available in todonotes.)
Apart from the conversation here, I couldn't find anything helpful. Two examples are given there, but I was not able to run them correctly.
Example 1
%For example, if you want to print the title of recent entries in red,
%you'd modify the "title" format:
\documentclass{article}
\usepackage{biblatex}
\usepackage{color}
\bibliography{biblatex-examples}
\DeclareFieldFormat*{title}{%
\usebibmacro{color_recent}{\mkbibemph{#1}}}
\newbibmacro{color_recent}[1]{%
\iffieldint{year}
{\ifnumgreater{\thefield{year}}{1999}
{\textcolor{red}{#1}}
{#1}}
{#1}}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
Example 2
%If you want the complete entry in red, it's easier to use a hook like
%\AtEveryBibitem:
\documentclass{article}
\usepackage{biblatex}
\usepackage{color}
\bibliography{biblatex-examples}
\AtEveryBibitem{%
\iffieldint{year}
{\ifnumgreater{\thefield{year}}{1999}
{\color{red}}
{}}
{}}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
My error
For both examples I get:
! Undefined control sequence.
<argument> Przepi\x
{fffd}\x {fffd}rka
l.19 \end
{document}
?
Best Answer
Based on the comments I provide an answer.
The error occurs by an encoding problem. To avoid this you can load the package
inputenc
with your used encoding. Normally the encoding isutf8
.So add to your preamble: