3

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}
? 
  • Both examples works well. I think you should update your system. – Marco Daniel Apr 18 '12 at 17:09
  • 3
    Judging from your error message, it seems to be an encoding problem. – domwass Apr 18 '12 at 18:06
  • Thanks for your help! I'm working with pdfTeX 3.1415926-2.3-1.40.12 (TeX Live 2011) on Debian Squeeze and I updates all packages. The input file is encoded in UTF-8, I use nothing else. Am I missing something? – deboerk Apr 19 '12 at 10:22
  • 1
    @deboerk: Use \usepackage[utf8]{inputenc} and \usepackage[T1]{fontenc} – Marco Daniel Apr 20 '12 at 18:47
  • Now it's working. Thanks very much! How can I mark this question as solved? – deboerk Apr 22 '12 at 18:58
4

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 is utf8.

So add to your preamble:

\usepackage[utf8]{inputenc}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.