How to Use Plus and Minus Superscripts in a LaTeX bmatrix
At a glance
- 1. Load amsmath
Add the amsmath package to your document preamble to use the bmatrix environment.
- 2. Add superscripts
Write ^{+} or ^{-} after the matrix entry that should carry the sign.
- 3. Compile the example
Use the complete example to check the spacing and placement of the superscripts.
To put a plus or minus sign in the superscript position of an entry in a bmatrix, use ^{+} or ^{-}. For example, x^{+} displays with a plus sign as its superscript. The bmatrix environment comes from the amsmath package.
Complete example
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{bmatrix}
x^{+} & y^{-} \\
z^{-} & w^{+}
\end{bmatrix}
\]
\end{document}
The amsmath package defines bmatrix, which typesets a matrix with square brackets. Within each entry, ^ starts a superscript. Braces group the sign into the superscript, so ^{+} and ^{-} are clear and work consistently.
Superscript on the whole matrix
If the plus or minus sign is meant to label the entire matrix, put it after the closing environment instead:
\[
\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}^{+}
\]
Use \begin{bmatrix} ... \end{bmatrix}^{+} for a superscript on the matrix, and put ^{+} or ^{-} on an individual entry for a superscript on that entry.
Common mistakes
- Leaving out braces:
x^+is valid because+is a single math token, butx^{+}makes the intended superscript explicit. Braces are essential when the superscript has more than one character, as inx^{12}. - Using
\pmfor a single plus sign:\pmproduces the combined plus-or-minus symbol, . For a plus sign alone, use+or^{+}; for a minus sign alone, use-or^{-}. - Forgetting the package: If LaTeX reports that
bmatrixis undefined, add\usepackage{amsmath}in the preamble. - Using text-mode braces for the matrix: Keep the matrix inside math mode, such as
\[ ... \]in the example. Thebmatrixenvironment is for mathematical expressions, not ordinary paragraph text.
References
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.