Problem with latex todonotes package

  • Context: LaTeX 
  • Thread starter Thread starter DrDu
  • Start date Start date
  • Tags Tags
    Latex
Click For Summary

Discussion Overview

The discussion revolves around an issue with the LaTeX todonotes package, specifically regarding an error message encountered when defining a custom command for inline notes. Participants explore potential solutions and adjustments to the command to resolve the error.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant reports an error message related to the use of \renewcommand within their custom \tinytodo command.
  • Another participant suggests replacing \renewcommand with \linespread to avoid the error, noting that it has the same effect on line spacing.
  • A third participant attempts the suggested change but still encounters the same error message, indicating that the solution did not work for them.
  • One participant shares a working example using a different document class (article) and reports no errors, suggesting that the issue may be environment-specific.
  • Another participant mentions using a different document class (svjour3.cls) and expresses uncertainty about whether this could be the source of the problem.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the solution to the error, as some find success with different approaches while others continue to experience issues. The discussion remains unresolved regarding the best method to eliminate the error.

Contextual Notes

Participants note that the behavior of the todonotes package may vary depending on the document class used, which could influence the results and error messages encountered.

DrDu
Science Advisor
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.
 
Thank you. I shall try it out on monday.
 
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!
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 8 ·
Replies
8
Views
13K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 766 ·
26
Replies
766
Views
745K