GeneralAppending text to equation numbers

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
kyselad
Posts: 2
Joined: Thu Jan 03, 2008 8:49 pm

Appending text to equation numbers

Post by kyselad »

I'm trying to reformat my equation numbers to include a letter in front of each automatically numbered item. So instead of (1), (2), ... , I'm trying to get (S1), (S2) ...

I'm fussy, so:
1. I'd like to get this working with automatic numbering to facilitate referencing
2. The prefix needs to show up both in the equation itself and in subsequent references to the equation
3. It needs to work with both equation and eqnarray, so simply defining a new version of "equation" won't do the trick

This probably requires getting into the base-level formatting (especially to satisfy #3), and I can't seem to track down info on how to handle this. Any help is most appreciated.

Thanks,
Dave

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

kyselad
Posts: 2
Joined: Thu Jan 03, 2008 8:49 pm

Re: Appending text to equation numbers

Post by kyselad »

I must have spent 2 h on this before posting, then figured it out minutes later. Figures.
Anyway, in case anyone else stumbles upon this looking for the solution:

\renewcommand{\theequation}{S.\arabic{equation}}

Putting this in the preamble solves the issue. Ridiculously simple.

Cheers,
Dave
Post Reply