Barak Sh <baraksh <at> gmail.com> writes:

> 
> Hi,When using function names predefined in LaTeX, such as \sin or \log, the
spacing between the name and variables before or after it (for example in the
expression "x \sin \theta") is correct. However, when using \mathrm or \textrm
to type functions that are not predefined (for example, erf or sinc), any
variables before or after are joined to the function name, with no spacing at
all, so one has to manually add spaces.
> 
> Is there a way to define function names such that spaces are automatically
added when needed, like in the predefined ones?
> (In Wikipedia, \operatorname is used for this. However, I tried it in LyX and
it doesn't seem to work.)

In the preamble: \DeclareMathOperator{\erf}{erf} etc.
You may also need to switch Document > Settings > Math Options from "Use AMS
math package automatically" to "Use AMS math package".  The \DeclareMathOperator
command requires AMS math and LyX will not recognize that automatically.  If LyX
is loading AMS math due to something else in your document, fine, but if not
you'll need to force the load (and it cannot hurt to do so regardless).

/Paul





Reply via email to