5

I am facing a very basic problem when working with the todonotes package. How can I place a todonote right beside a figure?

I would really appreciate a simple solution such as a modified todo command, since these comments are just temporary todo notes...

MWE

\documentclass{article}
\usepackage{todonotes}

\usepackage{blindtext} % for dummy text
\usepackage{tikz}      % for dummy pic

\begin{document}    
  \blindtext % dummy paragraph

  \begin{figure} % dummy figure
    \centering
    \begin{tikzpicture}\draw(0,0) rectangle (5,3);\end{tikzpicture}
    \caption{dummy caption}
  \end{figure}%
  \todo[noline]{I need this comment to be situated beside the figure...}  

  \blindtext % dummy paragraph  
\end{document}

problem description

  • You can put a note next to a figure with \marginnote, but not with \todo (or \marginpar). – John Kormylo Dec 12 '14 at 15:12
3
\documentclass{article}
\usepackage{todonotes}
\usepackage{marginnote}

\usepackage{blindtext} % for dummy text
\usepackage{tikz}      % for dummy pic

\begin{document}    
  \blindtext % dummy paragraph

  \begin{figure} % dummy figure
    \marginnote{I need this comment to be situated beside the figure...}
    \centering
    \begin{tikzpicture}\draw(0,0) rectangle (5,3);\end{tikzpicture}
    \caption{dummy caption}

  \end{figure}%
  \todo{this note will show up on the todo list}


  \blindtext % dummy paragraph  
\end{document}
  • Thank you. Inspired by your answer I have found a proper solution for me. I have introduced a new command for the figure case \newcommand{\ftodo}[1]{\marginnote{\begin{minipage}{2.4cm}\todo[inline]{#1}\end{minipage}}}. This allows for the same outcome and an update of the todo-list. In two-sided document it might be a good decision to even replace all todo-notes with this comment \let\temptodo\todo \renewcommand{\todo}[1]{\marginnote{\begin{minipage}{2.4cm}\temptodo[inline]{#1}\end{minipage}}} – matheburg Dec 15 '14 at 7:21
  • BTW, \marginnote already has options to allow larger "notes", so the minipage may not be needed. – John Kormylo Dec 15 '14 at 14:51
  • @JohnKormylo Thx, works for me without minipage. – ToJo Feb 4 '18 at 22:34

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.