LaTeX forum ⇒ Math & ScienceChanging an equation number to a symbol Topic is solved

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

Changing an equation number to a symbol

Postby Cham » Sun May 21, 2017 5:03 pm

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 :
  1. \documentclass[12pt,letterpaper]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage{amsmath}
  5. \usepackage{amsfonts}
  6. \usepackage{mathtools}
  7.  
  8. \begin{document}
  9.  
  10. Some equation :
  11. \begin{equation}
  12. y(x) = a x^2 + b x + c.
  13. \end{equation}
  14. The following equation should have $\mathcal{A}$ as a "number" :
  15. \begin{equation}
  16. \label{test}
  17. x = \frac{- b \pm \sqrt{b^2 - 4 a c}}{2 a}.
  18. \end{equation}
  19. A few comments about equation \eqref{test} :
  20. \begin{equation}
  21. y(z) = a + b z.
  22. \end{equation}
  23. \end{document}


The reference should also show the correct symbol inside the text.

User avatar
cgnieder
Site Moderator
Posts: 1974
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:

Postby cgnieder » Sun May 21, 2017 7:05 pm

Use \tag:

  1. \documentclass[12pt,letterpaper]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage{amsmath}
  5. \usepackage{amsfonts}
  6. \usepackage{mathtools}
  7.  
  8. \begin{document}
  9.  
  10. Some equation:
  11. \begin{equation}
  12. y(x) = a x^2 + b x + c.
  13. \end{equation}
  14. The following equation should have $\mathcal{A}$ as a ``number'':
  15. \begin{equation}
  16. \label{test}
  17. x = \frac{- b \pm \sqrt{b^2 - 4 a c}}{2 a}. \tag{$\mathcal{A}$}
  18. \end{equation}
  19. A few comments about equation \eqref{test}:
  20. \begin{equation}
  21. y(z) = a + b z.
  22. \end{equation}
  23.  
  24. \end{document}


Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

User avatar
Cham
Posts: 813
Joined: Sat Apr 02, 2011 4:06 pm

Postby Cham » Sun May 21, 2017 7:27 pm

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


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 3 guests