Hello,
While trying to convince a coworker to switch to LyX, I was bitten by
2 bugs, one when reLyXing his .tex file and one when trying to figure
why the re-exported LaTeX file didn't work while the LyX one did.
The reLyX bug: alignement is output in layouts that don't support them.
The LyX bug: errors are not always detected (as the incorrect LaTeX file
did output a sensible .dvi, I spent a long time comparing the unreadable
and `pretty' versions.. :-)
More details follow:
1. Given this file:
\documentclass{article}
\begin{document}
Something to get LyX happy...
\begin{figure}
\begin{center}
Happy figure.
\caption{Happy? caption}
\end{center}
\end{figure}
That's all, folks!
\end{document}
The caption is in the center environment. Thus reLyX outputs
\layout Caption
\align center
Happy? caption
This becomes \caption{\centering Happy? caption}, which is not allowed
by
LaTeX.
Hacked patch:
Index: lyx-1_0_x/lib/reLyX/BasicLyX.pm
===================================================================
RCS file: /usr/local/lyxsrc/cvsroot/lyx-1_0_x/lib/reLyX/BasicLyX.pm,v
retrieving revision 1.3
diff -r1.3 BasicLyX.pm
1295c1295,1296
< print OUTFILE $CurrentAlignment if $CurrentAlignment;
---
> print OUTFILE $CurrentAlignment
> if $CurrentAlignment and $$CurrentLayoutStack[-1] ne "Caption";
(Hmmm... I just realized that LyX allows left aligned captions. A
feature for non-
LaTeX output ?)
2. LyX doesn't get all LaTeX error messages. This one:
! Undefined control sequence.
\\->\let \reserved@e
\relax \let \reserved@f \relax \@ifstar {\let
\reserved...
l.33 caption}
goes undetected, as the line number doesn't immediatly follow the error
message.
Lexical analysis of LaTeX output seems as hard as it's input :-)
Thanks for LyX!