6

Consider following MWE:

\documentclass{article}
\usepackage{blindtext}
\usepackage[colorinlistoftodos,prependcaption,textsize=tiny]{todonotes}
\presetkeys%
   {todonotes}%
   {inline,backgroundcolor=yellow,textcolor=blue!20!white}{}
\begin{document}
\blindtext\todo{Is this text in blue?}
\end{document}

How can I specify globally the textcolor of my todonotes?

0

3 Answers 3

8

You can specify text color via the style used for the nodes as follows:

\tikzset{/tikz/notestyleraw/.append style={text=blue!20!white}}

Sample output

\documentclass{article}
\usepackage{blindtext}
\usepackage[colorinlistoftodos,prependcaption,textsize=tiny]{todonotes}
\presetkeys%
{todonotes}%
{inline,backgroundcolor=yellow}{}
\tikzset{/tikz/notestyleraw/.append style={text=blue!20!white}}

\begin{document}

\blindtext\todo{Is this text in blue?}

\end{document}
1
  • 1
    For luatodonotes use \makeatletter \tikzset{/tikz/@todonotes@notestyleraw/.append style={text=blue!20!white}} \makeatother.
    – Hotschke
    Commented Mar 10, 2017 at 11:30
5

Since there is not an option to do that, the simplest way is to redefine the \todo command. So, add the following lines to your preamble.

\makeatletter
\renewcommand{\todo}[2][]{\@bsphack\@todo[#1]{\textcolor{blue!20!white}{#2}}\@esphack\ignorespaces}
\makeatother

MWE:

\documentclass{article}
\usepackage{blindtext}
\usepackage[colorinlistoftodos,prependcaption,textsize=tiny]{todonotes}
\presetkeys%
    {todonotes}%
    {inline,backgroundcolor=yellow}{}
\makeatletter
\renewcommand{\todo}[2][]{\@bsphack\@todo[#1]{\textcolor{blue!20!white}{#2}}\@esphack\ignorespaces}
\makeatother
\begin{document}
\blindtext\todo{Is this text in blue?}
\end{document} 

Output:

enter image description here

4

todonotes version 1.1.0 (2018/10/17) supports option textcolor

\documentclass{article}
\usepackage{blindtext}
\usepackage[
    textcolor=red,
    linecolor=red,
    bordercolor=red,
    backgroundcolor=white,
]{todonotes}

\begin{document}
\blindtext
\todo{Is this text in red?}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .