37

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?

closed as off-topic by yo', Mico, Svend Tveskæg, Mensch, Jesse Oct 2 '15 at 17:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center." – yo', Mico, Svend Tveskæg, Mensch, Jesse
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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 '14 at 0:24
  • 10
    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 '14 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 '14 at 0:26
  • 1
    \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 '14 at 0:26
  • 2
    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 '14 at 0:29
30

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

  • 1
    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 2 '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 2 '14 at 16:41
26

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

  • Could you show the usage in an example? – Werner Oct 2 '15 at 16:11
  • 2
    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 '15 at 16:29
  • 3
    @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 '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 2 '15 at 16:59
  • 1
    @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

Not the answer you're looking for? Browse other questions tagged or ask your own question.