How to enumerate figures in sync with another counter?Numbering figuresHow to make equations, figures and theorems use the same numbering schemeSpacing issue in new environment from a theoremAdvanced hierarchical counting for theoremsHow can I set customized separators for theorem counters?Figure/Tables/Equations… countersDifficulty with Subfig: Aligning Figures on CenterlineHow to show also the name of the parent counter with cleveref?Let equation numbers and enumerate use the same counter
Digital Bananas
What action is recommended if your accommodation refuses to let you leave without paying additional fees?
Does the DOJ's declining to investigate the Trump-Zelensky call ruin the basis for impeachment?
How is погода (weather) a count noun?
What is the Japanese equivalent of 'you're in my heart'?
Is there a pattern for handling conflicting function parameters?
Why is there such a singular place for bird watching?
Booting Ubuntu from USB drive on MSI motherboard -- EVERYTHING fails
Should I be an author on another PhD student's paper if I went to their meetings and gave advice?
Sending mail to the Professor for PhD, after seeing his tweet
How to protect bash function from being overridden?
How do we know Nemesis is not a black hole (or neutron star)?
If I travelled back in time to invest in X company to make a fortune, roughly what is the probability that it would fail?
Anonymous reviewer disclosed his identity. Should I thank him by name?
Did the Soviet army intentionally send troops (e.g. penal battalions) running over minefields?
Why not add cuspidal curves in the moduli space of stable curves?
Where does the image of a data connector as a sharp metal spike originate from?
Is it appropriate to "shop" through high-impact journals before sending the paper to more specialized journals?
Is "Ram married his daughter" ambiguous?
Why do personal finance apps focus on outgoings rather than income
Did Joe Biden "stop a prosecution" into his son in Ukraine? And did he brag about stopping the prosecution?
What makes a character irredeemable?
Why Vegetable Stock is bitter, but Chicken Stock not?
underline alignment
How to enumerate figures in sync with another counter?
Numbering figuresHow to make equations, figures and theorems use the same numbering schemeSpacing issue in new environment from a theoremAdvanced hierarchical counting for theoremsHow can I set customized separators for theorem counters?Figure/Tables/Equations… countersDifficulty with Subfig: Aligning Figures on CenterlineHow to show also the name of the parent counter with cleveref?Let equation numbers and enumerate use the same counter
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
I when I create a command for (for example) the examples in my article, I do it in this way:
newtheoremteoTheorem[section]
newtheoremex[teo]Example
So the enumeration is consecuent to what I have done with the theorems and other things, but the figures do their own enumeration, how can I change that in the same way of the examples? Thanks
floats counters
add a comment
|
I when I create a command for (for example) the examples in my article, I do it in this way:
newtheoremteoTheorem[section]
newtheoremex[teo]Example
So the enumeration is consecuent to what I have done with the theorems and other things, but the figures do their own enumeration, how can I change that in the same way of the examples? Thanks
floats counters
Exactly, for example, if there is a figure between theorem 2.3, and example 2.4, I want them to be, theorem 2.3, figure 2.4, and example 2.5
– J.Rodriguez
Apr 16 at 3:31
Did you see this answer to the query Numbering figures?
– Mico
Apr 16 at 4:30
add a comment
|
I when I create a command for (for example) the examples in my article, I do it in this way:
newtheoremteoTheorem[section]
newtheoremex[teo]Example
So the enumeration is consecuent to what I have done with the theorems and other things, but the figures do their own enumeration, how can I change that in the same way of the examples? Thanks
floats counters
I when I create a command for (for example) the examples in my article, I do it in this way:
newtheoremteoTheorem[section]
newtheoremex[teo]Example
So the enumeration is consecuent to what I have done with the theorems and other things, but the figures do their own enumeration, how can I change that in the same way of the examples? Thanks
floats counters
floats counters
edited Apr 16 at 22:47
Andrew
34.3k3 gold badges50 silver badges88 bronze badges
34.3k3 gold badges50 silver badges88 bronze badges
asked Apr 16 at 3:15
J.RodriguezJ.Rodriguez
3939 bronze badges
3939 bronze badges
Exactly, for example, if there is a figure between theorem 2.3, and example 2.4, I want them to be, theorem 2.3, figure 2.4, and example 2.5
– J.Rodriguez
Apr 16 at 3:31
Did you see this answer to the query Numbering figures?
– Mico
Apr 16 at 4:30
add a comment
|
Exactly, for example, if there is a figure between theorem 2.3, and example 2.4, I want them to be, theorem 2.3, figure 2.4, and example 2.5
– J.Rodriguez
Apr 16 at 3:31
Did you see this answer to the query Numbering figures?
– Mico
Apr 16 at 4:30
Exactly, for example, if there is a figure between theorem 2.3, and example 2.4, I want them to be, theorem 2.3, figure 2.4, and example 2.5
– J.Rodriguez
Apr 16 at 3:31
Exactly, for example, if there is a figure between theorem 2.3, and example 2.4, I want them to be, theorem 2.3, figure 2.4, and example 2.5
– J.Rodriguez
Apr 16 at 3:31
Did you see this answer to the query Numbering figures?
– Mico
Apr 16 at 4:30
Did you see this answer to the query Numbering figures?
– Mico
Apr 16 at 4:30
add a comment
|
2 Answers
2
active
oldest
votes
You can essentially use the same approach as in your MWE except that you use figure
to number your theorems:
numberwithinfiguresection% number figures inside sections
newtheoremteo[figure]Theorem
newtheoremex[figure]Example
The numberwithin
command, which comes from amsmath
, numbers the figures in tandem with the sections. Using this approach you can get the output
using the code:
documentclassamsart
numberwithinfiguresection
newtheoremteo[figure]Theorem
newtheoremex[figure]Example
begindocument
sectionLet the section begin
beginteoThe sum of two numbers is a numberlabelT:oneendteo
beginfigure[h]A figurecaptionNice onelabelF:oneendfigure
beginexFor example, $1+2=3$.labelE:oneendex
See refT:one, refF:one and refE:one.
enddocument
This answer depends on the use of theamsart
document class. But that's not necessary --article
plusamsthm
gives the same result.
– barbara beeton
Apr 16 at 19:10
@barbarabeeton As the OP didn't provide a MWE with a document class I took the liberty of using my preferred article class, which isamsart
. Usingarticle
andamsthm
does not work as this gives an "Undefined control sequence" error fornumberwithin
. Of course, you could usemakeatletter@addtoresetfiguresectionmakeatother
with thearticle
document class.
– Andrew
Apr 16 at 21:40
Ah! Forgot that. Easily fixed --usepackageamsmath
. (Rash assumption -- if one is usingamsthm
, one is probably already usingamsmath
. Nice to hear thatamsart
is your favorite, but not everyone has the same preferences.)
– barbara beeton
Apr 16 at 23:21
add a comment
|
Here's a solution that employs the xassoccnt package to couple the teo
and figure
counters.
documentclassreport
usepackageamsthm
newtheoremteoTheorem[section]
newtheoremex[teo]Example
usepackagexassoccnt
DeclareCoupledCounters[name=figurteo]figure,teo
renewcommandthefigurethesection.arabicfigure
% just to allow 4 floats on a page:
setcountertotalnumber4
setcountertopnumber4
begindocument
% just for this example
setcounterchapter2
setcountersection3
beginteoIn the beginning, dots endteo
beginteoAfter a while, dotsendteo
beginfigure[ht]captionFeeendfigure
beginfigure[ht]captionFiendfigure
beginfigure[ht]captionFoendfigure
beginfigure[ht]captionFumendfigure
beginexAnd then, dotsendex
beginexFinally, dotsendex
enddocument
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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%2f485068%2fhow-to-enumerate-figures-in-sync-with-another-counter%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can essentially use the same approach as in your MWE except that you use figure
to number your theorems:
numberwithinfiguresection% number figures inside sections
newtheoremteo[figure]Theorem
newtheoremex[figure]Example
The numberwithin
command, which comes from amsmath
, numbers the figures in tandem with the sections. Using this approach you can get the output
using the code:
documentclassamsart
numberwithinfiguresection
newtheoremteo[figure]Theorem
newtheoremex[figure]Example
begindocument
sectionLet the section begin
beginteoThe sum of two numbers is a numberlabelT:oneendteo
beginfigure[h]A figurecaptionNice onelabelF:oneendfigure
beginexFor example, $1+2=3$.labelE:oneendex
See refT:one, refF:one and refE:one.
enddocument
This answer depends on the use of theamsart
document class. But that's not necessary --article
plusamsthm
gives the same result.
– barbara beeton
Apr 16 at 19:10
@barbarabeeton As the OP didn't provide a MWE with a document class I took the liberty of using my preferred article class, which isamsart
. Usingarticle
andamsthm
does not work as this gives an "Undefined control sequence" error fornumberwithin
. Of course, you could usemakeatletter@addtoresetfiguresectionmakeatother
with thearticle
document class.
– Andrew
Apr 16 at 21:40
Ah! Forgot that. Easily fixed --usepackageamsmath
. (Rash assumption -- if one is usingamsthm
, one is probably already usingamsmath
. Nice to hear thatamsart
is your favorite, but not everyone has the same preferences.)
– barbara beeton
Apr 16 at 23:21
add a comment
|
You can essentially use the same approach as in your MWE except that you use figure
to number your theorems:
numberwithinfiguresection% number figures inside sections
newtheoremteo[figure]Theorem
newtheoremex[figure]Example
The numberwithin
command, which comes from amsmath
, numbers the figures in tandem with the sections. Using this approach you can get the output
using the code:
documentclassamsart
numberwithinfiguresection
newtheoremteo[figure]Theorem
newtheoremex[figure]Example
begindocument
sectionLet the section begin
beginteoThe sum of two numbers is a numberlabelT:oneendteo
beginfigure[h]A figurecaptionNice onelabelF:oneendfigure
beginexFor example, $1+2=3$.labelE:oneendex
See refT:one, refF:one and refE:one.
enddocument
This answer depends on the use of theamsart
document class. But that's not necessary --article
plusamsthm
gives the same result.
– barbara beeton
Apr 16 at 19:10
@barbarabeeton As the OP didn't provide a MWE with a document class I took the liberty of using my preferred article class, which isamsart
. Usingarticle
andamsthm
does not work as this gives an "Undefined control sequence" error fornumberwithin
. Of course, you could usemakeatletter@addtoresetfiguresectionmakeatother
with thearticle
document class.
– Andrew
Apr 16 at 21:40
Ah! Forgot that. Easily fixed --usepackageamsmath
. (Rash assumption -- if one is usingamsthm
, one is probably already usingamsmath
. Nice to hear thatamsart
is your favorite, but not everyone has the same preferences.)
– barbara beeton
Apr 16 at 23:21
add a comment
|
You can essentially use the same approach as in your MWE except that you use figure
to number your theorems:
numberwithinfiguresection% number figures inside sections
newtheoremteo[figure]Theorem
newtheoremex[figure]Example
The numberwithin
command, which comes from amsmath
, numbers the figures in tandem with the sections. Using this approach you can get the output
using the code:
documentclassamsart
numberwithinfiguresection
newtheoremteo[figure]Theorem
newtheoremex[figure]Example
begindocument
sectionLet the section begin
beginteoThe sum of two numbers is a numberlabelT:oneendteo
beginfigure[h]A figurecaptionNice onelabelF:oneendfigure
beginexFor example, $1+2=3$.labelE:oneendex
See refT:one, refF:one and refE:one.
enddocument
You can essentially use the same approach as in your MWE except that you use figure
to number your theorems:
numberwithinfiguresection% number figures inside sections
newtheoremteo[figure]Theorem
newtheoremex[figure]Example
The numberwithin
command, which comes from amsmath
, numbers the figures in tandem with the sections. Using this approach you can get the output
using the code:
documentclassamsart
numberwithinfiguresection
newtheoremteo[figure]Theorem
newtheoremex[figure]Example
begindocument
sectionLet the section begin
beginteoThe sum of two numbers is a numberlabelT:oneendteo
beginfigure[h]A figurecaptionNice onelabelF:oneendfigure
beginexFor example, $1+2=3$.labelE:oneendex
See refT:one, refF:one and refE:one.
enddocument
edited Apr 16 at 4:45
answered Apr 16 at 4:38
AndrewAndrew
34.3k3 gold badges50 silver badges88 bronze badges
34.3k3 gold badges50 silver badges88 bronze badges
This answer depends on the use of theamsart
document class. But that's not necessary --article
plusamsthm
gives the same result.
– barbara beeton
Apr 16 at 19:10
@barbarabeeton As the OP didn't provide a MWE with a document class I took the liberty of using my preferred article class, which isamsart
. Usingarticle
andamsthm
does not work as this gives an "Undefined control sequence" error fornumberwithin
. Of course, you could usemakeatletter@addtoresetfiguresectionmakeatother
with thearticle
document class.
– Andrew
Apr 16 at 21:40
Ah! Forgot that. Easily fixed --usepackageamsmath
. (Rash assumption -- if one is usingamsthm
, one is probably already usingamsmath
. Nice to hear thatamsart
is your favorite, but not everyone has the same preferences.)
– barbara beeton
Apr 16 at 23:21
add a comment
|
This answer depends on the use of theamsart
document class. But that's not necessary --article
plusamsthm
gives the same result.
– barbara beeton
Apr 16 at 19:10
@barbarabeeton As the OP didn't provide a MWE with a document class I took the liberty of using my preferred article class, which isamsart
. Usingarticle
andamsthm
does not work as this gives an "Undefined control sequence" error fornumberwithin
. Of course, you could usemakeatletter@addtoresetfiguresectionmakeatother
with thearticle
document class.
– Andrew
Apr 16 at 21:40
Ah! Forgot that. Easily fixed --usepackageamsmath
. (Rash assumption -- if one is usingamsthm
, one is probably already usingamsmath
. Nice to hear thatamsart
is your favorite, but not everyone has the same preferences.)
– barbara beeton
Apr 16 at 23:21
This answer depends on the use of the
amsart
document class. But that's not necessary -- article
plus amsthm
gives the same result.– barbara beeton
Apr 16 at 19:10
This answer depends on the use of the
amsart
document class. But that's not necessary -- article
plus amsthm
gives the same result.– barbara beeton
Apr 16 at 19:10
@barbarabeeton As the OP didn't provide a MWE with a document class I took the liberty of using my preferred article class, which is
amsart
. Using article
and amsthm
does not work as this gives an "Undefined control sequence" error for numberwithin
. Of course, you could use makeatletter@addtoresetfiguresectionmakeatother
with the article
document class.– Andrew
Apr 16 at 21:40
@barbarabeeton As the OP didn't provide a MWE with a document class I took the liberty of using my preferred article class, which is
amsart
. Using article
and amsthm
does not work as this gives an "Undefined control sequence" error for numberwithin
. Of course, you could use makeatletter@addtoresetfiguresectionmakeatother
with the article
document class.– Andrew
Apr 16 at 21:40
Ah! Forgot that. Easily fixed --
usepackageamsmath
. (Rash assumption -- if one is using amsthm
, one is probably already using amsmath
. Nice to hear that amsart
is your favorite, but not everyone has the same preferences.)– barbara beeton
Apr 16 at 23:21
Ah! Forgot that. Easily fixed --
usepackageamsmath
. (Rash assumption -- if one is using amsthm
, one is probably already using amsmath
. Nice to hear that amsart
is your favorite, but not everyone has the same preferences.)– barbara beeton
Apr 16 at 23:21
add a comment
|
Here's a solution that employs the xassoccnt package to couple the teo
and figure
counters.
documentclassreport
usepackageamsthm
newtheoremteoTheorem[section]
newtheoremex[teo]Example
usepackagexassoccnt
DeclareCoupledCounters[name=figurteo]figure,teo
renewcommandthefigurethesection.arabicfigure
% just to allow 4 floats on a page:
setcountertotalnumber4
setcountertopnumber4
begindocument
% just for this example
setcounterchapter2
setcountersection3
beginteoIn the beginning, dots endteo
beginteoAfter a while, dotsendteo
beginfigure[ht]captionFeeendfigure
beginfigure[ht]captionFiendfigure
beginfigure[ht]captionFoendfigure
beginfigure[ht]captionFumendfigure
beginexAnd then, dotsendex
beginexFinally, dotsendex
enddocument
add a comment
|
Here's a solution that employs the xassoccnt package to couple the teo
and figure
counters.
documentclassreport
usepackageamsthm
newtheoremteoTheorem[section]
newtheoremex[teo]Example
usepackagexassoccnt
DeclareCoupledCounters[name=figurteo]figure,teo
renewcommandthefigurethesection.arabicfigure
% just to allow 4 floats on a page:
setcountertotalnumber4
setcountertopnumber4
begindocument
% just for this example
setcounterchapter2
setcountersection3
beginteoIn the beginning, dots endteo
beginteoAfter a while, dotsendteo
beginfigure[ht]captionFeeendfigure
beginfigure[ht]captionFiendfigure
beginfigure[ht]captionFoendfigure
beginfigure[ht]captionFumendfigure
beginexAnd then, dotsendex
beginexFinally, dotsendex
enddocument
add a comment
|
Here's a solution that employs the xassoccnt package to couple the teo
and figure
counters.
documentclassreport
usepackageamsthm
newtheoremteoTheorem[section]
newtheoremex[teo]Example
usepackagexassoccnt
DeclareCoupledCounters[name=figurteo]figure,teo
renewcommandthefigurethesection.arabicfigure
% just to allow 4 floats on a page:
setcountertotalnumber4
setcountertopnumber4
begindocument
% just for this example
setcounterchapter2
setcountersection3
beginteoIn the beginning, dots endteo
beginteoAfter a while, dotsendteo
beginfigure[ht]captionFeeendfigure
beginfigure[ht]captionFiendfigure
beginfigure[ht]captionFoendfigure
beginfigure[ht]captionFumendfigure
beginexAnd then, dotsendex
beginexFinally, dotsendex
enddocument
Here's a solution that employs the xassoccnt package to couple the teo
and figure
counters.
documentclassreport
usepackageamsthm
newtheoremteoTheorem[section]
newtheoremex[teo]Example
usepackagexassoccnt
DeclareCoupledCounters[name=figurteo]figure,teo
renewcommandthefigurethesection.arabicfigure
% just to allow 4 floats on a page:
setcountertotalnumber4
setcountertopnumber4
begindocument
% just for this example
setcounterchapter2
setcountersection3
beginteoIn the beginning, dots endteo
beginteoAfter a while, dotsendteo
beginfigure[ht]captionFeeendfigure
beginfigure[ht]captionFiendfigure
beginfigure[ht]captionFoendfigure
beginfigure[ht]captionFumendfigure
beginexAnd then, dotsendex
beginexFinally, dotsendex
enddocument
answered Apr 16 at 4:48
MicoMico
306k33 gold badges422 silver badges835 bronze badges
306k33 gold badges422 silver badges835 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2f485068%2fhow-to-enumerate-figures-in-sync-with-another-counter%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
Exactly, for example, if there is a figure between theorem 2.3, and example 2.4, I want them to be, theorem 2.3, figure 2.4, and example 2.5
– J.Rodriguez
Apr 16 at 3:31
Did you see this answer to the query Numbering figures?
– Mico
Apr 16 at 4:30