60

What is the correct type for sign(x)(signum function)? I'm using:

\documentclass[journal,transmag]{IEEEtran} 
\usepackage{amsmath}
\usepackage{amssymb}    
\newcommand{\sign}{\text{sign}}

Is that correct or should I be using "sgn" instead?

5
  • Sorry but I'm afraid I don't understand your question. Could you explain for the uninitiated? Please also complete your code to provide a minimal working example (MWE).
    – cfr
    Dec 2, 2014 at 0:24
  • 15
    The usual name is ‘sgn’. It's not pre-defined, as far as I know. For a correct spacing in mathematical expressions, you have to use \DeclareMathOperator{\sgn}{sgn}after you've loaded amsmath.
    – Bernard
    Dec 2, 2014 at 0:26
  • Are you asking whether you should use \newcommand{\sign}{\text{sgn}}? If so, I think your question is off-topic for this site as it is about notation rather than how to produce it.
    – cfr
    Dec 2, 2014 at 0:26
  • 2
    \DeclareMathOperator\sign{sign}. And, as an extra, that lets you change the name; if you prefer to use sgn you just change the definition to \DeclareMathOperator\sign{sgn}.
    – Manuel
    Dec 2, 2014 at 0:26
  • 3
    I believe both sgn and sign are valid, although I prefer sgn personally. More important is the way you typeset the operator: Don't use \text{...} ! Use \DeclareMathOperator{\sgn}{sgn} instead. Edit: too slow...
    – JBantje
    Dec 2, 2014 at 0:29

2 Answers 2

48

Whether you use “sign” or “sgn” is a style issue which your intended publisher can answer, not us. That said, you probably want to use AMSMath’s \DeclareMathOperator not \newcommand; see newcommand vs. DeclareMathOperator:

…
\usepackage{amsmath}
\DeclareMathOperator{\sign}{sign}
…
Depending on the value of $\sign x$, $y$ will take the following values:
…

(On the other hand, see \DeclareMathOperator won't take arguments for times to use \newcommand, and how best to do so. As noted there, if you do define your own commands, use \operatorname not \text to format the name.)

2
  • 2
    There are a lot of us who are our own publisher so we often find ourselves trying to mull over what is the standard, or most advantageous, way to write something. (I'd guess that the great majority of documents never get to a traditional publisher, personally.) Dec 2, 2014 at 11:27
  • True enough, @JimHefferon; but that question is subjective: at best off-topic for this forum, at worst completely unanswerable. Dec 2, 2014 at 16:41
37

The question of whether to use "sgn" or "sign" is not entirely subjective: the ISO 80000-2 standard says it should be "sgn".

7
  • Could you show the usage in an example?
    – Werner
    Oct 2, 2015 at 16:11
  • 4
    That iso standard is just nonsense, it also tells strange unit usage about plots etc. It is entirely subjective and not even well designed. Math notation starndard idea itself is already subjective enough.
    – percusse
    Oct 2, 2015 at 16:29
  • 4
    @yo' That standard is actually from mathematicians :) Engineers never define standards to stuff that is not standardizable. Otherwise we all would be driving Lada Samara looking cars. And yes we are gods of this earth.
    – percusse
    Oct 2, 2015 at 16:57
  • 1
    @percusse Well, there are more such "standards", like tangent (choose tan or tg), arcus sine (choose arc\,sin, arcsin or sin^{-1}), etc. :-)
    – yo'
    Oct 2, 2015 at 16:59
  • 2
    @yo' I agree, the mathematical functions have standards, even in LaTeX, and it is sad that Donald didn't defined a TeX sgn function. But even more sad it is that no package has such a function yet (the people of amsmath could add it!). So I think the question is pertinent and 9 more people think the same. :) Feb 19, 2016 at 16:52

Not the answer you're looking for? Browse other questions tagged .