> 
> On 26/01/2011 2:33 PM, Bennink, Ryan S. wrote:
> > I am fairly new to LyX.   I have been disappointed to find that simple 
commands defined via \newcommand and
> \DeclareMathOperator in the preamble (for example, \newcommand{\sinc}{sinc}) 
appear as "evil red
> text" onscreen. In fact, they look exactly the same as undefined (illegal!) 
commands.  I got the
> impression from the LyX manuals and user comments that LyX was pretty good 
at interpreting and rendering
> user-defined commands.  Have I misunderstood something, or am I doing 
something wrong, or is there
> something wrong with my LyX installation?  (I realize there are several 
other threads with similar
> questions, but none of them have a clear answer to this as far as I can 
tell.)
> >
> > I am using LyX 1.6.7 on windows xp sp3.
> >
> > RSB
> >
> 
> To help you search through the Math manual: the nomenclature that LyX 
> uses for this is "math macro". The caveat is that you define math macros 
> in the body of the document, not in the preamble. All things in the 
> preamble are not parsed by LyX at all but simply passed on to the latex 
> process.
> 

Thanks for the response Julien.  I am starting to use math macros.  But a 
limitation of them is that I have to create them in LyX; they aren't 
automatically generated when I import LaTeX files I have written by hand 
(which I have a lot of!), and the result is a bunch of ugly formulas.  One of 
the main reasons I'm trying LyX is that it was claimed to be more compatible 
with raw LaTeX than Scientific Word, which I have used for years.

Regarding the use of the preamble, section 15.2 "Self-Defined Functions" of 
the math manual says that you can use the \DeclareMathOperator in the preamble 
to define your own named functions such that "the result is the same ... as 
with a predefined function", which I took to mean it would look onscreen like 
a predefined function. But then there is the footnote which says "self-defined 
functions are displayed in red, predefined ones in black".  If that means all 
LyX does is show the command name as ERT, then in my opinion that is a 
somewhat weak (and somewhat misleading) feature.

Ryan



Reply via email to