Customize subequation numbering
up vote
3
down vote
favorite
I need to customize equation numbering as follows:
Some text ...
a+b (5)
3+2 (5')
... some more text....
c+d (6)
The idea is that (5') is an example of (5). I thought of using subequations, but I am not sure how to customize the inner numbering, as it would generate 5a and 5b, or 5.i, 5.ii, etc.... If I use tag{} instead, I am not sure how to get the previous equation number (5, in the example).
equations amsmath subequations tag
add a comment |
up vote
3
down vote
favorite
I need to customize equation numbering as follows:
Some text ...
a+b (5)
3+2 (5')
... some more text....
c+d (6)
The idea is that (5') is an example of (5). I thought of using subequations, but I am not sure how to customize the inner numbering, as it would generate 5a and 5b, or 5.i, 5.ii, etc.... If I use tag{} instead, I am not sure how to get the previous equation number (5, in the example).
equations amsmath subequations tag
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I need to customize equation numbering as follows:
Some text ...
a+b (5)
3+2 (5')
... some more text....
c+d (6)
The idea is that (5') is an example of (5). I thought of using subequations, but I am not sure how to customize the inner numbering, as it would generate 5a and 5b, or 5.i, 5.ii, etc.... If I use tag{} instead, I am not sure how to get the previous equation number (5, in the example).
equations amsmath subequations tag
I need to customize equation numbering as follows:
Some text ...
a+b (5)
3+2 (5')
... some more text....
c+d (6)
The idea is that (5') is an example of (5). I thought of using subequations, but I am not sure how to customize the inner numbering, as it would generate 5a and 5b, or 5.i, 5.ii, etc.... If I use tag{} instead, I am not sure how to get the previous equation number (5, in the example).
equations amsmath subequations tag
equations amsmath subequations tag
asked Nov 12 at 20:00
andy
314
314
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
up vote
3
down vote
You can define an eqorn
command. If you use eqorn['']
you get two primes; any math symbol can be specified in the optional argument.
documentclass{article}
usepackage{amsmath}
newcommand{eqorn}[1][']{tag{theequationensuremath{#1}}}
begin{document}
Some text ...
begin{gather}% or align or whatnot
a+b label{main} \
3+2 eqorn label{secondary}
end{gather}
... some more text....
begin{equation}
c+d
end{equation}
with references to eqref{main} and eqref{secondary}.
end{document}
add a comment |
up vote
3
down vote
Here's an approach using expl3
's prg_replicate:nn
to produce n
copies of '
to number the equations in subequations
and etoolbox
's patchcmd
to insert that in the subequations
environment.
documentclass{article}
usepackage{amsmath}
usepackage{expl3}
% Creating a command to print a number of apostrophes
ExplSyntaxOn
cs_new:Npn apost #1
{ __andy_apost:cn { c@ #1 } }
cs_new:Npn __andy_apost:Nn #1
{
ensuremath {
prg_replicate:nn { #1 - 1 } { {'} }
}
}
cs_generate_variant:Nn __andy_apost:Nn { c }
ExplSyntaxOff
% Patching-in that command in subequations
usepackage{etoolbox}
patchcmdsubequations
{deftheequation{theparentequationalph{equation}}}
{deftheequation{theparentequationapost{equation}}}
{}{FAIL}
begin{document}
begin{subequations}
begin{equation}
a+b
end{equation}
begin{equation}
3+2
end{equation}
begin{equation}
5
end{equation}
end{subequations}
end{document}
1
Possiblyensuremath{prg_replicate:nn { #1 - 1 }{'}}
gives a better output.
– egreg
Nov 12 at 22:29
@egreg Better indeed. Thanks :-)
– Phelype Oleinik
Nov 12 at 23:20
add a comment |
up vote
1
down vote
An alternative is the modified answer from here:
documentclass{article}
usepackage{amsmath}
makeatletter
newcommand*ifcounter[1]{%
ifcsname c@#1endcsname%
expandafter@firstoftwo%
else%
expandafter@secondoftwo%
fi%
}%
makeatother
newcommandEqFamTag[2][roman]{%
ifcounter{#2}{%
expandafteraddtocounter{#2}{1}%
expandafteraddtocounter{#2Prev}{1}
xdeftemp{csname #2 Eqendcsname ifnumvalue{#2Prev}>0 space(csname #1endcsname{#2Prev})fi}%
globalexpandafterletcsname #2arabic{#2}endcsnametemp%
tag{temp}%
}{%
globalexpandafternewcounter{#2}%
globalexpandafternewcounter{#2Prev}
expandafteraddtocounter{#2}{1}%
xdeftemp{theequation ifnumvalue{#2Prev}>0 space(csname #1endcsname{#2Prev})fi}%
xdefeqonfamily{theequation}%
globalexpandafterletcsname #2 Eqendcsnameeqonfamily%
globalexpandafterletcsname #2arabic{#2}endcsnametemp%
tag{temp}%
expandafteraddtocounter{equation}{1}
}%
}%
newcommandmyFamRef[2][1]{csname #2#1endcsname}
begin{document}
section{test}
begin{equation}
f(x)=3cdot x
end{equation}
begin{equation}
x=4cdot y EqFamTag{MyFamily}
end{equation}
As an example:
begin{equation}
x=4cdot 2=8EqFamTag{MyFamily}
end{equation}
The equation: myFamRef[2]{MyFamily} is the first example/member of the equation myFamRef{MyFamily}
begin{equation}
x=4cdot y
end{equation}
Another example of :
begin{equation}
x=4cdot 2=8EqFamTag{MyFamily}
end{equation}
The equation: myFamRef[3]{MyFamily} is the second example/member of the equation myFamRef{MyFamily}
Another family of equations is:
begin{equation}
f(x)=3+y EqFamTag{NewFam}
end{equation}
and a member of it is:
begin{equation}
f(6)=9 EqFamTag{NewFam}
end{equation}
end{document}
Output:
add a comment |
up vote
0
down vote
It is very easy to have a first (main) subequation numbered as an ordinary equation, the subequations standard numbering starting only at the second subequation:
documentclass{article}
usepackage{amsmath}
setcounter{equation}{4}
begin{document}
Some text . . . . . .
begin{subequations}
addtocounter{equation}{-1}
begin{gather}
a+b label{main} \
3+2 label{ex-1} \
5label{ex-2}
end{gather}
end{subequations}.
. . . . . .Some more text . . . . . .
begin{equation}
c + d
end{equation}
eqref{ex-1} and eqref{ex-2} illustrate eqref{main}.
end{document}
add a comment |
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
You can define an eqorn
command. If you use eqorn['']
you get two primes; any math symbol can be specified in the optional argument.
documentclass{article}
usepackage{amsmath}
newcommand{eqorn}[1][']{tag{theequationensuremath{#1}}}
begin{document}
Some text ...
begin{gather}% or align or whatnot
a+b label{main} \
3+2 eqorn label{secondary}
end{gather}
... some more text....
begin{equation}
c+d
end{equation}
with references to eqref{main} and eqref{secondary}.
end{document}
add a comment |
up vote
3
down vote
You can define an eqorn
command. If you use eqorn['']
you get two primes; any math symbol can be specified in the optional argument.
documentclass{article}
usepackage{amsmath}
newcommand{eqorn}[1][']{tag{theequationensuremath{#1}}}
begin{document}
Some text ...
begin{gather}% or align or whatnot
a+b label{main} \
3+2 eqorn label{secondary}
end{gather}
... some more text....
begin{equation}
c+d
end{equation}
with references to eqref{main} and eqref{secondary}.
end{document}
add a comment |
up vote
3
down vote
up vote
3
down vote
You can define an eqorn
command. If you use eqorn['']
you get two primes; any math symbol can be specified in the optional argument.
documentclass{article}
usepackage{amsmath}
newcommand{eqorn}[1][']{tag{theequationensuremath{#1}}}
begin{document}
Some text ...
begin{gather}% or align or whatnot
a+b label{main} \
3+2 eqorn label{secondary}
end{gather}
... some more text....
begin{equation}
c+d
end{equation}
with references to eqref{main} and eqref{secondary}.
end{document}
You can define an eqorn
command. If you use eqorn['']
you get two primes; any math symbol can be specified in the optional argument.
documentclass{article}
usepackage{amsmath}
newcommand{eqorn}[1][']{tag{theequationensuremath{#1}}}
begin{document}
Some text ...
begin{gather}% or align or whatnot
a+b label{main} \
3+2 eqorn label{secondary}
end{gather}
... some more text....
begin{equation}
c+d
end{equation}
with references to eqref{main} and eqref{secondary}.
end{document}
edited Nov 12 at 22:38
answered Nov 12 at 22:33
egreg
697k8518513118
697k8518513118
add a comment |
add a comment |
up vote
3
down vote
Here's an approach using expl3
's prg_replicate:nn
to produce n
copies of '
to number the equations in subequations
and etoolbox
's patchcmd
to insert that in the subequations
environment.
documentclass{article}
usepackage{amsmath}
usepackage{expl3}
% Creating a command to print a number of apostrophes
ExplSyntaxOn
cs_new:Npn apost #1
{ __andy_apost:cn { c@ #1 } }
cs_new:Npn __andy_apost:Nn #1
{
ensuremath {
prg_replicate:nn { #1 - 1 } { {'} }
}
}
cs_generate_variant:Nn __andy_apost:Nn { c }
ExplSyntaxOff
% Patching-in that command in subequations
usepackage{etoolbox}
patchcmdsubequations
{deftheequation{theparentequationalph{equation}}}
{deftheequation{theparentequationapost{equation}}}
{}{FAIL}
begin{document}
begin{subequations}
begin{equation}
a+b
end{equation}
begin{equation}
3+2
end{equation}
begin{equation}
5
end{equation}
end{subequations}
end{document}
1
Possiblyensuremath{prg_replicate:nn { #1 - 1 }{'}}
gives a better output.
– egreg
Nov 12 at 22:29
@egreg Better indeed. Thanks :-)
– Phelype Oleinik
Nov 12 at 23:20
add a comment |
up vote
3
down vote
Here's an approach using expl3
's prg_replicate:nn
to produce n
copies of '
to number the equations in subequations
and etoolbox
's patchcmd
to insert that in the subequations
environment.
documentclass{article}
usepackage{amsmath}
usepackage{expl3}
% Creating a command to print a number of apostrophes
ExplSyntaxOn
cs_new:Npn apost #1
{ __andy_apost:cn { c@ #1 } }
cs_new:Npn __andy_apost:Nn #1
{
ensuremath {
prg_replicate:nn { #1 - 1 } { {'} }
}
}
cs_generate_variant:Nn __andy_apost:Nn { c }
ExplSyntaxOff
% Patching-in that command in subequations
usepackage{etoolbox}
patchcmdsubequations
{deftheequation{theparentequationalph{equation}}}
{deftheequation{theparentequationapost{equation}}}
{}{FAIL}
begin{document}
begin{subequations}
begin{equation}
a+b
end{equation}
begin{equation}
3+2
end{equation}
begin{equation}
5
end{equation}
end{subequations}
end{document}
1
Possiblyensuremath{prg_replicate:nn { #1 - 1 }{'}}
gives a better output.
– egreg
Nov 12 at 22:29
@egreg Better indeed. Thanks :-)
– Phelype Oleinik
Nov 12 at 23:20
add a comment |
up vote
3
down vote
up vote
3
down vote
Here's an approach using expl3
's prg_replicate:nn
to produce n
copies of '
to number the equations in subequations
and etoolbox
's patchcmd
to insert that in the subequations
environment.
documentclass{article}
usepackage{amsmath}
usepackage{expl3}
% Creating a command to print a number of apostrophes
ExplSyntaxOn
cs_new:Npn apost #1
{ __andy_apost:cn { c@ #1 } }
cs_new:Npn __andy_apost:Nn #1
{
ensuremath {
prg_replicate:nn { #1 - 1 } { {'} }
}
}
cs_generate_variant:Nn __andy_apost:Nn { c }
ExplSyntaxOff
% Patching-in that command in subequations
usepackage{etoolbox}
patchcmdsubequations
{deftheequation{theparentequationalph{equation}}}
{deftheequation{theparentequationapost{equation}}}
{}{FAIL}
begin{document}
begin{subequations}
begin{equation}
a+b
end{equation}
begin{equation}
3+2
end{equation}
begin{equation}
5
end{equation}
end{subequations}
end{document}
Here's an approach using expl3
's prg_replicate:nn
to produce n
copies of '
to number the equations in subequations
and etoolbox
's patchcmd
to insert that in the subequations
environment.
documentclass{article}
usepackage{amsmath}
usepackage{expl3}
% Creating a command to print a number of apostrophes
ExplSyntaxOn
cs_new:Npn apost #1
{ __andy_apost:cn { c@ #1 } }
cs_new:Npn __andy_apost:Nn #1
{
ensuremath {
prg_replicate:nn { #1 - 1 } { {'} }
}
}
cs_generate_variant:Nn __andy_apost:Nn { c }
ExplSyntaxOff
% Patching-in that command in subequations
usepackage{etoolbox}
patchcmdsubequations
{deftheequation{theparentequationalph{equation}}}
{deftheequation{theparentequationapost{equation}}}
{}{FAIL}
begin{document}
begin{subequations}
begin{equation}
a+b
end{equation}
begin{equation}
3+2
end{equation}
begin{equation}
5
end{equation}
end{subequations}
end{document}
edited Nov 12 at 23:20
answered Nov 12 at 20:57
Phelype Oleinik
20.1k54277
20.1k54277
1
Possiblyensuremath{prg_replicate:nn { #1 - 1 }{'}}
gives a better output.
– egreg
Nov 12 at 22:29
@egreg Better indeed. Thanks :-)
– Phelype Oleinik
Nov 12 at 23:20
add a comment |
1
Possiblyensuremath{prg_replicate:nn { #1 - 1 }{'}}
gives a better output.
– egreg
Nov 12 at 22:29
@egreg Better indeed. Thanks :-)
– Phelype Oleinik
Nov 12 at 23:20
1
1
Possibly
ensuremath{prg_replicate:nn { #1 - 1 }{'}}
gives a better output.– egreg
Nov 12 at 22:29
Possibly
ensuremath{prg_replicate:nn { #1 - 1 }{'}}
gives a better output.– egreg
Nov 12 at 22:29
@egreg Better indeed. Thanks :-)
– Phelype Oleinik
Nov 12 at 23:20
@egreg Better indeed. Thanks :-)
– Phelype Oleinik
Nov 12 at 23:20
add a comment |
up vote
1
down vote
An alternative is the modified answer from here:
documentclass{article}
usepackage{amsmath}
makeatletter
newcommand*ifcounter[1]{%
ifcsname c@#1endcsname%
expandafter@firstoftwo%
else%
expandafter@secondoftwo%
fi%
}%
makeatother
newcommandEqFamTag[2][roman]{%
ifcounter{#2}{%
expandafteraddtocounter{#2}{1}%
expandafteraddtocounter{#2Prev}{1}
xdeftemp{csname #2 Eqendcsname ifnumvalue{#2Prev}>0 space(csname #1endcsname{#2Prev})fi}%
globalexpandafterletcsname #2arabic{#2}endcsnametemp%
tag{temp}%
}{%
globalexpandafternewcounter{#2}%
globalexpandafternewcounter{#2Prev}
expandafteraddtocounter{#2}{1}%
xdeftemp{theequation ifnumvalue{#2Prev}>0 space(csname #1endcsname{#2Prev})fi}%
xdefeqonfamily{theequation}%
globalexpandafterletcsname #2 Eqendcsnameeqonfamily%
globalexpandafterletcsname #2arabic{#2}endcsnametemp%
tag{temp}%
expandafteraddtocounter{equation}{1}
}%
}%
newcommandmyFamRef[2][1]{csname #2#1endcsname}
begin{document}
section{test}
begin{equation}
f(x)=3cdot x
end{equation}
begin{equation}
x=4cdot y EqFamTag{MyFamily}
end{equation}
As an example:
begin{equation}
x=4cdot 2=8EqFamTag{MyFamily}
end{equation}
The equation: myFamRef[2]{MyFamily} is the first example/member of the equation myFamRef{MyFamily}
begin{equation}
x=4cdot y
end{equation}
Another example of :
begin{equation}
x=4cdot 2=8EqFamTag{MyFamily}
end{equation}
The equation: myFamRef[3]{MyFamily} is the second example/member of the equation myFamRef{MyFamily}
Another family of equations is:
begin{equation}
f(x)=3+y EqFamTag{NewFam}
end{equation}
and a member of it is:
begin{equation}
f(6)=9 EqFamTag{NewFam}
end{equation}
end{document}
Output:
add a comment |
up vote
1
down vote
An alternative is the modified answer from here:
documentclass{article}
usepackage{amsmath}
makeatletter
newcommand*ifcounter[1]{%
ifcsname c@#1endcsname%
expandafter@firstoftwo%
else%
expandafter@secondoftwo%
fi%
}%
makeatother
newcommandEqFamTag[2][roman]{%
ifcounter{#2}{%
expandafteraddtocounter{#2}{1}%
expandafteraddtocounter{#2Prev}{1}
xdeftemp{csname #2 Eqendcsname ifnumvalue{#2Prev}>0 space(csname #1endcsname{#2Prev})fi}%
globalexpandafterletcsname #2arabic{#2}endcsnametemp%
tag{temp}%
}{%
globalexpandafternewcounter{#2}%
globalexpandafternewcounter{#2Prev}
expandafteraddtocounter{#2}{1}%
xdeftemp{theequation ifnumvalue{#2Prev}>0 space(csname #1endcsname{#2Prev})fi}%
xdefeqonfamily{theequation}%
globalexpandafterletcsname #2 Eqendcsnameeqonfamily%
globalexpandafterletcsname #2arabic{#2}endcsnametemp%
tag{temp}%
expandafteraddtocounter{equation}{1}
}%
}%
newcommandmyFamRef[2][1]{csname #2#1endcsname}
begin{document}
section{test}
begin{equation}
f(x)=3cdot x
end{equation}
begin{equation}
x=4cdot y EqFamTag{MyFamily}
end{equation}
As an example:
begin{equation}
x=4cdot 2=8EqFamTag{MyFamily}
end{equation}
The equation: myFamRef[2]{MyFamily} is the first example/member of the equation myFamRef{MyFamily}
begin{equation}
x=4cdot y
end{equation}
Another example of :
begin{equation}
x=4cdot 2=8EqFamTag{MyFamily}
end{equation}
The equation: myFamRef[3]{MyFamily} is the second example/member of the equation myFamRef{MyFamily}
Another family of equations is:
begin{equation}
f(x)=3+y EqFamTag{NewFam}
end{equation}
and a member of it is:
begin{equation}
f(6)=9 EqFamTag{NewFam}
end{equation}
end{document}
Output:
add a comment |
up vote
1
down vote
up vote
1
down vote
An alternative is the modified answer from here:
documentclass{article}
usepackage{amsmath}
makeatletter
newcommand*ifcounter[1]{%
ifcsname c@#1endcsname%
expandafter@firstoftwo%
else%
expandafter@secondoftwo%
fi%
}%
makeatother
newcommandEqFamTag[2][roman]{%
ifcounter{#2}{%
expandafteraddtocounter{#2}{1}%
expandafteraddtocounter{#2Prev}{1}
xdeftemp{csname #2 Eqendcsname ifnumvalue{#2Prev}>0 space(csname #1endcsname{#2Prev})fi}%
globalexpandafterletcsname #2arabic{#2}endcsnametemp%
tag{temp}%
}{%
globalexpandafternewcounter{#2}%
globalexpandafternewcounter{#2Prev}
expandafteraddtocounter{#2}{1}%
xdeftemp{theequation ifnumvalue{#2Prev}>0 space(csname #1endcsname{#2Prev})fi}%
xdefeqonfamily{theequation}%
globalexpandafterletcsname #2 Eqendcsnameeqonfamily%
globalexpandafterletcsname #2arabic{#2}endcsnametemp%
tag{temp}%
expandafteraddtocounter{equation}{1}
}%
}%
newcommandmyFamRef[2][1]{csname #2#1endcsname}
begin{document}
section{test}
begin{equation}
f(x)=3cdot x
end{equation}
begin{equation}
x=4cdot y EqFamTag{MyFamily}
end{equation}
As an example:
begin{equation}
x=4cdot 2=8EqFamTag{MyFamily}
end{equation}
The equation: myFamRef[2]{MyFamily} is the first example/member of the equation myFamRef{MyFamily}
begin{equation}
x=4cdot y
end{equation}
Another example of :
begin{equation}
x=4cdot 2=8EqFamTag{MyFamily}
end{equation}
The equation: myFamRef[3]{MyFamily} is the second example/member of the equation myFamRef{MyFamily}
Another family of equations is:
begin{equation}
f(x)=3+y EqFamTag{NewFam}
end{equation}
and a member of it is:
begin{equation}
f(6)=9 EqFamTag{NewFam}
end{equation}
end{document}
Output:
An alternative is the modified answer from here:
documentclass{article}
usepackage{amsmath}
makeatletter
newcommand*ifcounter[1]{%
ifcsname c@#1endcsname%
expandafter@firstoftwo%
else%
expandafter@secondoftwo%
fi%
}%
makeatother
newcommandEqFamTag[2][roman]{%
ifcounter{#2}{%
expandafteraddtocounter{#2}{1}%
expandafteraddtocounter{#2Prev}{1}
xdeftemp{csname #2 Eqendcsname ifnumvalue{#2Prev}>0 space(csname #1endcsname{#2Prev})fi}%
globalexpandafterletcsname #2arabic{#2}endcsnametemp%
tag{temp}%
}{%
globalexpandafternewcounter{#2}%
globalexpandafternewcounter{#2Prev}
expandafteraddtocounter{#2}{1}%
xdeftemp{theequation ifnumvalue{#2Prev}>0 space(csname #1endcsname{#2Prev})fi}%
xdefeqonfamily{theequation}%
globalexpandafterletcsname #2 Eqendcsnameeqonfamily%
globalexpandafterletcsname #2arabic{#2}endcsnametemp%
tag{temp}%
expandafteraddtocounter{equation}{1}
}%
}%
newcommandmyFamRef[2][1]{csname #2#1endcsname}
begin{document}
section{test}
begin{equation}
f(x)=3cdot x
end{equation}
begin{equation}
x=4cdot y EqFamTag{MyFamily}
end{equation}
As an example:
begin{equation}
x=4cdot 2=8EqFamTag{MyFamily}
end{equation}
The equation: myFamRef[2]{MyFamily} is the first example/member of the equation myFamRef{MyFamily}
begin{equation}
x=4cdot y
end{equation}
Another example of :
begin{equation}
x=4cdot 2=8EqFamTag{MyFamily}
end{equation}
The equation: myFamRef[3]{MyFamily} is the second example/member of the equation myFamRef{MyFamily}
Another family of equations is:
begin{equation}
f(x)=3+y EqFamTag{NewFam}
end{equation}
and a member of it is:
begin{equation}
f(6)=9 EqFamTag{NewFam}
end{equation}
end{document}
Output:
answered Nov 12 at 22:03
koleygr
10.8k1837
10.8k1837
add a comment |
add a comment |
up vote
0
down vote
It is very easy to have a first (main) subequation numbered as an ordinary equation, the subequations standard numbering starting only at the second subequation:
documentclass{article}
usepackage{amsmath}
setcounter{equation}{4}
begin{document}
Some text . . . . . .
begin{subequations}
addtocounter{equation}{-1}
begin{gather}
a+b label{main} \
3+2 label{ex-1} \
5label{ex-2}
end{gather}
end{subequations}.
. . . . . .Some more text . . . . . .
begin{equation}
c + d
end{equation}
eqref{ex-1} and eqref{ex-2} illustrate eqref{main}.
end{document}
add a comment |
up vote
0
down vote
It is very easy to have a first (main) subequation numbered as an ordinary equation, the subequations standard numbering starting only at the second subequation:
documentclass{article}
usepackage{amsmath}
setcounter{equation}{4}
begin{document}
Some text . . . . . .
begin{subequations}
addtocounter{equation}{-1}
begin{gather}
a+b label{main} \
3+2 label{ex-1} \
5label{ex-2}
end{gather}
end{subequations}.
. . . . . .Some more text . . . . . .
begin{equation}
c + d
end{equation}
eqref{ex-1} and eqref{ex-2} illustrate eqref{main}.
end{document}
add a comment |
up vote
0
down vote
up vote
0
down vote
It is very easy to have a first (main) subequation numbered as an ordinary equation, the subequations standard numbering starting only at the second subequation:
documentclass{article}
usepackage{amsmath}
setcounter{equation}{4}
begin{document}
Some text . . . . . .
begin{subequations}
addtocounter{equation}{-1}
begin{gather}
a+b label{main} \
3+2 label{ex-1} \
5label{ex-2}
end{gather}
end{subequations}.
. . . . . .Some more text . . . . . .
begin{equation}
c + d
end{equation}
eqref{ex-1} and eqref{ex-2} illustrate eqref{main}.
end{document}
It is very easy to have a first (main) subequation numbered as an ordinary equation, the subequations standard numbering starting only at the second subequation:
documentclass{article}
usepackage{amsmath}
setcounter{equation}{4}
begin{document}
Some text . . . . . .
begin{subequations}
addtocounter{equation}{-1}
begin{gather}
a+b label{main} \
3+2 label{ex-1} \
5label{ex-2}
end{gather}
end{subequations}.
. . . . . .Some more text . . . . . .
begin{equation}
c + d
end{equation}
eqref{ex-1} and eqref{ex-2} illustrate eqref{main}.
end{document}
answered Nov 12 at 21:22
Bernard
161k767192
161k767192
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459681%2fcustomize-subequation-numbering%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown