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
    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















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
    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













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 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














  • 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










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
    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




    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













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
    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




    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

















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
    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




    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















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 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 remove usepackage{chngcntr} counterwithin{figure}{section} and modify the argument of section{}. 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










  • 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




    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




















 

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

Mouse cursor on multiple screens with different PPI

Agildo Ribeiro

Sometime when accessing a menu: “Ubuntu 16.04 has experienced an internal error”