Re: packages algorithm and tocbibind




Joachim Reichel wrote:
> [CC: Rogério Brito <rbrito@xxxxxxxxxx>, maintainer of algorithm]
>
> Dan wrote:
>
> > Ralf Stubner wrote:
> >
> >>Joachim Reichel <joachim.reichel@xxxxxx> writes:
> >>
> >>>Has anyone any insight why the list of algorithms is messed up?
> >>
> >>I can't offer an explanation, but a workaround. If you replace book.cls
> >>by scrbookcls as well as tocbibind.sty and the redefinition of
> >>\listofalgorithms by the documentclass option 'liststotoc', your example
> >>from <3r3tfuFhipbkU1@xxxxxxxxxxxxxx> works with packages from teTeX 3.0¹
> >>(without the things from algpseudocode.sty which I don't have
> >>installed).
> >
> > I can offer an explanation: the formating command \l@agorithm has not
> > been defined. The following works:
> > \makeatletter
> > \let\l@algorithm\l@figure
> > \makeatother
>
> Thanks Dan, it works for me (although I don't understand why the toc
> entry influences the loa formatting and why the above commands fix that).
>
> Is this a bug in the algorithm or tocbibind package? Or should the
> documentation for tocbibind be extended?

The algorithm package's definition of \listofalgorithms invokes
\listof{algorithm} (\listof is from the float package), which defines
\l@algorithm (among other things), but does not do anything to put the
list into the TOC.

The basic classes define \l@figure and \l@table. So tocbibind leaves
that alone, redefining *only* enough to get those list into the TOC.

The \l@blah commands are invoked by \contentsline to format the lines
in the list-of-blah. If that command is undefined it is silently
ignored.

Thus the algorithm package's \listofalgorithms defines \l@algorithm and
the formating is correct, but doesn't emit the code needed to get that
list into the TOC. The code suggested for tocbibind does the latter but
not the former.

I think the most reasonable approach (my opinion only) would be for the
float package to put the definition of \l@blah into the \newfloat{blah}
code instead of in \listof{blah}. In that case, basic redefinitions of
\listofblahs would stand less chance of breaking. Alternatively,
float.sty or tocbibind.sty (or both) could be changed to recognize the
other.


Dan

.



Relevant Pages

  • Re: subsubsections in book style
    ... >> the \subsubsection command ... >> generating in the TOC something like chapter 2.3.3.2. ... >it's just a configuration issue ... Dan ...
    (comp.text.tex)
  • Re: Stalls and Thoughts
    ... Dan wrote: ... command" is that condition where induced drag is at its greatest, ... pitch only controls airspeed, ...
    (rec.aviation.piloting)
  • Re: Problem setting a4paper option using dvips
    ... >>> Well, thank you Dan, that certainly did the trick. ... >> You should warn your users that if dvips seems to ignore the paper size ... >>> Should I submit this as a MikTeX bug? ... >> changed so that the second type of paper size command comes first. ...
    (comp.text.tex)
  • Re: default chunk size for wss in 2003 (sp1) command line variable
    ... Thanks so much Dan my man ... does nothing but gve a command line error - and I think the reason is the ... "Dan Orchard" wrote: ... > Seth at Sherwood wrote: ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Table of Contents - Help!
    ... Dan ... > FrontPage Resources, WebCircle, MS KB Quick Links, etc. ... >> from the TOC, short of using a TOC based on Categories? ... If the webbot is not a good choice, ...
    (microsoft.public.frontpage.client)