[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#470141: (fwd) Bug#470141: todo.sty comaplains about bad space factor

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:


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

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,
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:

! Bad space factor (0).
<recently read> \@savsf

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 ---

On the Debian bug tracking system, it was reported that the \todo command from
your todo.sty package sometimes unexpectedly complains about a 'bad space
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
  \renewcommand\@todoleavevmode{\leavevmode}} %new
  \renewcommand\@todoleavevmode{}} %new
  \renewcommand\@todoleavevmode{}} %new

% 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.


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

Reply to: