4

How can I automatically replace minus signs in subscripts $x_{y-z}$ with text mode minus signs $x_{y\text{-}z}$ without having to type the longer form every time?

danijar
  • 1,005
  • Minus within $x_{y-z}$ is a minus, indeed. On the other hand, "minus" within $x_{y\text{-}z}$ is not a "text mode minus sign" but a regular "dash". Not sure how do you reason the request for such aesthetic intervention, and why do you want to intervene? Which font do you use, can you provide MWE? – ivankokan Oct 19 '19 at 23:00
  • The motivation is to save space in equations with many such subscripts. While the normal minus clearly looks better than a dash in general, in subscripts it seems longer than necessary to me. Is such a global replacement possible in LaTeX? – danijar Oct 19 '19 at 23:07
  • 1
    it would be possible but a hyphen isn't really suitable as a minus. The subscript is already using as a smaller font and less space are you sure you want a shorter - as well? – David Carlisle Oct 19 '19 at 23:20
  • @DavidCarlisle I would like try different options for replacing the minus sign if there is a general way of replacing it in subscripts. – danijar Oct 20 '19 at 18:48
  • Minus must have the same shape as plus without the vertical line. You cannot use another shape because this corrupts the rythm of such formulae as a+b-c. And what you call "text mode minus" is not minus at all. This is your mistake and missundertanding of typographical principles. – wipet Apr 10 '20 at 19:49

1 Answers1

8

I had the same question. Here is what I found:

  • There are better ways, to make small minuses, see e.g. this question: Making a shorter minus

  • For choosing different symbols depending on the mathstyle you are using \mathchoice comes in handy.

  • I do not know yet how to put it over "-" (as far as I can tell using "-" calls your minus-symbol directly)

Here is what I use:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb} %for the \shortminus
\usepackage{graphicx} % for the \scalebox
\DeclareMathSymbol{\shortminus}{\mathbin}{AMSa}{"39}
\newcommand{\medminus}{\scalebox{0.6}[0.7]{\(-\)}}
\newcommand{\minus}{\mathchoice{-}{-}{\medminus}{\shortminus}}

\begin{document}

\[ a - a _{ a - a _{ a - a } } \]
\[ a \minus a _{ a \minus a _{ a \minus a } } \]

\end{document}

this is produced by the example code

S. Kohl
  • 111
  • 1
  • 5