Math & ScienceEquation Number with additional Symbol

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
symbol
Posts: 3
Joined: Tue Jun 18, 2013 7:18 pm

Equation Number with additional Symbol

Post by symbol »

I have a formula in which there is the symbol \pm like this.

Code: Select all

\begin{equation}\label{boh}
  y = \pm x
\end{equation}
Now this equation is numbered with something like (x). How to get (x)^{\pm} instead of (x) in the equation number?

Thanks a lot!
Last edited by localghost on Tue Jun 18, 2013 8:01 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Equation Number with additional Symbol

Post by localghost »

symbol wrote:[…] How to get (x)^{\pm} instead of (x) in the equation number? […]
Is this numbering scheme going to be globally throughout the whole document or locally for selected equations?


Best regards and welcome to the board
Thorsten
symbol
Posts: 3
Joined: Tue Jun 18, 2013 7:18 pm

Re: Equation Number with additional Symbol

Post by symbol »

I would like to have that symbol only for selected equations.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Equation Number with additional Symbol

Post by localghost »

Try this approach by the mathtools package.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools}  % loads »amsmath«

\newtagform{pm}{(}{)\rlap{$^\pm$}}

\begin{document}
  \usetagform{pm}
  \begin{equation}\label{eqn:einstein}
    E=mc^2
  \end{equation}
  \usetagform{default}

  \begin{equation}\label{eqn:schroedinger}
    i\hbar\frac{\partial}{\partial t} |\,\psi (t) \rangle = \hat{H} |\,\psi (t) \rangle
  \end{equation}
\end{document}
For other capabilities of the package refer to its manual.
symbol
Posts: 3
Joined: Tue Jun 18, 2013 7:18 pm

Re: Equation Number with additional Symbol

Post by symbol »

Great ! It is exactly what I need.
Thank you so much !
Post Reply