How to enumerate figures in sync with another counter? Announcing the arrival of Valued...
Using et al. for a last / senior author rather than for a first author
List *all* the tuples!
How to react to hostile behavior from a senior developer?
When do you get frequent flier miles - when you buy, or when you fly?
Bete Noir -- no dairy
List of Python versions
Can an alien society believe that their star system is the universe?
How can I make names more distinctive without making them longer?
What does "fit" mean in this sentence?
Resolving to minmaj7
Why do we bend a book to keep it straight?
Why light coming from distant stars is not discreet?
What does an IRS interview request entail when called in to verify expenses for a sole proprietor small business?
What does this icon in iOS Stardew Valley mean?
Why aren't air breathing engines used as small first stages
Do I really need recursive chmod to restrict access to a folder?
Why am I getting the error "non-boolean type specified in a context where a condition is expected" for this request?
Apollo command module space walk?
What exactly is a "Meth" in Altered Carbon?
What is the role of the transistor and diode in a soft start circuit?
Is it fair for a professor to grade us on the possession of past papers?
What to do with chalk when deepwater soloing?
What's the meaning of 間時肆拾貳 at a car parking sign
What's the purpose of writing one's academic biography in the third person?
How to enumerate figures in sync with another counter?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Numbering figuresHow to make equations, figures and theorems use the same numbering schemeFigures on report counter page (without styling)Spacing issue in new environment from a theoremAdvanced hierarchical counting for theoremsHow can I set customized separators for theorem counters?Reset footnote counter by section with footmiscFigure/Tables/Equations… countersDifficulty with Subfig: Aligning Figures on CenterlineHow to show also the name of the parent counter with cleveref?How to organize text and figures
I when I create a command for (for example) the examples in my article, I do it in this way:
newtheorem{teo}{Theorem}[section]
newtheorem{ex}[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:
newtheorem{teo}{Theorem}[section]
newtheorem{ex}[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
23 hours ago
Did you see this answer to the query Numbering figures?
– Mico
22 hours ago
add a comment |
I when I create a command for (for example) the examples in my article, I do it in this way:
newtheorem{teo}{Theorem}[section]
newtheorem{ex}[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:
newtheorem{teo}{Theorem}[section]
newtheorem{ex}[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 4 hours ago
Andrew
31.1k34482
31.1k34482
asked 23 hours ago
J.RodriguezJ.Rodriguez
2286
2286
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
23 hours ago
Did you see this answer to the query Numbering figures?
– Mico
22 hours ago
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
23 hours ago
Did you see this answer to the query Numbering figures?
– Mico
22 hours ago
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
23 hours ago
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
23 hours ago
Did you see this answer to the query Numbering figures?
– Mico
22 hours ago
Did you see this answer to the query Numbering figures?
– Mico
22 hours ago
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:
numberwithin{figure}{section}% number figures inside sections
newtheorem{teo}[figure]{Theorem}
newtheorem{ex}[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:
documentclass{amsart}
numberwithin{figure}{section}
newtheorem{teo}[figure]{Theorem}
newtheorem{ex}[figure]{Example}
begin{document}
section{Let the section begin}
begin{teo}The sum of two numbers is a numberlabel{T:one}end{teo}
begin{figure}[h]A figurecaption{Nice one}label{F:one}end{figure}
begin{ex}For example, $1+2=3$.label{E:one}end{ex}
See ref{T:one}, ref{F:one} and ref{E:one}.
end{document}
This answer depends on the use of theamsart
document class. But that's not necessary --article
plusamsthm
gives the same result.
– barbara beeton
7 hours ago
@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@addtoreset{figure}{section}makeatother
with thearticle
document class.
– Andrew
5 hours ago
Ah! Forgot that. Easily fixed --usepackage{amsmath}
. (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
3 hours ago
add a comment |
Here's a solution that employs the xassoccnt package to couple the teo
and figure
counters.
documentclass{report}
usepackage{amsthm}
newtheorem{teo}{Theorem}[section]
newtheorem{ex}[teo]{Example}
usepackage{xassoccnt}
DeclareCoupledCounters[name=figurteo]{figure,teo}
renewcommandthefigure{thesection.arabic{figure}}
% just to allow 4 floats on a page:
setcounter{totalnumber}{4}
setcounter{topnumber}{4}
begin{document}
% just for this example
setcounter{chapter}{2}
setcounter{section}{3}
begin{teo}In the beginning, dots end{teo}
begin{teo}After a while, dotsend{teo}
begin{figure}[ht]caption{Fee}end{figure}
begin{figure}[ht]caption{Fi}end{figure}
begin{figure}[ht]caption{Fo}end{figure}
begin{figure}[ht]caption{Fum}end{figure}
begin{ex}And then, dotsend{ex}
begin{ex}Finally, dotsend{ex}
end{document}
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/3.0/"u003ecc by-sa 3.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:
numberwithin{figure}{section}% number figures inside sections
newtheorem{teo}[figure]{Theorem}
newtheorem{ex}[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:
documentclass{amsart}
numberwithin{figure}{section}
newtheorem{teo}[figure]{Theorem}
newtheorem{ex}[figure]{Example}
begin{document}
section{Let the section begin}
begin{teo}The sum of two numbers is a numberlabel{T:one}end{teo}
begin{figure}[h]A figurecaption{Nice one}label{F:one}end{figure}
begin{ex}For example, $1+2=3$.label{E:one}end{ex}
See ref{T:one}, ref{F:one} and ref{E:one}.
end{document}
This answer depends on the use of theamsart
document class. But that's not necessary --article
plusamsthm
gives the same result.
– barbara beeton
7 hours ago
@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@addtoreset{figure}{section}makeatother
with thearticle
document class.
– Andrew
5 hours ago
Ah! Forgot that. Easily fixed --usepackage{amsmath}
. (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
3 hours ago
add a comment |
You can essentially use the same approach as in your MWE except that you use figure
to number your theorems:
numberwithin{figure}{section}% number figures inside sections
newtheorem{teo}[figure]{Theorem}
newtheorem{ex}[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:
documentclass{amsart}
numberwithin{figure}{section}
newtheorem{teo}[figure]{Theorem}
newtheorem{ex}[figure]{Example}
begin{document}
section{Let the section begin}
begin{teo}The sum of two numbers is a numberlabel{T:one}end{teo}
begin{figure}[h]A figurecaption{Nice one}label{F:one}end{figure}
begin{ex}For example, $1+2=3$.label{E:one}end{ex}
See ref{T:one}, ref{F:one} and ref{E:one}.
end{document}
This answer depends on the use of theamsart
document class. But that's not necessary --article
plusamsthm
gives the same result.
– barbara beeton
7 hours ago
@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@addtoreset{figure}{section}makeatother
with thearticle
document class.
– Andrew
5 hours ago
Ah! Forgot that. Easily fixed --usepackage{amsmath}
. (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
3 hours ago
add a comment |
You can essentially use the same approach as in your MWE except that you use figure
to number your theorems:
numberwithin{figure}{section}% number figures inside sections
newtheorem{teo}[figure]{Theorem}
newtheorem{ex}[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:
documentclass{amsart}
numberwithin{figure}{section}
newtheorem{teo}[figure]{Theorem}
newtheorem{ex}[figure]{Example}
begin{document}
section{Let the section begin}
begin{teo}The sum of two numbers is a numberlabel{T:one}end{teo}
begin{figure}[h]A figurecaption{Nice one}label{F:one}end{figure}
begin{ex}For example, $1+2=3$.label{E:one}end{ex}
See ref{T:one}, ref{F:one} and ref{E:one}.
end{document}
You can essentially use the same approach as in your MWE except that you use figure
to number your theorems:
numberwithin{figure}{section}% number figures inside sections
newtheorem{teo}[figure]{Theorem}
newtheorem{ex}[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:
documentclass{amsart}
numberwithin{figure}{section}
newtheorem{teo}[figure]{Theorem}
newtheorem{ex}[figure]{Example}
begin{document}
section{Let the section begin}
begin{teo}The sum of two numbers is a numberlabel{T:one}end{teo}
begin{figure}[h]A figurecaption{Nice one}label{F:one}end{figure}
begin{ex}For example, $1+2=3$.label{E:one}end{ex}
See ref{T:one}, ref{F:one} and ref{E:one}.
end{document}
edited 22 hours ago
answered 22 hours ago
AndrewAndrew
31.1k34482
31.1k34482
This answer depends on the use of theamsart
document class. But that's not necessary --article
plusamsthm
gives the same result.
– barbara beeton
7 hours ago
@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@addtoreset{figure}{section}makeatother
with thearticle
document class.
– Andrew
5 hours ago
Ah! Forgot that. Easily fixed --usepackage{amsmath}
. (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
3 hours ago
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
7 hours ago
@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@addtoreset{figure}{section}makeatother
with thearticle
document class.
– Andrew
5 hours ago
Ah! Forgot that. Easily fixed --usepackage{amsmath}
. (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
3 hours ago
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
7 hours ago
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
7 hours ago
@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@addtoreset{figure}{section}makeatother
with the article
document class.– Andrew
5 hours ago
@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@addtoreset{figure}{section}makeatother
with the article
document class.– Andrew
5 hours ago
Ah! Forgot that. Easily fixed --
usepackage{amsmath}
. (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
3 hours ago
Ah! Forgot that. Easily fixed --
usepackage{amsmath}
. (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
3 hours ago
add a comment |
Here's a solution that employs the xassoccnt package to couple the teo
and figure
counters.
documentclass{report}
usepackage{amsthm}
newtheorem{teo}{Theorem}[section]
newtheorem{ex}[teo]{Example}
usepackage{xassoccnt}
DeclareCoupledCounters[name=figurteo]{figure,teo}
renewcommandthefigure{thesection.arabic{figure}}
% just to allow 4 floats on a page:
setcounter{totalnumber}{4}
setcounter{topnumber}{4}
begin{document}
% just for this example
setcounter{chapter}{2}
setcounter{section}{3}
begin{teo}In the beginning, dots end{teo}
begin{teo}After a while, dotsend{teo}
begin{figure}[ht]caption{Fee}end{figure}
begin{figure}[ht]caption{Fi}end{figure}
begin{figure}[ht]caption{Fo}end{figure}
begin{figure}[ht]caption{Fum}end{figure}
begin{ex}And then, dotsend{ex}
begin{ex}Finally, dotsend{ex}
end{document}
add a comment |
Here's a solution that employs the xassoccnt package to couple the teo
and figure
counters.
documentclass{report}
usepackage{amsthm}
newtheorem{teo}{Theorem}[section]
newtheorem{ex}[teo]{Example}
usepackage{xassoccnt}
DeclareCoupledCounters[name=figurteo]{figure,teo}
renewcommandthefigure{thesection.arabic{figure}}
% just to allow 4 floats on a page:
setcounter{totalnumber}{4}
setcounter{topnumber}{4}
begin{document}
% just for this example
setcounter{chapter}{2}
setcounter{section}{3}
begin{teo}In the beginning, dots end{teo}
begin{teo}After a while, dotsend{teo}
begin{figure}[ht]caption{Fee}end{figure}
begin{figure}[ht]caption{Fi}end{figure}
begin{figure}[ht]caption{Fo}end{figure}
begin{figure}[ht]caption{Fum}end{figure}
begin{ex}And then, dotsend{ex}
begin{ex}Finally, dotsend{ex}
end{document}
add a comment |
Here's a solution that employs the xassoccnt package to couple the teo
and figure
counters.
documentclass{report}
usepackage{amsthm}
newtheorem{teo}{Theorem}[section]
newtheorem{ex}[teo]{Example}
usepackage{xassoccnt}
DeclareCoupledCounters[name=figurteo]{figure,teo}
renewcommandthefigure{thesection.arabic{figure}}
% just to allow 4 floats on a page:
setcounter{totalnumber}{4}
setcounter{topnumber}{4}
begin{document}
% just for this example
setcounter{chapter}{2}
setcounter{section}{3}
begin{teo}In the beginning, dots end{teo}
begin{teo}After a while, dotsend{teo}
begin{figure}[ht]caption{Fee}end{figure}
begin{figure}[ht]caption{Fi}end{figure}
begin{figure}[ht]caption{Fo}end{figure}
begin{figure}[ht]caption{Fum}end{figure}
begin{ex}And then, dotsend{ex}
begin{ex}Finally, dotsend{ex}
end{document}
Here's a solution that employs the xassoccnt package to couple the teo
and figure
counters.
documentclass{report}
usepackage{amsthm}
newtheorem{teo}{Theorem}[section]
newtheorem{ex}[teo]{Example}
usepackage{xassoccnt}
DeclareCoupledCounters[name=figurteo]{figure,teo}
renewcommandthefigure{thesection.arabic{figure}}
% just to allow 4 floats on a page:
setcounter{totalnumber}{4}
setcounter{topnumber}{4}
begin{document}
% just for this example
setcounter{chapter}{2}
setcounter{section}{3}
begin{teo}In the beginning, dots end{teo}
begin{teo}After a while, dotsend{teo}
begin{figure}[ht]caption{Fee}end{figure}
begin{figure}[ht]caption{Fi}end{figure}
begin{figure}[ht]caption{Fo}end{figure}
begin{figure}[ht]caption{Fum}end{figure}
begin{ex}And then, dotsend{ex}
begin{ex}Finally, dotsend{ex}
end{document}
answered 22 hours ago
MicoMico
287k32392781
287k32392781
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
23 hours ago
Did you see this answer to the query Numbering figures?
– Mico
22 hours ago