John Levon <[EMAIL PROTECTED]> writes:

> On Wed, May 15, 2002 at 12:05:00PM +0200, David Kastrup wrote:
> 
> > least pnm will encode monochromatic images with 8 bits per pixel
> > instead of 24 (and if you don't use antialiasing, pure B&W text will
> > render with 1 bit per pixel, while looking ugly).
> 
> Actually David I have a question about how this can work when we are
> mixing ERT with normal LyX objects. For example, the current CVs doesn't
> support floatingfigure (though there is a patch for this available), so
> users have to do :
> 
> ERT : [ \floatingfigure[l]{ ]
> LyX figure inset
> ERT : [ } ]
> 
> or similar. So each inset in cases like this cannot be rendered in
> isolation. A similar problem occurs with ERT that just contains macro
> definitions or the like, there is no actual output generated.
> 
> Is it simple to detect cases like and automatically just show the
> TeX code, or would it be up to the user to turn off preview for
> these insets ?

Good point.  In order to treat stuff like the above properly, LyX
would need the concept of "regular" stuff nested inside of ERT that
is supposed to be previewed.  Perhaps something like "opening ERT"
and "closing ERT" ?  I believe that once an actual implementation is
available, a few iterations will be required until coming up with
reasonable schemes to accommodate common requirements.  A reasonable
first approach would be to do turn previews off where LaTeX produces
errors.

preview-latex has fewer problems in that area since it basically has
only a document consisting just in ERT to deal with (it does not
understand anything).  The actual filtering and location of the
previewed chunks is left to LaTeX itself, via the preview style.  You
would have to specify something like
\PreviewMacro\floatingfigure[{[]{}}]
in your preamble, and then the style would know that it was supposed
to extract and preview those elements as one figure, or
\PreviewMacro*\floatingfigure[{[]}]
in order to tell the preview style that it should ignore the macro
and its optional argument for previewing purposes.  That way, any
previewable stuff inside would be treated properly.

As to the problem of macro definitions in ERT: incremental updates of
display in preview-latex require that you place required definitions
in the document preamble (which is part of every compilation), or
inside of the previewed environment itself.  I would think a similar
requirement for the LyX implementation reasonable.

Somewhat related: LaTeX's counters are not checkpointed currently.
This means that equation and section numbers in incremental updates
will come out wrong.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Email: [EMAIL PROTECTED]

Reply via email to