Math & ScienceChanging an equation number to a symbol

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Changing an equation number to a symbol

Post by Cham »

For a very rare case, I need to completely change the number of a particular equation to a symbol (\mathcal{A}). How can I do this, without affecting all the other equation numbers ?

Here's a MWE to work with :

Code: Select all

\documentclass[12pt,letterpaper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}

\begin{document}

Some equation :
	\begin{equation}
		y(x) = a x^2 + b x + c.
	\end{equation}
The following equation should have $\mathcal{A}$ as a "number" :
	\begin{equation}
		\label{test}
		x = \frac{- b \pm \sqrt{b^2 - 4 a c}}{2 a}.
	\end{equation}
A few comments about equation \eqref{test} :
	\begin{equation}
		y(z) = a + b z.
	\end{equation}
\end{document}
The reference should also show the correct symbol inside the text.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Changing an equation number to a symbol

Post by cgnieder »

Use \tag:

Code: Select all

\documentclass[12pt,letterpaper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
 
\begin{document}
 
Some equation:
\begin{equation}
  y(x) = a x^2 + b x + c.
\end{equation}
The following equation should have $\mathcal{A}$ as a  ``number'':
\begin{equation}
  \label{test}
  x = \frac{- b \pm \sqrt{b^2 - 4 a c}}{2 a}. \tag{$\mathcal{A}$}
\end{equation}
A few comments about equation \eqref{test}:
\begin{equation}
  y(z) = a + b z.
\end{equation}

\end{document}
Regards
site moderator & package author
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Changing an equation number to a symbol

Post by Cham »

Wow ! Perfect and so simple ! I didn't knew that one. Thanks !
Post Reply