Paul Rubin wrote:
Jannick Asmus <jannick.news <at> gmail.com> writes:

Thx for the tips. I will try that out although macros are pretty new
to me.

Someplace in the document body, click Insert > Math > Macro and a new
macro inset will be created. Change \newmacroname to whatever you
like (say \sX for a macro to write a set X in mathcal). There are two
blue insets, the first labeled 'TeX' (this is the LaTeX code for the
macro) and the second labeled 'LyX' (used only if you want the macro
to display differently in the GUI than the way the LaTeX code would
normally display -- I have never had the need to use it). In the TeX
box, type the LaTeX code (let's use \mathcal{S}).  That's all you
need to do.  Now, in any math inset, type \sX and LyX should
automatically replace it with \mathcal{X}.

This is sooo simple. And it works. Thanks for that!

If you want to use a macro to convert arbitrary symbols to mathcal,
create a new macro (let's call it \mc). Before fiddling with the TeX
box, we want to add an argument. If the macro toolbar is displaying,
click the second icon (tooltip = "Append argument" -- I won't attempt
to describe the icon).  If not, or if you can't sort out the icons,
use Edit > Math > Macro Definition > Append Argument. The macro now
shows a LaTeX argument placeholder #1 in braces. In the TeX box,
highlight #1 (which should be automatically filled in) and type
\mathcal (which will somewhat unhelpfully convert #1 to down-arrow
infinity -- ignore that). Now, in any math formula, type \mc followed
by a space to get an inset. Anything you type in the inset is set in
mathcal. If you highlight content and type \mc space, the highlighted
content is converted.

That sounds easy too. This is for tomorrow since it is late in my time zone now.

/Paul

Your help is much appreciated. Great thingy, this LyX !!!

Good night,
J.

Reply via email to