# Rule for writing superscript in text mode

In the scope of gaining space, I would like my superscript minuses to be shortened from:

$J^{-1}$


to

$J^{\text -1}$


using a rule.

• What do you mean by "using a rule"? – user156344 Mar 27 at 9:37
• @JouleV I believe a hyphen is meant.@Dash: What's the question? – campa Mar 27 at 9:38
• Sorry but I don’t quite understand. You wanna shorten a short sequence of characters to a long sequence? – L. F. Mar 27 at 9:39
• What I mean by a rule is that I don't want a solution that consists in putting "\text" in every brackets like I did. Instead, I would like a a way to define it globally. In the spirit of defining a "newcommand" perhaps. If you run my code, you'll see that the second proposition has a shorter superscript "-1". It therefore uses less space which is my final goal. I am open to other suggestions. – Dahs Mar 27 at 9:52
• @Dash DON'T DO THAT!!!. Your readers will be grateful. – user156344 Mar 27 at 9:59

I'm not sure that “saving space” at the expense of readability should be pursued.

In the picture, top is the standard, bottom is the “space saving” version.

\documentclass{article}
\usepackage{amsmath,graphicx}

\makeatletter
\DeclareRobustCommand{\shortminus}{\mathbin{\mathpalette\short@minus\relax}}
\newcommand{\short@minus}[2]{%
\ifx#1\displaystyle
\std@minus
\else
\ifx#1\textstyle
\std@minus
\else
\scalebox{0.5}[1]{$\m@th#1\std@minus$}%
\fi
\fi
}
\makeatother

\begingroup\lccode~=-\lowercase{\endgroup\let~}\shortminus
\AtBeginDocument{\mathcode-="8000 }

\begin{document}

$-J^{\csname std@minus\endcsname1}$

$-J^{-1}$

\end{document}


• I think I will not pursue this idea after all. But thanks for the code anyway, it helps me understanding the "makeatletter/makeatother" stuff. I am surprised you think it looks less readable. Of course the symbol is smaller, but it looks more like the way I (and possibly others) write on paper. The minus symbol is still visible and the reader should think about an "inverse". And because I insisted on the definition of $J^{-1}$ at the beginning of the text. I don't think this should be read from 100 feet using binoculars and I can read it with myopia. Can you develop your comment ? – Dahs Mar 27 at 10:32
• @Dash If you want that the inverse is denoted differently, it's better to define a command for it, and not monkeying with the minus sign generally. – egreg Mar 27 at 10:52
• Why are general modifications of such sign a bad idea ? – Dahs Mar 27 at 10:56
• @Dash Try $a^{m-n}$`. – egreg Mar 27 at 10:57