The hyperref README says:

6 PACKAGE COMPATIBILITY
=======================

Currently only package loading orders are available:

[...]

algorithm
---------
  \usepackage{float}
  \usepackage{hyperref}
  \usepackage[chapter]{algorithm
}

So float (which is modified by hyperref) and hyperref have to be loaded before
algorithm. The problem is that LyX loads algorithm before the user preamble.
So your only chance is probably to load the algorithm package yourself (and
use ERT in the document.

1) If I load algorithm (again) after hyperref, LyX (or LaTeX) ignores
it and always gives me the "undefined control sequence" error message.
in fact, LyX loads algorithm with the command \newfloat, before the
user preamble, I guess (I exported to plain LaTeX)

2) you can use a package declaration in the preamble only, not after
the \begin{document} command.

so I don't see an escape. like a dog eating his tail (?).

Is there a way not to load a (default) package in LyX? in this case I
could load it "manually" in the preamble. Is there a way to "unload" a
package in LaTeX  in the preamle?

I also tried to export to LaTeX and cut the algorithm declarationand
and paste it in the preamble after the hyperref declaration, but I
messed things up.

otherwise I have to choose between bookmarks (which look pretty good
btw) and algorithms I think I'll choose the latter for the moment, and
look for a solution later. but let me know if you have any idea, and
thank you.

Regards,
Diego

Reply via email to