New title class doesn't increase counter












1















I'm fairly new to LaTeX and need to create a subsubsubsection in a document. After looking around I found that it could be done with titlesec. I've followed all instructions I've been able to find but it stil doesn't work as I desire.



The subsubsubsection shows up in the table of contents and the counter does work when using the setcounter{}{} and it's also reset every subsubsection, but for some reason the counter does not increase with new subsubsubsections nor is thesubsubsubsection displayed in the table of contents or the text.



Below is the code and the document. In the end the table of contents will probably just display 2 levels, so I don't really care about the looks there at the moment. It is just included to show that the subsubsubsection is recognised in some way.



documentclass[11pt,twoside,a4paper]{article}

usepackage{titlesec}

titleclass{subsubsubsection}{straight}[subsubsection]
newcounter{subsubsubsection}[subsubsection]
renewcommand{thesubsubsubsection}{thesubsubsection.arabic{subsubsubsection}}
titlespacing*{subsubsubsection}{0mm}{0mm}{0mm}[0mm]
titleformat{subsubsubsection}{small}{thesubsubsubsection}{1em}{}

begin{document}

tableofcontents

section{Section one}
subsection{Subsection one}
subsubsection{Subsubsection one}
subsubsubsection{Subsubsubsection one}
thesubsubsubsection\
setcounter{subsubsubsection}{3}
thesubsubsubsection
subsubsection{Subsubsection two}
subsubsubsection{Subsubsubsection one}
thesubsubsubsection\

end{document}


enter image description here










share|improve this question







New contributor




Simon Probert is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Welcome to TeX.SX! Relative: tex.stackexchange.com/questions/60209/… ... You have to add the command setcounter{secnumdepth}{4} to get it work

    – koleygr
    2 hours ago








  • 1





    you don't need to define new counters, article class already has level 4 and 5 headings, the commands are paragraph and subparagraph

    – David Carlisle
    2 hours ago
















1















I'm fairly new to LaTeX and need to create a subsubsubsection in a document. After looking around I found that it could be done with titlesec. I've followed all instructions I've been able to find but it stil doesn't work as I desire.



The subsubsubsection shows up in the table of contents and the counter does work when using the setcounter{}{} and it's also reset every subsubsection, but for some reason the counter does not increase with new subsubsubsections nor is thesubsubsubsection displayed in the table of contents or the text.



Below is the code and the document. In the end the table of contents will probably just display 2 levels, so I don't really care about the looks there at the moment. It is just included to show that the subsubsubsection is recognised in some way.



documentclass[11pt,twoside,a4paper]{article}

usepackage{titlesec}

titleclass{subsubsubsection}{straight}[subsubsection]
newcounter{subsubsubsection}[subsubsection]
renewcommand{thesubsubsubsection}{thesubsubsection.arabic{subsubsubsection}}
titlespacing*{subsubsubsection}{0mm}{0mm}{0mm}[0mm]
titleformat{subsubsubsection}{small}{thesubsubsubsection}{1em}{}

begin{document}

tableofcontents

section{Section one}
subsection{Subsection one}
subsubsection{Subsubsection one}
subsubsubsection{Subsubsubsection one}
thesubsubsubsection\
setcounter{subsubsubsection}{3}
thesubsubsubsection
subsubsection{Subsubsection two}
subsubsubsection{Subsubsubsection one}
thesubsubsubsection\

end{document}


enter image description here










share|improve this question







New contributor




Simon Probert is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Welcome to TeX.SX! Relative: tex.stackexchange.com/questions/60209/… ... You have to add the command setcounter{secnumdepth}{4} to get it work

    – koleygr
    2 hours ago








  • 1





    you don't need to define new counters, article class already has level 4 and 5 headings, the commands are paragraph and subparagraph

    – David Carlisle
    2 hours ago














1












1








1








I'm fairly new to LaTeX and need to create a subsubsubsection in a document. After looking around I found that it could be done with titlesec. I've followed all instructions I've been able to find but it stil doesn't work as I desire.



The subsubsubsection shows up in the table of contents and the counter does work when using the setcounter{}{} and it's also reset every subsubsection, but for some reason the counter does not increase with new subsubsubsections nor is thesubsubsubsection displayed in the table of contents or the text.



Below is the code and the document. In the end the table of contents will probably just display 2 levels, so I don't really care about the looks there at the moment. It is just included to show that the subsubsubsection is recognised in some way.



documentclass[11pt,twoside,a4paper]{article}

usepackage{titlesec}

titleclass{subsubsubsection}{straight}[subsubsection]
newcounter{subsubsubsection}[subsubsection]
renewcommand{thesubsubsubsection}{thesubsubsection.arabic{subsubsubsection}}
titlespacing*{subsubsubsection}{0mm}{0mm}{0mm}[0mm]
titleformat{subsubsubsection}{small}{thesubsubsubsection}{1em}{}

begin{document}

tableofcontents

section{Section one}
subsection{Subsection one}
subsubsection{Subsubsection one}
subsubsubsection{Subsubsubsection one}
thesubsubsubsection\
setcounter{subsubsubsection}{3}
thesubsubsubsection
subsubsection{Subsubsection two}
subsubsubsection{Subsubsubsection one}
thesubsubsubsection\

end{document}


enter image description here










share|improve this question







New contributor




Simon Probert is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I'm fairly new to LaTeX and need to create a subsubsubsection in a document. After looking around I found that it could be done with titlesec. I've followed all instructions I've been able to find but it stil doesn't work as I desire.



The subsubsubsection shows up in the table of contents and the counter does work when using the setcounter{}{} and it's also reset every subsubsection, but for some reason the counter does not increase with new subsubsubsections nor is thesubsubsubsection displayed in the table of contents or the text.



Below is the code and the document. In the end the table of contents will probably just display 2 levels, so I don't really care about the looks there at the moment. It is just included to show that the subsubsubsection is recognised in some way.



documentclass[11pt,twoside,a4paper]{article}

usepackage{titlesec}

titleclass{subsubsubsection}{straight}[subsubsection]
newcounter{subsubsubsection}[subsubsection]
renewcommand{thesubsubsubsection}{thesubsubsection.arabic{subsubsubsection}}
titlespacing*{subsubsubsection}{0mm}{0mm}{0mm}[0mm]
titleformat{subsubsubsection}{small}{thesubsubsubsection}{1em}{}

begin{document}

tableofcontents

section{Section one}
subsection{Subsection one}
subsubsection{Subsubsection one}
subsubsubsection{Subsubsubsection one}
thesubsubsubsection\
setcounter{subsubsubsection}{3}
thesubsubsubsection
subsubsection{Subsubsection two}
subsubsubsection{Subsubsubsection one}
thesubsubsubsection\

end{document}


enter image description here







sectioning counters titlesec






share|improve this question







New contributor




Simon Probert is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




Simon Probert is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




Simon Probert is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 3 hours ago









Simon ProbertSimon Probert

61




61




New contributor




Simon Probert is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Simon Probert is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Simon Probert is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • Welcome to TeX.SX! Relative: tex.stackexchange.com/questions/60209/… ... You have to add the command setcounter{secnumdepth}{4} to get it work

    – koleygr
    2 hours ago








  • 1





    you don't need to define new counters, article class already has level 4 and 5 headings, the commands are paragraph and subparagraph

    – David Carlisle
    2 hours ago



















  • Welcome to TeX.SX! Relative: tex.stackexchange.com/questions/60209/… ... You have to add the command setcounter{secnumdepth}{4} to get it work

    – koleygr
    2 hours ago








  • 1





    you don't need to define new counters, article class already has level 4 and 5 headings, the commands are paragraph and subparagraph

    – David Carlisle
    2 hours ago

















Welcome to TeX.SX! Relative: tex.stackexchange.com/questions/60209/… ... You have to add the command setcounter{secnumdepth}{4} to get it work

– koleygr
2 hours ago







Welcome to TeX.SX! Relative: tex.stackexchange.com/questions/60209/… ... You have to add the command setcounter{secnumdepth}{4} to get it work

– koleygr
2 hours ago






1




1





you don't need to define new counters, article class already has level 4 and 5 headings, the commands are paragraph and subparagraph

– David Carlisle
2 hours ago





you don't need to define new counters, article class already has level 4 and 5 headings, the commands are paragraph and subparagraph

– David Carlisle
2 hours ago










1 Answer
1






active

oldest

votes


















2














You have to change the value of secnumdepth (by default sectioning titles are numbered up to the level of subsubsections). You also should have to set the layout of subsubsubsections in the table of contents via titletoc:



documentclass[11pt, twoside, a4paper]{article}

usepackage{titlesec}
setcounter{secnumdepth}{4}
titleclass{subsubsubsection}{straight}[subsubsection]
newcounter{subsubsubsection}%[subsubsection]
counterwithin{subsubsubsection}{subsubsection}
titlespacing*{subsubsubsection}{0mm}{0mm}{0mm}[0mm]
titleformat{subsubsubsection}{small}{thesubsubsubsection}{1em}{}

begin{document}

tableofcontents

section{Section one}
subsection{Subsection one}
subsubsection{Subsubsection one}
subsubsubsection{Subsubsubsection one}
thesubsubsubsection\
setcounter{subsubsubsection}{3}
thesubsubsubsection
subsubsection{Subsubsection two}
subsubsubsection{Subsubsubsection one}
thesubsubsubsection

end{document}


enter image description here






share|improve this answer
























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


    }
    });






    Simon Probert is a new contributor. Be nice, and check out our Code of Conduct.










    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482183%2fnew-title-class-doesnt-increase-counter%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









    2














    You have to change the value of secnumdepth (by default sectioning titles are numbered up to the level of subsubsections). You also should have to set the layout of subsubsubsections in the table of contents via titletoc:



    documentclass[11pt, twoside, a4paper]{article}

    usepackage{titlesec}
    setcounter{secnumdepth}{4}
    titleclass{subsubsubsection}{straight}[subsubsection]
    newcounter{subsubsubsection}%[subsubsection]
    counterwithin{subsubsubsection}{subsubsection}
    titlespacing*{subsubsubsection}{0mm}{0mm}{0mm}[0mm]
    titleformat{subsubsubsection}{small}{thesubsubsubsection}{1em}{}

    begin{document}

    tableofcontents

    section{Section one}
    subsection{Subsection one}
    subsubsection{Subsubsection one}
    subsubsubsection{Subsubsubsection one}
    thesubsubsubsection\
    setcounter{subsubsubsection}{3}
    thesubsubsubsection
    subsubsection{Subsubsection two}
    subsubsubsection{Subsubsubsection one}
    thesubsubsubsection

    end{document}


    enter image description here






    share|improve this answer




























      2














      You have to change the value of secnumdepth (by default sectioning titles are numbered up to the level of subsubsections). You also should have to set the layout of subsubsubsections in the table of contents via titletoc:



      documentclass[11pt, twoside, a4paper]{article}

      usepackage{titlesec}
      setcounter{secnumdepth}{4}
      titleclass{subsubsubsection}{straight}[subsubsection]
      newcounter{subsubsubsection}%[subsubsection]
      counterwithin{subsubsubsection}{subsubsection}
      titlespacing*{subsubsubsection}{0mm}{0mm}{0mm}[0mm]
      titleformat{subsubsubsection}{small}{thesubsubsubsection}{1em}{}

      begin{document}

      tableofcontents

      section{Section one}
      subsection{Subsection one}
      subsubsection{Subsubsection one}
      subsubsubsection{Subsubsubsection one}
      thesubsubsubsection\
      setcounter{subsubsubsection}{3}
      thesubsubsubsection
      subsubsection{Subsubsection two}
      subsubsubsection{Subsubsubsection one}
      thesubsubsubsection

      end{document}


      enter image description here






      share|improve this answer


























        2












        2








        2







        You have to change the value of secnumdepth (by default sectioning titles are numbered up to the level of subsubsections). You also should have to set the layout of subsubsubsections in the table of contents via titletoc:



        documentclass[11pt, twoside, a4paper]{article}

        usepackage{titlesec}
        setcounter{secnumdepth}{4}
        titleclass{subsubsubsection}{straight}[subsubsection]
        newcounter{subsubsubsection}%[subsubsection]
        counterwithin{subsubsubsection}{subsubsection}
        titlespacing*{subsubsubsection}{0mm}{0mm}{0mm}[0mm]
        titleformat{subsubsubsection}{small}{thesubsubsubsection}{1em}{}

        begin{document}

        tableofcontents

        section{Section one}
        subsection{Subsection one}
        subsubsection{Subsubsection one}
        subsubsubsection{Subsubsubsection one}
        thesubsubsubsection\
        setcounter{subsubsubsection}{3}
        thesubsubsubsection
        subsubsection{Subsubsection two}
        subsubsubsection{Subsubsubsection one}
        thesubsubsubsection

        end{document}


        enter image description here






        share|improve this answer













        You have to change the value of secnumdepth (by default sectioning titles are numbered up to the level of subsubsections). You also should have to set the layout of subsubsubsections in the table of contents via titletoc:



        documentclass[11pt, twoside, a4paper]{article}

        usepackage{titlesec}
        setcounter{secnumdepth}{4}
        titleclass{subsubsubsection}{straight}[subsubsection]
        newcounter{subsubsubsection}%[subsubsection]
        counterwithin{subsubsubsection}{subsubsection}
        titlespacing*{subsubsubsection}{0mm}{0mm}{0mm}[0mm]
        titleformat{subsubsubsection}{small}{thesubsubsubsection}{1em}{}

        begin{document}

        tableofcontents

        section{Section one}
        subsection{Subsection one}
        subsubsection{Subsubsection one}
        subsubsubsection{Subsubsubsection one}
        thesubsubsubsection\
        setcounter{subsubsubsection}{3}
        thesubsubsubsection
        subsubsection{Subsubsection two}
        subsubsubsection{Subsubsubsection one}
        thesubsubsubsection

        end{document}


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 2 hours ago









        BernardBernard

        174k776207




        174k776207






















            Simon Probert is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            Simon Probert is a new contributor. Be nice, and check out our Code of Conduct.













            Simon Probert is a new contributor. Be nice, and check out our Code of Conduct.












            Simon Probert is a new contributor. Be nice, and check out our Code of Conduct.
















            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482183%2fnew-title-class-doesnt-increase-counter%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

            Lallio

            Futebolista

            Jornalista