Re: new operators in LyX?
On 2017-02-24, Bernt Lie wrote: > From: lyx-users@lists.lyx.org [mailto:lyx-users@lists.lyx.org] On Behalf Of > Jean-Marc Lasgouttes > Le 24/02/2017 à 16:07, Bernt Lie a écrit : >> I need to typeset the signum function as an operator. I have tried to >> insert "\mathop{sgn}", but this gives "sgn" in italic, and not in >> roman as it should. > The right command is operatorname, I think. LyX is not yet able to > display it properly , though. You can define a math-macro with \operatorname{sgn} in the TeX definition and sgn in upright roman font in the LyX definition. Günter
RE: new operators in LyX?
-Original Message- From: lyx-users@lists.lyx.org [mailto:lyx-users@lists.lyx.org] On Behalf Of Jean-Marc Lasgouttes Sent: fredag 24. februar 2017 16.35 To: lyx-users@lists.lyx.org Subject: Re: new operators in LyX? Le 24/02/2017 à 16:07, Bernt Lie a écrit : > I use LyX 2.2 on Win10. > > I need to typeset the signum function as an operator. I have tried to insert > "\mathop{sgn}", but this gives "sgn" in italic, and not in roman as it should. The right command is operatorname, I think. LyX is not yet able to display it properly , though. Jmarc -- On "operatorname" -- this is somewhat fragile, I guess. I assume I have AMSMath. If I do the following in math or display math...: type "\operatorname" followed by an opening brace "{", LyX adds the closing brace. Then type the operator name inside of the braces to have "\operatorname{sgn}" where the cursor now is just after the "n" and before the closing brace. Then hit "space" to move out of the brace. The math still looks like "\operatorname{sgn}". However, if I go out of the math/display math *and* have set up LyX with math preview, then it looks ok. But a slightest mistake causes an erroneous preview... -B -B
RE: new operators in LyX?
-Original Message- From: lyx-users@lists.lyx.org [mailto:lyx-users@lists.lyx.org] On Behalf Of Jean-Marc Lasgouttes Sent: fredag 24. februar 2017 16.35 To: lyx-users@lists.lyx.org Subject: Re: new operators in LyX? Le 24/02/2017 à 16:07, Bernt Lie a écrit : > I use LyX 2.2 on Win10. > > I need to typeset the signum function as an operator. I have tried to insert > "\mathop{sgn}", but this gives "sgn" in italic, and not in roman as it should. The right command is operatorname, I think. LyX is not yet able to display it properly , though. Jmarc --- Yes, that works. At least in preview... Thanks. -Bernt
Re: new operators in LyX?
Le 24/02/2017 à 16:07, Bernt Lie a écrit : I use LyX 2.2 on Win10. I need to typeset the signum function as an operator. I have tried to insert "\mathop{sgn}", but this gives "sgn" in italic, and not in roman as it should. The right command is operatorname, I think. LyX is not yet able to display it properly , though. JMarc
RE: new operators in LyX?
-Original Message- From: lyx-users@lists.lyx.org [mailto:lyx-users@lists.lyx.org] On Behalf Of David L. Johnson Sent: fredag 24. februar 2017 16.20 To: lyx-users@lists.lyx.org Subject: Re: new operators in LyX? On 02/24/2017 10:07 AM, Bernt Lie wrote: > I use LyX 2.2 on Win10. > > I need to typeset the signum function as an operator. I have tried to insert > "\mathop{sgn}", but this gives "sgn" in italic, and not in roman as it should. > > Is there a syntax for this? > > -Bernt \rm{sgn} ?? -- David L. Johnson Department of Mathematics Lehigh University -- ...or \mathrm ? But this gives "wrong" distance in the expressions, I think. -Bernt
RE: new operators in LyX?
From: lyx-users@lists.lyx.org [mailto:lyx-users@lists.lyx.org] On Behalf Of Paul A. Rubin Sent: fredag 24. februar 2017 16.28 To: lyx-users@lists.lyx.org Subject: Re: new operators in LyX? On 02/24/2017 10:07 AM, Bernt Lie wrote: I use LyX 2.2 on Win10. I need to typeset the signum function as an operator. I have tried to insert "\mathop{sgn}", but this gives "sgn" in italic, and not in roman as it should. Is there a syntax for this? -Bernt Assuming that you are loading AMSMath, try adding \DeclareMathOperator{\sgn}{sgn} to the document preamble and then use \sgn in math insets. Paul -- I’m pretty sure that I managed to do it without changing the preamble a few days ago, but I cannot remember what command I used... -Bernt
Re: new operators in LyX?
On 02/24/2017 10:07 AM, Bernt Lie wrote: I use LyX 2.2 on Win10. I need to typeset the signum function as an operator. I have tried to insert "\mathop{sgn}", but this gives "sgn" in italic, and not in roman as it should. Is there a syntax for this? -Bernt Assuming that you are loading AMSMath, try adding \DeclareMathOperator{\sgn}{sgn} to the document preamble and then use \sgn in math insets. Paul
Re: new operators in LyX?
On 02/24/2017 10:07 AM, Bernt Lie wrote: I use LyX 2.2 on Win10. I need to typeset the signum function as an operator. I have tried to insert "\mathop{sgn}", but this gives "sgn" in italic, and not in roman as it should. Is there a syntax for this? -Bernt \rm{sgn} ?? -- David L. Johnson Department of Mathematics Lehigh University
new operators in LyX?
I use LyX 2.2 on Win10. I need to typeset the signum function as an operator. I have tried to insert "\mathop{sgn}", but this gives "sgn" in italic, and not in roman as it should. Is there a syntax for this? -Bernt