Problem with latex todonotes package

  • LaTeX
  • Thread starter DrDu
  • Start date
  • Tags
    Latex
In summary, the conversation discusses the use of the latex todonotes package, specifically defining a command in the preamble and using it in the body. The conversation also mentions an error message related to the use of "renewcommand" and suggests using "linespread" instead. The conversation ends with the participant planning to try out the solution on Monday and later reporting that it did not work for them.
  • #1
DrDu
Science Advisor
6,375
980
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
  • #2
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.
 
  • #3
Thank you. I shall try it out on monday.
 
  • #4
I tried it out. linespace did not change the interline spacing and I still get the same error messages.
 
  • #5
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

  • todo.pdf
    23.7 KB · Views: 361
  • #6
I am using not article but svjour3.cls. Maybe that's the problem. I'll try it out.
Thanx for your help!
 

FAQ: Problem with latex todonotes package

1. What is the latex todonotes package used for?

The latex todonotes package is used to insert comments and to-do notes in a latex document. It helps in organizing and managing tasks while working on a document.

2. Why am I getting an error when using the todonotes package?

There could be various reasons for an error while using the todonotes package. Some common reasons include incorrect syntax, missing packages, or conflicts with other packages. It is recommended to check the documentation and troubleshoot the issue accordingly.

3. How can I customize the appearance of my todonotes?

Todonotes can be customized by changing the options in the package. This includes changing the color, size, and position of the notes. Additionally, the package also allows for the creation of custom commands for specific types of notes.

4. Is it possible to disable todonotes in the final document?

Yes, it is possible to disable todonotes in the final document by using the "disable" option in the package. This will remove all the notes and comments from the compiled document.

5. How can I add a note in a specific location in my document?

To add a note in a specific location, you can use the command \todo{note text}. This will insert a note at the current location in the document. Alternatively, you can also use the \todo[color=yellow]{note text} command to add a colored note at the current location.

Similar threads

Replies
8
Views
11K
Replies
4
Views
2K
Replies
1
Views
4K
Replies
789
Views
730K
Back
Top