Unfortunately what you describe doesn't work. LyX still parses whatever you C-M, and this is precisely why we need something like a \rawtex box.

For example, suppose we want TeX code that says "x^-{y}". (You must be able to write stuff like this if you want to use xy-pic for commutative diagrams.) You can type it, C-M it, then export it as .tex. The resulting file then says:
$x^{-}{y}$
The extra brackets totally screw up xy-pic.

In summary, we'd need to make something beyond the C-M facility. I wish I knew more programming so I could write a patch myself. I notice that the parsing changes when you invoke a \textrm box, so in theory I'd think it wouldn't be too hard to just make another box for our purposes.

-Bob

Bo Peng wrote:
OK, so a few people are interested.

If we limit the use of such feature, at first, only to math. This
feature is doable. Remember that if we have a $x^2$ as text, select
and press C-M, we can get x^2 in math mode. This can be used in this
case.

1. in the view-source (edit-source later?) dialog, if the user clicks
anywhere other than between $   $ or [ ], the focus is *not* accepted.
2. If between $ $, locate the inset in the lyx file (should not be too
hard) and select.
3. For whatever inputted between $$, use the C-M facility and try to
convert it to math and replace selected inset. (If convert fail, do
nothing, or convert the inset to ERT. )

Sound reasonable?
Bo.


Reply via email to