Dear Federico,

down here in the Debian Bug Tracking system we got a complaint about
your todo package. I fails to compile the following minimal example
with TeX Live 2007:

<snip>
\documentclass{minimal}
\usepackage{todo}

\begin{document}
\todo[fix]{hi, this is to fix}
\todos
\end{document}
<snap>

The error message is attached. Further we got a suggestion how this
could be fixed (attached as fix.txt). Please be so kind and have a
look at this. The full report can be found on http://bugs.debian.org/470141

Many thanks,
Hilmar
--
sigmentation fault

--- Begin Message ---
Package: texlive-latex-extra
Version: 2007.dfsg.1-1

After running latex command on my .tex containing todo package and
\todo instructions it complains with the following:

l.14 \todo[fix]{hi, this is to fix}

?
[1] [2] (./test.aux) )

If I press enter at the prompt the process continues properly.
I am also attaching a minimal .tex file reproducing the problem.


Attachment: test.tex
Description: TeX document

--- End Message ---
Hi,

On the Debian bug tracking system, it was reported that the \todo command from
factor', when used in vertical mode. I checked this out, and I think the
problem arises when the \@bsphack at the beginning of the \todo command is
executed in vertical mode, but the \@esphack at the end is executed in
horizontal mode. This happens if and only if the default option 'superscript'
is used, and the \todo command is used in vertical mode.

I think the following is a way to fix this:

\newcommand\@todoleavevmode{} %new
\DeclareOption{superscript}{%
\renewcommand\@todomark{\@todosupermark}%
\renewcommand\@todoleavevmode{\leavevmode}} %new
\DeclareOption{marginpar}{%
\renewcommand\@todomark{\@todomarginpar}%
\renewcommand\@todoleavevmode{}} %new
\DeclareOption{nothing}{\let\@todomark\@gobble
\renewcommand\@todoleavevmode{}} %new

\newcommand{\todo}[2][\todomark]{\@todoleavevmode\@bsphack\@todohide{%
% the rest as in the current code (only the \@todoleavevmode added above)

This make the \leavevmode happen earlier than in \@todosupermark with the
super, and in any case either no happen at all, or before the
\@bsphack/\@esphack couple. (I think hard-coding the \leavevmode at the
beginning of \todo is not a good idea since it makes unwanted vertical space
when using \todo with the 'nothing' option in vertical mode, for example.)

Of course you can also think that \todo should not be used in vertical mode
with the 'superscript' option and not fix this, but maybe it would be a good
idea to mention this restriction in the documentation then.

Best,
Manuel.

--
To UNSUBSCRIBE, email to debian-tex-maint-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org