# Why do I get an error “Too many }'s” when using package doublespace?

When I use pdfLaTeX to compile this document:

\documentclass[12pt]{article}
\usepackage{graphicx}
\usepackage{doublespace}
\usepackage{todonotes}
\begin{document}

\begin{figure}
\includegraphics[width=0.5\textwidth]{foo1.pdf}
\end{figure}
\end{document}


I get the following error:

[Loading MPS to PDF converter (version 2006.09.02).] ) ! Too many }'s. \color@endbox ->\color@endgroup \egroup l.10 \end{figure} ?

Can anyone tell me how I can avoid this?

P.S. I removed the complete stdout, which can be found by looking at previous edits; I can re-post if it contains pertinent information

update

The error does not seem to be that I did not use graphicx, when I got rid of files from previous. compilations, the error when graphicx is not included is:

No file foo.aux. ! Undefined control sequence. \includegraphics l.8 \includegraphics [width=0.5\textwidth]{foo1.pdf}

I have changed the example file to include what is required to make the compilation fail when the document is run from a directory that is empty of files (like foo.aux) produced by previous pdflatex compilations

-

You did not load the graphicx package, though you're using \includegraphics. That's why the compilation should fail.