Problem with latex todonotes package

  • Context: LaTeX 
  • Thread starter Thread starter DrDu
  • Start date Start date
  • Tags Tags
    Latex
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
5 replies · 5K views
Messages
6,423
Reaction score
1,004
I tried out the latex todonotes package. Specifically I defined in the preamble:

\usepackage{todonotes}
\newcommand{\tinytodo}[2][]
{\todo[size=\small,inline]{\renewcommand{\baselinestretch}{0.5}%
\selectfont%
[\uppercase{#1}]:~#2%
\par
}}

In the body I use:

\tinytodo[A]{``accute'' vs. ``protracted'' }

I get the following error message in the log:

Runaway argument?
{\@firstoftwo {\let \l@ngrel@x \relax \renew@command }}\def \reserved@b \ETC.
! Paragraph ended before \reserved@a was complete.
<to be read again>
\par
l.82 ...``accute'' vs. ``protracted'' }

?
[2]

Although ignoring it yields a correct pdf, I would like to get rid of it. Any ideas?
 
Physics news on Phys.org
The problem seems to be that the "renewcommand" ends up soewhere it shouldn't be.
If you change
\renewcommand{\baselinestretch}{0.5}%
to
\linespread{0.5}%
(which has the same effect) the error message goes away.

FWIW trying to reduce the line spacing this way doesn't seem to do much, but increasing it with say \linespread{2.0} works for me.
 
I tried it out. linespace did not change the interline spacing and I still get the same error messages.
 
Hmm... this works for me, in TeXLive on Windows, and no error messages.
Code:
\documentclass{article}
\usepackage{todonotes}
\newcommand{\tinytodo}[2][]
{\todo[size=\small,inline]{\linespread{2.0}%
\selectfont%
[\uppercase{#1}]:~#2%
\par
}}

\begin{document}
Some  text. \\
Line two
\tinytodo[A]
{A note with two lines\\
A note with two lines}
Line three \\
Line four
\end{document}
PDF output attached.
 

Attachments

I am using not article but svjour3.cls. Maybe that's the problem. I'll try it out.
Thanx for your help!