On Sep 29, 2008, at 8:28 PM, A. Scottedward Hodel wrote:
I'm importing a student's PhD dissertation into LyX to use the
"track changes" function for markup. Unfortunately, there seems to
be a conflict between some LyX default behavior and the
algorithm2e.sty package:
! LaTeX Error: Command \algorithm already defined.
Or name \end... illegal, see p.192 of the manual.
I used the command line to translate LyX to LaTeX,
lyx --export latex WahbaSummary.lyx
and found the following code in the .tex file:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}
\floatstyle{ruled}
\newfloat{algorithm}{tbp}{loa}
\floatname{algorithm}{Algorithm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
If I comment out the \newfloat and \floatname commands, then the
error goes away. Is there a way to get rid of them without manually
editing the .tex file?
I found in the source code two files where the algorithm environment
is described in the comments:
~/Desktop/lyx-1.5.6 $ grep floatname{algorithm} `find src -type f`
src/insets/InsetFloat.cpp:// \floatname{algorithm}{Algorithm}
src/LaTeXFeatures.cpp: // \floatname{algorithm}{Algorithm}
the actual work appears to be done in the second file
(LaTeXFeatures.cpp) starting around line 834 (LaTeXFeatures function
getFloatDefinitions). I saw that this method is triggered by the
command "\listofalgorithms," so I tried commenting out that command,
but with no success.
---
After further testing, I duplicated the problem by using Insert ->
Float -> algorithm to create a float inset: in this circumstance the
code above is written. When the LaTeX code was imported, the
algorithm environment was recognized as a float, a corresponding inset
was created, and the algorithm environment was defined based on
float.sty.
I have a workaround on my machine with a Makefile, and I'll take your
advice to post a bug report.
A. Scottedward Hodel [EMAIL PROTECTED]
http://homepage.mac.com/hodelas/tar