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?
Asked
Active
Viewed 1,859 times
4
danijar
- 1,005
1 Answers
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}
S. Kohl
- 111
- 1
- 5

$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