General ⇒ question on equation numbering
question on equation numbering
Hi. I'm trying to write a Latex document where I have two sets of equations that have different numbering labeling. For example I want one type of equation to be numbered 1,2,3... and another set of equations (interspersed in the same document) with a different numbering scheme, i.e. I, II, III... I have tried the \newcounter command and the \newenvironment command and can get a new numbering scheme but I do not know how to set it up in equation format where the equation is centered and the counter is right justified and they are on the same line, the same way they are in the equation environment. Does anyone have any suggestions??? Thanks.
NEW: TikZ book now 40% off at Amazon.com for a short time.

question on equation numbering
Try this code to define a new environment called 'scheme'
It defines a new counter, redefines it to number it by chapter, a period, and then a capital roman numeral
Before starting the environment, step the counter, start centering, and put a rubber space on the left hand side, puts things into math mode, and adds an invisible counter on the left to get the spacing right.
After the environment is over, fill the right with a rubber space, don't allow a line break unless really necessary, and then put the counter in parenthesis.
Hope this helps...
Enjoy!
Code: Select all
...\newcounter{SchemeCounter} \renewcommand\theSchemeCounter{\thechapter.\Roman{SchemeCounter}}\newenvironment{scheme}%{\stepcounter{SchemeCounter}\begin{center}\hspace{\fill}$\phantom{(\theSchemeCounter)}}%{$\hspace*{\fill}\nolinebreak[3](\theSchemeCounter)\end{center}}...\begin{document}...\chapter{Test Chapter}...\begin{scheme}Insert equation here\end{scheme}
Before starting the environment, step the counter, start centering, and put a rubber space on the left hand side, puts things into math mode, and adds an invisible counter on the left to get the spacing right.
After the environment is over, fill the right with a rubber space, don't allow a line break unless really necessary, and then put the counter in parenthesis.
Hope this helps...
Enjoy!
question on equation numbering
I messed with this a bit more and got something that is much simpler, but also doesn't break the \label command (which the previous post does).
Replace the previous newenvironment with:
To use this version, you need to \usepackage{amsmath}. The previous version doesn't like having a \label, and will refer to the equation counter rather than the custom counter in a \ref{}
For anyone else reading this, in the interest of full disclosure, I share an office with mollyc, but I'm just posting what we figured out after going meticulously through LaTeX Companion 2nd ed. by Mittlebach & Goosens and LaTeX by Leslie Lampoort. I figured that someone else might be interested in our code fu.
Replace the previous newenvironment with:
Code: Select all
Code, edit and compile here:
\newenvironment{scheme}%{\stepcounter{SchemeCounter}\[}%{\tag{\theSchemeCounter}\]}
For anyone else reading this, in the interest of full disclosure, I share an office with mollyc, but I'm just posting what we figured out after going meticulously through LaTeX Companion 2nd ed. by Mittlebach & Goosens and LaTeX by Leslie Lampoort. I figured that someone else might be interested in our code fu.