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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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