Hi Amir -
thanks for the example. Just for the record, a.lyx
won't generate a valid dvi, due to Latex errors.
But you can delete ERT in the front-matter. Next,
after compilation, you find the figure has expanded,
and lost its position; the {ht} in {figure} is lost.
Also, just for the record, even though the syntax
of the original might not have been correct, it is
a typical example of `wild' latex which people
often use - because it works. However, I agree that
you can't expect ReLyx to handle everything. But,
it would be nice to be able to re-import LyX output!
I can export a.lyx to latex, and put the [ht] back in.
This gives the correct figure position. Next, I can
try to re-import into LyX for some more editing. Now
I get a totally mangled figure, with figure and
caption separated. The centering command is back,
and tries to center all text following the figure.
I've attached this as b.lyx. Also, the file c.lyx
is very instructive. Here, I've changed the figure
command to the commonly used \epsfig. Now, the original
latex file compiles OK, and I can import into Lyx.
After importing, I only see the \epsfig as ERT - but
this is OK; \epsfig is not supported natively in Lyx.
However, a most peculiar thing happens if I try to view
the dvi file. I get a Latex error - file not found! But
if I export the latex file and tex it normally, suddenly
the file is found perfectly correctly. Unfortunately,
of course, the figure is still mangled, so using \epsfig
doesn't really help this problem at all, either.
This type of problem is the sort of thing that really
does make LyX scary for beginners. Here we have a usable
Latex file, that simply doesn't work inside of Lyx. Yet,
when exported, it works again (although mangled). I
guess this is a Lyx problem, as well as ReLyx - but
it means there is a long learning curve for Lyx newbies.
yours - and thanks again for your time -
Peter Drummond.
--
Physics Department, University of Queensland, St Lucia 4072,
Queensland, Australia. Tel:+61-7-3365-3404 Fax:+61-7-3365-1242
[EMAIL PROTECTED]; www.physics.uq.edu.au/people/drummond
#LyX 1.1 created this file. For more info see http://www.lyx.org/
\lyxformat 2.16
\textclass article
\begin_preamble
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{graphics}
\makeatletter
\usepackage{graphics}
\usepackage{amssymb}
\newcommand{\expect}[1]{\mbox{$\left\langle {#1} \right\rangle$}}
\makeatother
\end_preamble
\language default
\inputencoding latin1
\fontscheme default
\graphics default
\paperfontsize default
\spacing single
\papersize Default
\paperpackage a4
\use_geometry 0
\use_amsmath 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle default
\layout Title
Example
\layout Author
P.
D.
Drummond
\layout Abstract
This example is a typical Latex file which ReLyx won't import!
\layout Section
Introduction
\layout Standard
\begin_inset LatexCommand \label{INTRO}
\end_inset
\layout Standard
One of the oldest problems in Latex is how to maintain compatibility between
the latex that is used `in the wild' and the latex that is used by Wysiwig
editors like Lyx.
\layout Standard
\latex latex
\backslash
par
\backslash
centering
\backslash
resizebox*{10cm}{!}{
\latex default
\begin_inset Figure size 514 414
file vary.eps
flags 9
\end_inset
\latex latex
}
\backslash
par{}
\begin_float fig
\layout Caption
\latex latex
\backslash
protect
\latex default
\begin_inset Formula \( Var(Y)=\expect {(Y-\bar{Y})^{2}}\protect \)
\end_inset
: differences between wild latex and Lyx.
\layout Standard
\begin_inset LatexCommand \label{yfig}
\end_inset
\end_float
\layout Standard
See Fig (
\begin_inset LatexCommand \ref{yfig}
\end_inset
) for a comparison that shows growth in the statistical variance of files
after multiple import/export, as a function of time in years, using several
different sample files.
\the_end
#This file was created by <drummond> Tue Apr 3 10:00:12 2001
#LyX 1.0 (C) 1995-1999 Matthias Ettrich and the LyX Team
\lyxformat 2.15
\textclass article
\begin_preamble
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{epsfig}
\makeatletter
\usepackage{graphics}
\usepackage{amssymb}
\newcommand{\expect}[1]{\mbox{$\left\langle {#1} \right\rangle$}}
\makeatother
\end_preamble
\layout Title
Example
\layout Author
P.
D.
Drummond
\layout Abstract
This example is a typical Latex file which ReLyx won't import!
\layout Section
Introduction
\layout Standard
\begin_inset LatexCommand \label{INTRO}
\end_inset
\layout Standard
One of the oldest problems in Latex is how to maintain compatibility between
the latex that is used `in the wild' and the latex that is used by Wysiwig
editors like Lyx.
\layout Standard
\begin_float fig
\latex latex
\backslash centering
\newline
{}
\latex default
\latex latex
\backslash epsfig{figure=vary.eps,height=8 cm}
\latex default
\layout Caption
\latex latex
\backslash protect
\latex default
\begin_inset Formula \( Var(Y)=\expect {(Y-\bar{Y})^{2}}\protect \)
\end_inset
: differences between wild latex and Lyx.
\layout Standard
\begin_inset LatexCommand \label{yfig}
\end_inset
\end_float
\layout Standard
See Fig (
\begin_inset LatexCommand \ref{yfig}
\end_inset
) for a comparison that shows growth in the statistical variance of files
after multiple import/export, as a function of time in years, using several
different sample files.
\the_end