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?

Elnaz
  • 1,427
  • 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 02 '14 at 00: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 02 '14 at 00: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 02 '14 at 00: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 02 '14 at 00: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 02 '14 at 00:29

2 Answers2

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.)

  • 3
    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.) – Jim Hefferon Dec 02 '14 at 11:27
  • True enough, @JimHefferon; but that question is subjective: at best off-topic for this forum, at worst completely unanswerable. – J. C. Salomon Dec 02 '14 at 16:41
38

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

Daniel Hatton
  • 481
  • 4
  • 2
  • Could you show the usage in an example? – Werner Oct 02 '15 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 02 '15 at 16:29
  • I don't like this answer: First, the question itself is off-topic and a new answer to an old off-topic question seems just plain wrong to me (the only on-topic variant would be: "How to make $sgn x$ look like $\sin x$", leading to an answer about \DeclareMathOperator, but I'm sure that it would be a duplicate). Second, ISO is plain wrong stupid idea of engineers who think that they are the gods on the earth. Third, it does not mention at all what LaTeX has to say. – yo' Oct 02 '15 at 16:37
  • 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 02 '15 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 02 '15 at 16:59
  • @yo' Again from mathematicians :) Or the intersection between rigor-freaks and nerds – percusse Oct 02 '15 at 17:00
  • 3
    @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. :) – loved.by.Jesus Feb 19 '16 at 16:52