# Plus sign and minus sign as superscripts in bmatrix

As the title says I am trying to write a plus or minus as superscripts for various particle names in a bmatrix, but it does not work. I have searched for solutions, but only came up with one, which should work, but doesn't. Now it really bothers why LaTeX does not have this feature built in, that seems really silly, but maybe there is a good reason.

My code is:

%various packages
\newcommand{\minus}[1]{{#1}^{\scalebox{0.8}{-}}}
\newcommand{\plus}[1]{{#1}^{\scalebox{0.6}{\!+}}}
\begin{document}
\begin{bmatrix}
\pi^{\plus} & 0 & 0 \\
0 & 0 & 0 \\
0 & 0 & 0
\end{bmatrix}
\end{document}

the error i get is "Argument of \plus has an extra }. \par \pi^{\plus} and the error repeats in my log - maybe 50 of the same errors but only on the same line.

• Welcome to TeX.SX! Macro \plus is defined having one argument, but it is used without argument. Likely, \plus{\pi} is the intended usage of the macro. Dec 16, 2016 at 3:02

You should define \plus and \minus to not take an argument:

\documentclass{article}

\usepackage{amsmath,graphicx}

\newcommand{\minus}{\scalebox{0.8}{$-$}}
\newcommand{\plus}{\scalebox{0.6}{$+$}}

\begin{document}

$\begin{bmatrix} \pi^{\plus} & 0 & 0 \\ 0 & \pi^{\minus} & 0 \\ 0 & 0 & \pi^{\plus} \end{bmatrix}$

\end{document}

I've updated the definition slightly, ensuring that + and - are taken as math binary operators.

• Thank you very much. That works and from your explanation i also see why. Simple and fast help, i appreciate it!
– Yuki
Dec 16, 2016 at 3:02
• Does anyone know why this is not standard in LaTeX?
– Yuki
Dec 16, 2016 at 3:06
• @Alex: What is this? \plus and \minus? It's because not everyone use it in your way.
– Werner
Dec 16, 2016 at 3:07
• I understand that but i was thinking that a simple solution such as \+ would be useful to those who use it, without bothering those who do not use it. It works the same way with a lot of other special characters. Then again, that is just my opinion. Thank you once again for your help!
– Yuki
Dec 16, 2016 at 3:42
• @Alex: For what it's worth, \- is an existing control sequence.
– Werner
Dec 16, 2016 at 3:48