# How can I use todonotes with beamer?

I'm creating a presentation using beamer and I would like to denote bits that need to be done later using the todonotes package. But there appears to be some conflict between the two packages. I get errors of the form

! LaTeX Error: Float(s) lost.


I'm guessing this is because the slides don't have a margin in which to place the todo bubbles. What's the best way to get around this? I'm looking for something easier than manually adding the inline option to every use of \todo.

-
Beamer doesn't support floats, which don't make sense in a presentation. Marginpars are floats, so as long you can't stop todonotes to use them you wont come far. – Martin Scharrer Feb 28 '11 at 18:46
@Martin: ok, thanks, so I guess the question boils down to finding the best way to automatically add the inline option to every instance of \todo. – David Z Feb 28 '11 at 19:07

You can change the presets of the package so that it creates inline todonotes by default. In order to do this, just add the line \presetkeys{todonotes}{inline}{} after you have loaded todonotes (you may also need to add xkeyval to make the \presetkeys macro available):

\documentclass{beamer}

\usepackage{xkeyval}
\usepackage{todonotes}
\presetkeys{todonotes}{inline}{}

\begin{document}
\begin{frame}
\todo{Notes are inline by default now.}
\end{frame}
\end{document}

-
This causes weird errors while the other solution is fine. Can't be bothered to find out the exact problem, just wanted to add this as a caveat for future googlers. – fifaltra Jan 29 '14 at 23:55

Now I feel silly, because almost immediately after posting the question I had an idea:

\usepackage{todonotes}
\let\todox\todo
\renewcommand\todo[1]{\todox[inline]{#1}}


This redefines \todo as \todo[inline], at the expense of not allowing any other options to be given to \todo, which works fine for me. Though I still welcome more flexible solutions if they are out there.

-
This should allow additional options (as long \todo accepts empty options, i.e. a trailing ,): \renewcommand\todo[2][]{\todox[inline,#1]{#2}} – Martin Scharrer Feb 28 '11 at 19:15
You can define your command to be \renewcommand\todo[2][]{\todox[inline,#1]{#2}}. That way, you can pass more options. – fabikw Feb 28 '11 at 20:08
I'm trying to do something similar @fabikw. The only difference is that I want to create an optional name. The code I tried was: \let\todox\todo \renewcommand\todo[2][]{ \todox[inline,color={red!100!green!33},size=\footnotesize]{\textbf{Comment [#1]:}~#2}% } In the argument 1, it shall be possible to write an optional name. But this will not build. I had to cancel it, because it was getting nowhere. Any ideas? – Andreas Løvgaard Feb 3 '15 at 16:52