LyXText-macro in LyX

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
dj38
Posts: 2
Joined: Sat Sep 15, 2012 2:46 pm

Text-macro in LyX

Post by dj38 »

I would like to use text-macros with LyX and I haven't found any way to do it.
More specifically, I would like that a particular word, say "dummy", has a particular font style, say "\textcolor{red}{\textsf{Dummy}}" in LaTeX.
Of course, I can define a \newcommand in the preamble, but this is not very convenient in LyX because I would have to use a ERT environment each time I write "dummy".
In LyX, the words "lyx" and "latex" are automatically replaced and this is the kind of thing I would like to do.
In other words, I look for an equivalent of the math-macros but that can be applied to regular text and not only in the math environment.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Re: Text-macro in LyX

Post by scottkosty »

Hi dj38, and welcome to the forums!

Strangely enough this was just asked on stackexchange. Please see my answer and warning there:

http://tex.stackexchange.com/questions/ ... 1591#71591

I might see if the LyX developers would consider adding a more flexible way for the user to do this. However, my guess is that there's a reason why it's not easy to do.

Scott
Post Reply