Guenter Milde wrote:
>
> PS: Question to the gurus:
>
> Could I have a function or macro that does this but
> also changes the font to roman?
>
> \bind "C-S-underscore" "math-insert _\mathrm{}" does not work
>
> defining a (math-macro sub 1) does not work either (font changes cannot be
> included in the macro definiton in a WYSIWYM manner, only via \textrm{#1}
> all in red)
>
> Guenter
>
>
There is a lyx function called "command-sequence" which can help to
define strange shortcuts. Try something like this:
\bind "C-S-underscore" "command-sequence math-insert _;
math-insert mathrm;"
But this work only for the first char after the mathrm, because there is
no {}.
A very ugly solution is this one:
"command-sequence math-insert _; tex-mode; type m; type a; type t; type
h; type r; type m; type {;"
The closing } is added by LyX (type has the same behaviour as you with
your favorite keyboard).
But when I re-read it, the shame falls on me (I've got a lot of such
things in my perso.bind), and I expect real gurus will forgive me...
--
Thomas.