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:
enter image description here










share|improve this question




















  • 3




    Please add a minimal working example (MWE) of which replicates your problem.
    – CarLaTeX
    Nov 17 at 5:32






  • 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
    Nov 17 at 5:35










  • If you want chapters why not use report class? Then all you're expecting will be fixed...
    – santimirandarp
    Nov 17 at 5:48












  • @santimirandarp I am new to latex, please help me
    – x-rw
    Nov 17 at 5:49










  • @santimirandarp i edited my question, it still does not work
    – x-rw
    Nov 17 at 6:00















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:
enter image description here










share|improve this question




















  • 3




    Please add a minimal working example (MWE) of which replicates your problem.
    – CarLaTeX
    Nov 17 at 5:32






  • 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
    Nov 17 at 5:35










  • If you want chapters why not use report class? Then all you're expecting will be fixed...
    – santimirandarp
    Nov 17 at 5:48












  • @santimirandarp I am new to latex, please help me
    – x-rw
    Nov 17 at 5:49










  • @santimirandarp i edited my question, it still does not work
    – x-rw
    Nov 17 at 6:00













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:
enter image description here










share|improve this question















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:
enter image description here







numbering






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 17 at 5:59

























asked Nov 17 at 5:28









x-rw

28717




28717








  • 3




    Please add a minimal working example (MWE) of which replicates your problem.
    – CarLaTeX
    Nov 17 at 5:32






  • 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
    Nov 17 at 5:35










  • If you want chapters why not use report class? Then all you're expecting will be fixed...
    – santimirandarp
    Nov 17 at 5:48












  • @santimirandarp I am new to latex, please help me
    – x-rw
    Nov 17 at 5:49










  • @santimirandarp i edited my question, it still does not work
    – x-rw
    Nov 17 at 6:00














  • 3




    Please add a minimal working example (MWE) of which replicates your problem.
    – CarLaTeX
    Nov 17 at 5:32






  • 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
    Nov 17 at 5:35










  • If you want chapters why not use report class? Then all you're expecting will be fixed...
    – santimirandarp
    Nov 17 at 5:48












  • @santimirandarp I am new to latex, please help me
    – x-rw
    Nov 17 at 5:49










  • @santimirandarp i edited my question, it still does not work
    – x-rw
    Nov 17 at 6:00








3




3




Please add a minimal working example (MWE) of which replicates your problem.
– CarLaTeX
Nov 17 at 5:32




Please add a minimal working example (MWE) of which replicates your problem.
– CarLaTeX
Nov 17 at 5:32




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
Nov 17 at 5:35




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
Nov 17 at 5:35












If you want chapters why not use report class? Then all you're expecting will be fixed...
– santimirandarp
Nov 17 at 5:48






If you want chapters why not use report class? Then all you're expecting will be fixed...
– santimirandarp
Nov 17 at 5:48














@santimirandarp I am new to latex, please help me
– x-rw
Nov 17 at 5:49




@santimirandarp I am new to latex, please help me
– x-rw
Nov 17 at 5:49












@santimirandarp i edited my question, it still does not work
– x-rw
Nov 17 at 6:00




@santimirandarp i edited my question, it still does not work
– x-rw
Nov 17 at 6:00










1 Answer
1






active

oldest

votes

















up vote
3
down vote



accepted











  • Use report class 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}







share|improve this answer























  • yes, this result is good, what is the secret?
    – x-rw
    Nov 17 at 6:07










  • 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
    Nov 17 at 6:07








  • 1




    muchas gracias, su respuesta me ayudo a aprender algo nuevo (la clase report), i am user with language native spanish
    – x-rw
    Nov 17 at 6:19













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',
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
});


}
});














 

draft saved


draft discarded


















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

























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 report class 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}







share|improve this answer























  • yes, this result is good, what is the secret?
    – x-rw
    Nov 17 at 6:07










  • 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
    Nov 17 at 6:07








  • 1




    muchas gracias, su respuesta me ayudo a aprender algo nuevo (la clase report), i am user with language native spanish
    – x-rw
    Nov 17 at 6:19

















up vote
3
down vote



accepted











  • Use report class 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}







share|improve this answer























  • yes, this result is good, what is the secret?
    – x-rw
    Nov 17 at 6:07










  • 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
    Nov 17 at 6:07








  • 1




    muchas gracias, su respuesta me ayudo a aprender algo nuevo (la clase report), i am user with language native spanish
    – x-rw
    Nov 17 at 6:19















up vote
3
down vote



accepted







up vote
3
down vote



accepted







  • Use report class 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}







share|improve this answer















  • Use report class 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}








share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 17 at 6:12

























answered Nov 17 at 6:04









santimirandarp

1,4203722




1,4203722












  • yes, this result is good, what is the secret?
    – x-rw
    Nov 17 at 6:07










  • 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
    Nov 17 at 6:07








  • 1




    muchas gracias, su respuesta me ayudo a aprender algo nuevo (la clase report), i am user with language native spanish
    – x-rw
    Nov 17 at 6:19




















  • yes, this result is good, what is the secret?
    – x-rw
    Nov 17 at 6:07










  • 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
    Nov 17 at 6:07








  • 1




    muchas gracias, su respuesta me ayudo a aprender algo nuevo (la clase report), i am user with language native spanish
    – x-rw
    Nov 17 at 6:19


















yes, this result is good, what is the secret?
– x-rw
Nov 17 at 6:07




yes, this result is good, what is the secret?
– x-rw
Nov 17 at 6:07












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
Nov 17 at 6:07






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
Nov 17 at 6:07






1




1




muchas gracias, su respuesta me ayudo a aprender algo nuevo (la clase report), i am user with language native spanish
– x-rw
Nov 17 at 6:19






muchas gracias, su respuesta me ayudo a aprender algo nuevo (la clase report), i am user with language native spanish
– x-rw
Nov 17 at 6:19




















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Can I use Tabulator js library in my java Spring + Thymeleaf project?