Number of figure by chapter
up vote
4
down vote
favorite
I need number of figure by chapter:
I'm using this but sometimes it repeats the numeration
usepackage{chngcntr}
counterwithin{figure}{chapter}
counterwithin{table}{chapter}
example:
chapter1
figure 1.1
figure 1.2
figure 1.3
chapter2
figure 2.1
section 2.1
figure 2.2
figure 2.3
chapter3
figure 3.1
figure 3.2
section 3.1
figure 3.3
example:
documentclass{report}
usepackage{float}
usepackage{chngcntr}
counterwithin{figure}{section}
begin{document}
chapter{}
section{section 1.1}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
section{section 1.2}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
chapter{}
section{section 2.1}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
end{document}
this is the screeshot:

numbering
add a comment |
up vote
4
down vote
favorite
I need number of figure by chapter:
I'm using this but sometimes it repeats the numeration
usepackage{chngcntr}
counterwithin{figure}{chapter}
counterwithin{table}{chapter}
example:
chapter1
figure 1.1
figure 1.2
figure 1.3
chapter2
figure 2.1
section 2.1
figure 2.2
figure 2.3
chapter3
figure 3.1
figure 3.2
section 3.1
figure 3.3
example:
documentclass{report}
usepackage{float}
usepackage{chngcntr}
counterwithin{figure}{section}
begin{document}
chapter{}
section{section 1.1}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
section{section 1.2}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
chapter{}
section{section 2.1}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
end{document}
this is the screeshot:

numbering
3
Please add a minimal working example (MWE) of which replicates your problem.
– CarLaTeX
2 days ago
1
Plus from your example it is not obvious that any counter gets repeated. According to what I see, each figure counter is unique, and so is each section counter.
– marmot
2 days ago
If you want chapters why not use report class? Then all you're expecting will be fixed...
– santimirandarp
2 days ago
@santimirandarp I am new to latex, please help me
– x-rw
2 days ago
@santimirandarp i edited my question, it still does not work
– x-rw
2 days ago
add a comment |
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I need number of figure by chapter:
I'm using this but sometimes it repeats the numeration
usepackage{chngcntr}
counterwithin{figure}{chapter}
counterwithin{table}{chapter}
example:
chapter1
figure 1.1
figure 1.2
figure 1.3
chapter2
figure 2.1
section 2.1
figure 2.2
figure 2.3
chapter3
figure 3.1
figure 3.2
section 3.1
figure 3.3
example:
documentclass{report}
usepackage{float}
usepackage{chngcntr}
counterwithin{figure}{section}
begin{document}
chapter{}
section{section 1.1}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
section{section 1.2}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
chapter{}
section{section 2.1}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
end{document}
this is the screeshot:

numbering
I need number of figure by chapter:
I'm using this but sometimes it repeats the numeration
usepackage{chngcntr}
counterwithin{figure}{chapter}
counterwithin{table}{chapter}
example:
chapter1
figure 1.1
figure 1.2
figure 1.3
chapter2
figure 2.1
section 2.1
figure 2.2
figure 2.3
chapter3
figure 3.1
figure 3.2
section 3.1
figure 3.3
example:
documentclass{report}
usepackage{float}
usepackage{chngcntr}
counterwithin{figure}{section}
begin{document}
chapter{}
section{section 1.1}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
section{section 1.2}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
chapter{}
section{section 2.1}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
end{document}
this is the screeshot:

numbering
numbering
edited 2 days ago
asked 2 days ago
x-rw
25316
25316
3
Please add a minimal working example (MWE) of which replicates your problem.
– CarLaTeX
2 days ago
1
Plus from your example it is not obvious that any counter gets repeated. According to what I see, each figure counter is unique, and so is each section counter.
– marmot
2 days ago
If you want chapters why not use report class? Then all you're expecting will be fixed...
– santimirandarp
2 days ago
@santimirandarp I am new to latex, please help me
– x-rw
2 days ago
@santimirandarp i edited my question, it still does not work
– x-rw
2 days ago
add a comment |
3
Please add a minimal working example (MWE) of which replicates your problem.
– CarLaTeX
2 days ago
1
Plus from your example it is not obvious that any counter gets repeated. According to what I see, each figure counter is unique, and so is each section counter.
– marmot
2 days ago
If you want chapters why not use report class? Then all you're expecting will be fixed...
– santimirandarp
2 days ago
@santimirandarp I am new to latex, please help me
– x-rw
2 days ago
@santimirandarp i edited my question, it still does not work
– x-rw
2 days ago
3
3
Please add a minimal working example (MWE) of which replicates your problem.
– CarLaTeX
2 days ago
Please add a minimal working example (MWE) of which replicates your problem.
– CarLaTeX
2 days ago
1
1
Plus from your example it is not obvious that any counter gets repeated. According to what I see, each figure counter is unique, and so is each section counter.
– marmot
2 days ago
Plus from your example it is not obvious that any counter gets repeated. According to what I see, each figure counter is unique, and so is each section counter.
– marmot
2 days ago
If you want chapters why not use report class? Then all you're expecting will be fixed...
– santimirandarp
2 days ago
If you want chapters why not use report class? Then all you're expecting will be fixed...
– santimirandarp
2 days ago
@santimirandarp I am new to latex, please help me
– x-rw
2 days ago
@santimirandarp I am new to latex, please help me
– x-rw
2 days ago
@santimirandarp i edited my question, it still does not work
– x-rw
2 days ago
@santimirandarp i edited my question, it still does not work
– x-rw
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
- Use
reportclass when chapters are needed. - Remove some packages (not needed to get the output).
Do not include numbers in section and chapters (those are created automatically by latex)
documentclass{report}
usepackage{float}
begin{document}
chapter{ } %if you want a name write it as chapter{name}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
section{}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
section{ }
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
end{document}
yes, this result is good, what is the secret?
– x-rw
2 days ago
Glad to know it. @x-rw removeusepackage{chngcntr}counterwithin{figure}{section}and modify the argument ofsection{}. Also, use reportclass when you need chapters.
– santimirandarp
2 days ago
1
muchas gracias, su respuesta me ayudo a aprender algo nuevo (la clase report), i am user with language native spanish
– x-rw
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
- Use
reportclass when chapters are needed. - Remove some packages (not needed to get the output).
Do not include numbers in section and chapters (those are created automatically by latex)
documentclass{report}
usepackage{float}
begin{document}
chapter{ } %if you want a name write it as chapter{name}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
section{}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
section{ }
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
end{document}
yes, this result is good, what is the secret?
– x-rw
2 days ago
Glad to know it. @x-rw removeusepackage{chngcntr}counterwithin{figure}{section}and modify the argument ofsection{}. Also, use reportclass when you need chapters.
– santimirandarp
2 days ago
1
muchas gracias, su respuesta me ayudo a aprender algo nuevo (la clase report), i am user with language native spanish
– x-rw
2 days ago
add a comment |
up vote
3
down vote
accepted
- Use
reportclass when chapters are needed. - Remove some packages (not needed to get the output).
Do not include numbers in section and chapters (those are created automatically by latex)
documentclass{report}
usepackage{float}
begin{document}
chapter{ } %if you want a name write it as chapter{name}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
section{}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
section{ }
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
end{document}
yes, this result is good, what is the secret?
– x-rw
2 days ago
Glad to know it. @x-rw removeusepackage{chngcntr}counterwithin{figure}{section}and modify the argument ofsection{}. Also, use reportclass when you need chapters.
– santimirandarp
2 days ago
1
muchas gracias, su respuesta me ayudo a aprender algo nuevo (la clase report), i am user with language native spanish
– x-rw
2 days ago
add a comment |
up vote
3
down vote
accepted
up vote
3
down vote
accepted
- Use
reportclass when chapters are needed. - Remove some packages (not needed to get the output).
Do not include numbers in section and chapters (those are created automatically by latex)
documentclass{report}
usepackage{float}
begin{document}
chapter{ } %if you want a name write it as chapter{name}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
section{}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
section{ }
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
end{document}
- Use
reportclass when chapters are needed. - Remove some packages (not needed to get the output).
Do not include numbers in section and chapters (those are created automatically by latex)
documentclass{report}
usepackage{float}
begin{document}
chapter{ } %if you want a name write it as chapter{name}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
section{}
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
section{ }
begin{figure}[H]
centering
rule{1cm}{1cm}% placeholder for graphic
caption{A figure}
end{figure}
end{document}
edited 2 days ago
answered 2 days ago
santimirandarp
1,4203722
1,4203722
yes, this result is good, what is the secret?
– x-rw
2 days ago
Glad to know it. @x-rw removeusepackage{chngcntr}counterwithin{figure}{section}and modify the argument ofsection{}. Also, use reportclass when you need chapters.
– santimirandarp
2 days ago
1
muchas gracias, su respuesta me ayudo a aprender algo nuevo (la clase report), i am user with language native spanish
– x-rw
2 days ago
add a comment |
yes, this result is good, what is the secret?
– x-rw
2 days ago
Glad to know it. @x-rw removeusepackage{chngcntr}counterwithin{figure}{section}and modify the argument ofsection{}. Also, use reportclass when you need chapters.
– santimirandarp
2 days ago
1
muchas gracias, su respuesta me ayudo a aprender algo nuevo (la clase report), i am user with language native spanish
– x-rw
2 days ago
yes, this result is good, what is the secret?
– x-rw
2 days ago
yes, this result is good, what is the secret?
– x-rw
2 days ago
Glad to know it. @x-rw remove
usepackage{chngcntr} counterwithin{figure}{section} and modify the argument of section{}. Also, use reportclass when you need chapters.– santimirandarp
2 days ago
Glad to know it. @x-rw remove
usepackage{chngcntr} counterwithin{figure}{section} and modify the argument of section{}. Also, use reportclass when you need chapters.– santimirandarp
2 days ago
1
1
muchas gracias, su respuesta me ayudo a aprender algo nuevo (la clase report), i am user with language native spanish
– x-rw
2 days ago
muchas gracias, su respuesta me ayudo a aprender algo nuevo (la clase report), i am user with language native spanish
– x-rw
2 days ago
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%2f460406%2fnumber-of-figure-by-chapter%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
3
Please add a minimal working example (MWE) of which replicates your problem.
– CarLaTeX
2 days ago
1
Plus from your example it is not obvious that any counter gets repeated. According to what I see, each figure counter is unique, and so is each section counter.
– marmot
2 days ago
If you want chapters why not use report class? Then all you're expecting will be fixed...
– santimirandarp
2 days ago
@santimirandarp I am new to latex, please help me
– x-rw
2 days ago
@santimirandarp i edited my question, it still does not work
– x-rw
2 days ago