Separate toc for appendix












2














I am struggeling with creating a seperate toc for my appendix.



This is what I currently have:




Contents

1 first section......1

2 second section.....2

List of appendices...5




This is what I'd like to achieve:




Contents

1 first section......1

2 second section.....2

List of appendices...5




plus a seperate toc for my appendix including all sections:




List of appendices

I My first appendix......5

II My second appendix.....6




This is my code so far:



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{hyperref}
usepackage{lipsum}

usepackage[toc,page]{appendix}

% as per https://tex.stackexchange.com/questions/100479/label-appendix-as-appendix-i-ii-iii-rather-than-appendix-a-b-and-c
letoldappendixappendices
renewcommand{appendices}{%
clearpage
oldappendix
renewcommand{thesection}{Roman{section}}
addtocontents{toc}{protectsetcounter{tocdepth}{0}}
}%

% use custom names for appendices
renewcommand{appendixtocname}{List of appendices}
renewcommand{appendixpagename}{List of appendices}

begin{document}

tableofcontents
section{first section}
lipsum
section{second section}
lipsum

begin{appendices}
section{My first appendix}
lipsum
section{My second appendix}
lipsum
end{appendices}

end{document}


Your help is highly appreciated. I've tried solving my issue with minitoc, however I couldn't achieve what I exactly wanted. I really apologize if this is a duplicate question, but I couldn't find answers for my specific problem.










share|improve this question
























  • Maybe have a look at the etoc package.
    – albert
    Aug 25 at 12:21
















2














I am struggeling with creating a seperate toc for my appendix.



This is what I currently have:




Contents

1 first section......1

2 second section.....2

List of appendices...5




This is what I'd like to achieve:




Contents

1 first section......1

2 second section.....2

List of appendices...5




plus a seperate toc for my appendix including all sections:




List of appendices

I My first appendix......5

II My second appendix.....6




This is my code so far:



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{hyperref}
usepackage{lipsum}

usepackage[toc,page]{appendix}

% as per https://tex.stackexchange.com/questions/100479/label-appendix-as-appendix-i-ii-iii-rather-than-appendix-a-b-and-c
letoldappendixappendices
renewcommand{appendices}{%
clearpage
oldappendix
renewcommand{thesection}{Roman{section}}
addtocontents{toc}{protectsetcounter{tocdepth}{0}}
}%

% use custom names for appendices
renewcommand{appendixtocname}{List of appendices}
renewcommand{appendixpagename}{List of appendices}

begin{document}

tableofcontents
section{first section}
lipsum
section{second section}
lipsum

begin{appendices}
section{My first appendix}
lipsum
section{My second appendix}
lipsum
end{appendices}

end{document}


Your help is highly appreciated. I've tried solving my issue with minitoc, however I couldn't achieve what I exactly wanted. I really apologize if this is a duplicate question, but I couldn't find answers for my specific problem.










share|improve this question
























  • Maybe have a look at the etoc package.
    – albert
    Aug 25 at 12:21














2












2








2


0





I am struggeling with creating a seperate toc for my appendix.



This is what I currently have:




Contents

1 first section......1

2 second section.....2

List of appendices...5




This is what I'd like to achieve:




Contents

1 first section......1

2 second section.....2

List of appendices...5




plus a seperate toc for my appendix including all sections:




List of appendices

I My first appendix......5

II My second appendix.....6




This is my code so far:



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{hyperref}
usepackage{lipsum}

usepackage[toc,page]{appendix}

% as per https://tex.stackexchange.com/questions/100479/label-appendix-as-appendix-i-ii-iii-rather-than-appendix-a-b-and-c
letoldappendixappendices
renewcommand{appendices}{%
clearpage
oldappendix
renewcommand{thesection}{Roman{section}}
addtocontents{toc}{protectsetcounter{tocdepth}{0}}
}%

% use custom names for appendices
renewcommand{appendixtocname}{List of appendices}
renewcommand{appendixpagename}{List of appendices}

begin{document}

tableofcontents
section{first section}
lipsum
section{second section}
lipsum

begin{appendices}
section{My first appendix}
lipsum
section{My second appendix}
lipsum
end{appendices}

end{document}


Your help is highly appreciated. I've tried solving my issue with minitoc, however I couldn't achieve what I exactly wanted. I really apologize if this is a duplicate question, but I couldn't find answers for my specific problem.










share|improve this question















I am struggeling with creating a seperate toc for my appendix.



This is what I currently have:




Contents

1 first section......1

2 second section.....2

List of appendices...5




This is what I'd like to achieve:




Contents

1 first section......1

2 second section.....2

List of appendices...5




plus a seperate toc for my appendix including all sections:




List of appendices

I My first appendix......5

II My second appendix.....6




This is my code so far:



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{hyperref}
usepackage{lipsum}

usepackage[toc,page]{appendix}

% as per https://tex.stackexchange.com/questions/100479/label-appendix-as-appendix-i-ii-iii-rather-than-appendix-a-b-and-c
letoldappendixappendices
renewcommand{appendices}{%
clearpage
oldappendix
renewcommand{thesection}{Roman{section}}
addtocontents{toc}{protectsetcounter{tocdepth}{0}}
}%

% use custom names for appendices
renewcommand{appendixtocname}{List of appendices}
renewcommand{appendixpagename}{List of appendices}

begin{document}

tableofcontents
section{first section}
lipsum
section{second section}
lipsum

begin{appendices}
section{My first appendix}
lipsum
section{My second appendix}
lipsum
end{appendices}

end{document}


Your help is highly appreciated. I've tried solving my issue with minitoc, however I couldn't achieve what I exactly wanted. I really apologize if this is a duplicate question, but I couldn't find answers for my specific problem.







table-of-contents appendices article






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 25 at 12:12









Bernard

165k769193




165k769193










asked Aug 25 at 12:01









KarelZe

111




111












  • Maybe have a look at the etoc package.
    – albert
    Aug 25 at 12:21


















  • Maybe have a look at the etoc package.
    – albert
    Aug 25 at 12:21
















Maybe have a look at the etoc package.
– albert
Aug 25 at 12:21




Maybe have a look at the etoc package.
– albert
Aug 25 at 12:21










1 Answer
1






active

oldest

votes


















0














enter image description here



The separate Toc for the appendix entries can be achieved by letting an .app file handle point to .toc, i.e. at a certain point of document stopping to write to the .toc file and everything meant for the .toc enters the `.app file.



I have defined a listofappendices macro, that reuses tableofcontents by renaming contentsname and applying @starttoc{app} instead of @starttoc{toc}.



documentclass{article}
usepackage{lipsum}
%usepackage[utf8]{inputenc} % Not needed since TL 2018
usepackage{hyperref}
usepackage[page]{appendix}


% as per https://tex.stackexchange.com/questions/100479/label-appendix-as-appendix-i-ii-iii-rather-than-appendix-a-b-and-c

% use custom names for appendices

renewcommand{appendixtocname}{List of appendices}
renewcommand{appendixpagename}{Appendices}

makeatletter
letoldappendixappendices

renewcommand{appendices}{%
clearpage
renewcommand{thesection}{Roman{section}}
% From now, everything goes to the app - file and not to the toc
lettf@toctf@app
addtocontents{app}{protectsetcounter{tocdepth}{1}}
immediatewrite@auxout{%
stringletstringtf@tocstringtf@app^^J
}
oldappendix
}%



newcommand{listofappendices}{%
begingroup
renewcommand{contentsname}{appendixtocname}
let@oldstarttoc@starttoc
def@starttoc##1{@oldstarttoc{app}}
tableofcontents% Reusing the code for tableofcontents with different contentsname and different file handle app
endgroup
}

makeatother


begin{document}

tableofcontents

listofappendices



section{first section}
lipsum
section{second section}
lipsum

section{Third section}
lipsum




begin{appendices}
section{My first appendix}
lipsum
section{My second appendix}
lipsum

section{My third appendix}
lipsum

end{appendices}

end{document}





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


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f447662%2fseparate-toc-for-appendix%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









    0














    enter image description here



    The separate Toc for the appendix entries can be achieved by letting an .app file handle point to .toc, i.e. at a certain point of document stopping to write to the .toc file and everything meant for the .toc enters the `.app file.



    I have defined a listofappendices macro, that reuses tableofcontents by renaming contentsname and applying @starttoc{app} instead of @starttoc{toc}.



    documentclass{article}
    usepackage{lipsum}
    %usepackage[utf8]{inputenc} % Not needed since TL 2018
    usepackage{hyperref}
    usepackage[page]{appendix}


    % as per https://tex.stackexchange.com/questions/100479/label-appendix-as-appendix-i-ii-iii-rather-than-appendix-a-b-and-c

    % use custom names for appendices

    renewcommand{appendixtocname}{List of appendices}
    renewcommand{appendixpagename}{Appendices}

    makeatletter
    letoldappendixappendices

    renewcommand{appendices}{%
    clearpage
    renewcommand{thesection}{Roman{section}}
    % From now, everything goes to the app - file and not to the toc
    lettf@toctf@app
    addtocontents{app}{protectsetcounter{tocdepth}{1}}
    immediatewrite@auxout{%
    stringletstringtf@tocstringtf@app^^J
    }
    oldappendix
    }%



    newcommand{listofappendices}{%
    begingroup
    renewcommand{contentsname}{appendixtocname}
    let@oldstarttoc@starttoc
    def@starttoc##1{@oldstarttoc{app}}
    tableofcontents% Reusing the code for tableofcontents with different contentsname and different file handle app
    endgroup
    }

    makeatother


    begin{document}

    tableofcontents

    listofappendices



    section{first section}
    lipsum
    section{second section}
    lipsum

    section{Third section}
    lipsum




    begin{appendices}
    section{My first appendix}
    lipsum
    section{My second appendix}
    lipsum

    section{My third appendix}
    lipsum

    end{appendices}

    end{document}





    share|improve this answer


























      0














      enter image description here



      The separate Toc for the appendix entries can be achieved by letting an .app file handle point to .toc, i.e. at a certain point of document stopping to write to the .toc file and everything meant for the .toc enters the `.app file.



      I have defined a listofappendices macro, that reuses tableofcontents by renaming contentsname and applying @starttoc{app} instead of @starttoc{toc}.



      documentclass{article}
      usepackage{lipsum}
      %usepackage[utf8]{inputenc} % Not needed since TL 2018
      usepackage{hyperref}
      usepackage[page]{appendix}


      % as per https://tex.stackexchange.com/questions/100479/label-appendix-as-appendix-i-ii-iii-rather-than-appendix-a-b-and-c

      % use custom names for appendices

      renewcommand{appendixtocname}{List of appendices}
      renewcommand{appendixpagename}{Appendices}

      makeatletter
      letoldappendixappendices

      renewcommand{appendices}{%
      clearpage
      renewcommand{thesection}{Roman{section}}
      % From now, everything goes to the app - file and not to the toc
      lettf@toctf@app
      addtocontents{app}{protectsetcounter{tocdepth}{1}}
      immediatewrite@auxout{%
      stringletstringtf@tocstringtf@app^^J
      }
      oldappendix
      }%



      newcommand{listofappendices}{%
      begingroup
      renewcommand{contentsname}{appendixtocname}
      let@oldstarttoc@starttoc
      def@starttoc##1{@oldstarttoc{app}}
      tableofcontents% Reusing the code for tableofcontents with different contentsname and different file handle app
      endgroup
      }

      makeatother


      begin{document}

      tableofcontents

      listofappendices



      section{first section}
      lipsum
      section{second section}
      lipsum

      section{Third section}
      lipsum




      begin{appendices}
      section{My first appendix}
      lipsum
      section{My second appendix}
      lipsum

      section{My third appendix}
      lipsum

      end{appendices}

      end{document}





      share|improve this answer
























        0












        0








        0






        enter image description here



        The separate Toc for the appendix entries can be achieved by letting an .app file handle point to .toc, i.e. at a certain point of document stopping to write to the .toc file and everything meant for the .toc enters the `.app file.



        I have defined a listofappendices macro, that reuses tableofcontents by renaming contentsname and applying @starttoc{app} instead of @starttoc{toc}.



        documentclass{article}
        usepackage{lipsum}
        %usepackage[utf8]{inputenc} % Not needed since TL 2018
        usepackage{hyperref}
        usepackage[page]{appendix}


        % as per https://tex.stackexchange.com/questions/100479/label-appendix-as-appendix-i-ii-iii-rather-than-appendix-a-b-and-c

        % use custom names for appendices

        renewcommand{appendixtocname}{List of appendices}
        renewcommand{appendixpagename}{Appendices}

        makeatletter
        letoldappendixappendices

        renewcommand{appendices}{%
        clearpage
        renewcommand{thesection}{Roman{section}}
        % From now, everything goes to the app - file and not to the toc
        lettf@toctf@app
        addtocontents{app}{protectsetcounter{tocdepth}{1}}
        immediatewrite@auxout{%
        stringletstringtf@tocstringtf@app^^J
        }
        oldappendix
        }%



        newcommand{listofappendices}{%
        begingroup
        renewcommand{contentsname}{appendixtocname}
        let@oldstarttoc@starttoc
        def@starttoc##1{@oldstarttoc{app}}
        tableofcontents% Reusing the code for tableofcontents with different contentsname and different file handle app
        endgroup
        }

        makeatother


        begin{document}

        tableofcontents

        listofappendices



        section{first section}
        lipsum
        section{second section}
        lipsum

        section{Third section}
        lipsum




        begin{appendices}
        section{My first appendix}
        lipsum
        section{My second appendix}
        lipsum

        section{My third appendix}
        lipsum

        end{appendices}

        end{document}





        share|improve this answer












        enter image description here



        The separate Toc for the appendix entries can be achieved by letting an .app file handle point to .toc, i.e. at a certain point of document stopping to write to the .toc file and everything meant for the .toc enters the `.app file.



        I have defined a listofappendices macro, that reuses tableofcontents by renaming contentsname and applying @starttoc{app} instead of @starttoc{toc}.



        documentclass{article}
        usepackage{lipsum}
        %usepackage[utf8]{inputenc} % Not needed since TL 2018
        usepackage{hyperref}
        usepackage[page]{appendix}


        % as per https://tex.stackexchange.com/questions/100479/label-appendix-as-appendix-i-ii-iii-rather-than-appendix-a-b-and-c

        % use custom names for appendices

        renewcommand{appendixtocname}{List of appendices}
        renewcommand{appendixpagename}{Appendices}

        makeatletter
        letoldappendixappendices

        renewcommand{appendices}{%
        clearpage
        renewcommand{thesection}{Roman{section}}
        % From now, everything goes to the app - file and not to the toc
        lettf@toctf@app
        addtocontents{app}{protectsetcounter{tocdepth}{1}}
        immediatewrite@auxout{%
        stringletstringtf@tocstringtf@app^^J
        }
        oldappendix
        }%



        newcommand{listofappendices}{%
        begingroup
        renewcommand{contentsname}{appendixtocname}
        let@oldstarttoc@starttoc
        def@starttoc##1{@oldstarttoc{app}}
        tableofcontents% Reusing the code for tableofcontents with different contentsname and different file handle app
        endgroup
        }

        makeatother


        begin{document}

        tableofcontents

        listofappendices



        section{first section}
        lipsum
        section{second section}
        lipsum

        section{Third section}
        lipsum




        begin{appendices}
        section{My first appendix}
        lipsum
        section{My second appendix}
        lipsum

        section{My third appendix}
        lipsum

        end{appendices}

        end{document}






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 19 mins ago









        Christian Hupfer

        147k14192384




        147k14192384






























            draft saved

            draft discarded




















































            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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2f447662%2fseparate-toc-for-appendix%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

            Accessing regular linux commands in Huawei's Dopra Linux

            Can't connect RFCOMM socket: Host is down

            Kernel panic - not syncing: Fatal Exception in Interrupt