Paul Smith wrote:
You might want to show the effects of the first kind of ERT
only, but there is no useful way a program can see the difference
between the different kinds of ERT.


I disagree with you regarding the above paragraph, indicating you a
counterexample: Scientific WorkPlace. (Please, notice, that I am not
defending that SWP is, in general, superior to LyX; I definitely prefer
LyX.) For instance, with SWP, if you insert the LaTeX code $x=y$, saving and
closing the file, then, when you open again the same file, $x=y$ will be
shown as WYSIWIG. Obviously, I am with you when you say that not all ERTs
are visible.

So scientific workplace recognize some latex commands that lyx don't. That's fine, and theres nothing wrong in wanting more of that in lyx either.

I see two ways of showing latex as wysiwyg:

1. Recognize that the user used some construct already supported,
   (such as \hfill, \color, . . .) and convert it to native format.
   Problems:
   a. This is limited to what lyx support already.  Still, it may
      be helpful for those who knows latex.
   b. Hard cases is possible, such as
      \newcommand\myfill{\hfill}\myfill
      is just \hfill but you need a lot of parsing.
      And what if \myfill is used in a lot of places,
      and redefined a few times?
      Much harder cases are possible, of course.

2. Render the contents of the ERT box using latex,
   and show it as a picture.  Problem:
   a. It is hard to know when this will give a useful result.
      Lots of latex code don't make sense without the rest
      of the document.

You wanted latex->wysiwyg whenever possible.
Some easy cases can be done, similiar to how mathed
already converts \alpha.  I tried to point out that
it'll be too hard to cover all possible cases.
Any latex snippet with only "local effect"
_can_ be converted to a nice
visual representation, if you let a human do it.
But I don't think you can make software do it
in all cases.

Helge Hafting



Reply via email to