On 2008-12-15, Richard Heck wrote: > Niko Schwarz wrote: >> hello, i noticed that math macros exist. i want something similar, but >> in my text. i'm writing a text about a cs problem called "minimum KT >> distance", which is a noun. and I'm really tired of typing that name >> and then setting it to be a noun. isn't there a quicker way?
> ... You can use normal LaTeX macros by > defining them in your preamble, e.g.: > \newcommand{\mktd}{minimum KT distance} > and then putting \mktd in ERT where you want it. With LyX 1.6, a text-analogon to math-macros are insets. However, they aare defined in a module, not in the document (this is sometimes an advantage and sometimes not). > You can also define a keyboard binding to do that for you. You can alos define a key binding to insert the text and set it to noun. Find the required lyx functions and use "command-sequence", e.g. # Capitalise current word: \bind "C-u" "command-sequence word-backward; word-capitalize; mark-off" 1.6 also comes with some "completion" mechanism (but I did not try it because it makes LyX too slow on my machine). > Text macros are something it'd be nice to have, though. Maybe "embeddable modules" would do the trick? Günter