Dear all,
I would like to use in my LyX documents something that would resemble
"text macros". I'm aware of http://www.lyx.org/trac/ticket/1704 and of
solutions such as
http://tex.stackexchange.com/questions/12747/keeping-the-names-of-things-consistent-in-lyx
, but I'm wondering if the existing 'math macro' machinery can be used
for this.

For example, I am writing cover letters and the recipient is mentioned
at least in three different places in the letter. When writing to a
different recipient, I often simply change the name (in addition to
some other minor modifications). I want to avoid needing to change the
name three times, which is prone to errors and misspellings. (Another
similar use case is when writing technical documentation as described
here: 
http://tex.stackexchange.com/questions/12747/keeping-the-names-of-things-consistent-in-lyx
.)

Is there a straightforward, native way (i.e. non-ERT) to do this in
LyX? I tried to use 'math macros' for this job (see attached):
- insert > math > macro
- Name= '\myname'
- TeX = ctrl+m to put the text into an mbox, then type 'M. Simpson'

But sofar I identified two issues:
- hyphenation/line breaks. Since the text is within a math inset, I
assume that TeX treats it as a single block and fails to hyphenate it
in certain instances. I'm not sure how to solve this, as I cannot
insert a hyphenation point into the macro.
- formatting and on-screen rendering. If for example in one place of
the text the macro is emphasized, and in another it is noun-ed, LyX
won't recognize that and display the instant preview using regular,
default font. This is minor, of course, but distracting.

So, is it a good or bad idea to use math macros to emulate text
macros? Is there a nicer approach?

Regards,
Liviu

-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail

Attachment: text macro.lyx
Description: Binary data

Attachment: text macro.pdf
Description: Adobe PDF document

Reply via email to