10

I'm using the todonotes package with the article class to take class notes, and using the todos as markers (date, comments and so on) so I don't want to use the bright orange, which steals focus. I wanted to redefine the default color value as demonstrated in the todonotes readme (and change the color value to my liking):

\newcommand{\todoredefined}[2][]
{\todo[color=red, #1]{#2}}

But nothing changes. Here's a MWE with all the packages I have loaded, should they have some known problems with todonotes:

\documentclass{article}
\usepackage{gensymb}
\usepackage[icelandic]{babel} 
\usepackage[T1]{fontenc}  
\usepackage{amsmath}
\usepackage{siunitx}
\usepackage{todonotes}
\usepackage{enumerate}
\usepackage{mhchem}
\usepackage{hyperref}

\newcommand{\todoredefined}[2][]
{\todo[color=red, #1]{#2}}

\begin{document}
    Something\todo{This should be red by now...}
\end{document}

When I compile this code I still get orange todos. Am I overlooking something or is this code sample obsolete?

14

You get orange todos because you do not use your new command. The todo command is still defined as always, with orange background, but if you use your todoredefined command instead, the background will be red.

However, an easier way of doing this is to add color=red as an option to the package:

\documentclass{article}
\usepackage[color=red]{todonotes}

\begin{document}
Text \todo{Nothing}
\end{document}

Edit: You can set the color of the background, border and line from note to text separately, see the todonotes manual, section 1.2.

  • Ah.. It's always so embarrassing to find out what I did wrong :/ – Jóhann Jan 12 '11 at 11:09

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.