Single Page table of contents












3















Is there a way to make a single page table of contents in this style



Introduction ..................................... 1
Next Point ....................................... 2


Without generating it form a LaTex-Document? I printed a bundle of scripts for programming classes that are not writting in latex but i want to have a clean table of contents with a custom of the pages.



Thank you.










share|improve this question







New contributor




Florian Purshall 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.SE!

    – Mico
    1 hour ago
















3















Is there a way to make a single page table of contents in this style



Introduction ..................................... 1
Next Point ....................................... 2


Without generating it form a LaTex-Document? I printed a bundle of scripts for programming classes that are not writting in latex but i want to have a clean table of contents with a custom of the pages.



Thank you.










share|improve this question







New contributor




Florian Purshall 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.SE!

    – Mico
    1 hour ago














3












3








3








Is there a way to make a single page table of contents in this style



Introduction ..................................... 1
Next Point ....................................... 2


Without generating it form a LaTex-Document? I printed a bundle of scripts for programming classes that are not writting in latex but i want to have a clean table of contents with a custom of the pages.



Thank you.










share|improve this question







New contributor




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












Is there a way to make a single page table of contents in this style



Introduction ..................................... 1
Next Point ....................................... 2


Without generating it form a LaTex-Document? I printed a bundle of scripts for programming classes that are not writting in latex but i want to have a clean table of contents with a custom of the pages.



Thank you.







table-of-contents






share|improve this question







New contributor




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




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




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









Florian PurshallFlorian Purshall

161




161




New contributor




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





New contributor





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






Florian Purshall 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.SE!

    – Mico
    1 hour ago



















  • Welcome to TeX.SE!

    – Mico
    1 hour ago

















Welcome to TeX.SE!

– Mico
1 hour ago





Welcome to TeX.SE!

– Mico
1 hour ago










2 Answers
2






active

oldest

votes


















3














The lines of the table of contents are generated using contentsline.
You can also call this macro yourself to create a toc manually.
The general syntax is



contentsline{<chapter/section/subsection/subsubsection>}{<title>}{<page>}


and if you want these entries to be numbered you should insert numberline{<section number>} at the start of the second argument.
To use the chapter level heading you need to use a document class that supports it (like book or report).



Here is an example.
I'm numbering only half of the sections to illustrate how this works and what the result looks like.



documentclass{article}

begin{document}

section*{Table of contents}

contentsline{section}{Introduction}{1}
contentsline{subsection}{First subsection}{1}
contentsline{subsection}{Second subsection}{3}
contentsline{subsection}{Third subsection}{3}

contentsline{section}{numberline{2}First real section}{5}
contentsline{subsection}{numberline{2.1}First subsection}{5}
contentsline{subsection}{numberline{2.2}Second subsection}{6}
contentsline{subsection}{numberline{2.3}Third subsection}{8}

end{document}


output



Here is a version that takes care of the section numbers automatically.



documentclass{article}

newcommand*tocsection[2]{%
stepcounter{section}%
contentsline{section}{numberline{thesection}#1}{#2}%
}
newcommand*tocsubsection[2]{%
stepcounter{subsection}%
contentsline{subsection}{numberline{thesubsection}#1}{#2}%
}

begin{document}

section*{Table of contents}

tocsection{Introduction}{1}
tocsubsection{First subsection}{1}
tocsubsection{Second subsection}{3}
tocsubsection{Third subsection}{3}
tocsection{First real chapter}{5}
tocsubsection{First subsection}{5}
tocsubsection{Second subsection}{6}
tocsubsection{Third subsection}{8}

end{document}


In a document class with actual chapters, tocchapter could be implemented in the same way.



output





If you need to customise the appearance of the toc you can use either titletoc or tocloft.





Remark: contentsline takes an additional argument if hyperref is loaded (the target for the hyperlink).
If someone reading this wants to incorporate the above in a document that uses hyperref, you should add an additional {} after {<page>}.






share|improve this answer


























  • How would you adapt this solution to the OP's apparent objective of listing a bunch of unnumbered entries in the ToC?

    – Mico
    1 hour ago











  • @Mico: I should've considered that. By leaving out numberline{…} is the answer.

    – Circumscribe
    51 mins ago











  • @mico: see modified answer ↑↑.

    – Circumscribe
    26 mins ago



















2














You asked,




Is there a way to make a single page table of contents ... [w]ithout generating it [from] a LaTex-Document?




I assume that by "without generating it from a LaTeX document", you mean "without creating a LaTeX document prefaced by a tableofcontents directive". Since you posted your query to this site, I'm also assuming that you are not actually averse to creating this table of contents via a documentclass ... begin{document} ... end{document} structure, i.e., via a LaTeX document.



If these assumptions are correct, the following solution may be of interest to you.



enter image description here



documentclass{article}
usepackage{tocloft} %% used only for 'cftsubsecleader' macro
begin{document}

setlengthparindent{0pt}
obeylines
textbf{Table of Contents}
smallskip
Introduction cftsubsecleader 1
Next Point cftsubsecleader 2
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
    });


    }
    });






    Florian Purshall 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%2f471569%2fsingle-page-table-of-contents%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    The lines of the table of contents are generated using contentsline.
    You can also call this macro yourself to create a toc manually.
    The general syntax is



    contentsline{<chapter/section/subsection/subsubsection>}{<title>}{<page>}


    and if you want these entries to be numbered you should insert numberline{<section number>} at the start of the second argument.
    To use the chapter level heading you need to use a document class that supports it (like book or report).



    Here is an example.
    I'm numbering only half of the sections to illustrate how this works and what the result looks like.



    documentclass{article}

    begin{document}

    section*{Table of contents}

    contentsline{section}{Introduction}{1}
    contentsline{subsection}{First subsection}{1}
    contentsline{subsection}{Second subsection}{3}
    contentsline{subsection}{Third subsection}{3}

    contentsline{section}{numberline{2}First real section}{5}
    contentsline{subsection}{numberline{2.1}First subsection}{5}
    contentsline{subsection}{numberline{2.2}Second subsection}{6}
    contentsline{subsection}{numberline{2.3}Third subsection}{8}

    end{document}


    output



    Here is a version that takes care of the section numbers automatically.



    documentclass{article}

    newcommand*tocsection[2]{%
    stepcounter{section}%
    contentsline{section}{numberline{thesection}#1}{#2}%
    }
    newcommand*tocsubsection[2]{%
    stepcounter{subsection}%
    contentsline{subsection}{numberline{thesubsection}#1}{#2}%
    }

    begin{document}

    section*{Table of contents}

    tocsection{Introduction}{1}
    tocsubsection{First subsection}{1}
    tocsubsection{Second subsection}{3}
    tocsubsection{Third subsection}{3}
    tocsection{First real chapter}{5}
    tocsubsection{First subsection}{5}
    tocsubsection{Second subsection}{6}
    tocsubsection{Third subsection}{8}

    end{document}


    In a document class with actual chapters, tocchapter could be implemented in the same way.



    output





    If you need to customise the appearance of the toc you can use either titletoc or tocloft.





    Remark: contentsline takes an additional argument if hyperref is loaded (the target for the hyperlink).
    If someone reading this wants to incorporate the above in a document that uses hyperref, you should add an additional {} after {<page>}.






    share|improve this answer


























    • How would you adapt this solution to the OP's apparent objective of listing a bunch of unnumbered entries in the ToC?

      – Mico
      1 hour ago











    • @Mico: I should've considered that. By leaving out numberline{…} is the answer.

      – Circumscribe
      51 mins ago











    • @mico: see modified answer ↑↑.

      – Circumscribe
      26 mins ago
















    3














    The lines of the table of contents are generated using contentsline.
    You can also call this macro yourself to create a toc manually.
    The general syntax is



    contentsline{<chapter/section/subsection/subsubsection>}{<title>}{<page>}


    and if you want these entries to be numbered you should insert numberline{<section number>} at the start of the second argument.
    To use the chapter level heading you need to use a document class that supports it (like book or report).



    Here is an example.
    I'm numbering only half of the sections to illustrate how this works and what the result looks like.



    documentclass{article}

    begin{document}

    section*{Table of contents}

    contentsline{section}{Introduction}{1}
    contentsline{subsection}{First subsection}{1}
    contentsline{subsection}{Second subsection}{3}
    contentsline{subsection}{Third subsection}{3}

    contentsline{section}{numberline{2}First real section}{5}
    contentsline{subsection}{numberline{2.1}First subsection}{5}
    contentsline{subsection}{numberline{2.2}Second subsection}{6}
    contentsline{subsection}{numberline{2.3}Third subsection}{8}

    end{document}


    output



    Here is a version that takes care of the section numbers automatically.



    documentclass{article}

    newcommand*tocsection[2]{%
    stepcounter{section}%
    contentsline{section}{numberline{thesection}#1}{#2}%
    }
    newcommand*tocsubsection[2]{%
    stepcounter{subsection}%
    contentsline{subsection}{numberline{thesubsection}#1}{#2}%
    }

    begin{document}

    section*{Table of contents}

    tocsection{Introduction}{1}
    tocsubsection{First subsection}{1}
    tocsubsection{Second subsection}{3}
    tocsubsection{Third subsection}{3}
    tocsection{First real chapter}{5}
    tocsubsection{First subsection}{5}
    tocsubsection{Second subsection}{6}
    tocsubsection{Third subsection}{8}

    end{document}


    In a document class with actual chapters, tocchapter could be implemented in the same way.



    output





    If you need to customise the appearance of the toc you can use either titletoc or tocloft.





    Remark: contentsline takes an additional argument if hyperref is loaded (the target for the hyperlink).
    If someone reading this wants to incorporate the above in a document that uses hyperref, you should add an additional {} after {<page>}.






    share|improve this answer


























    • How would you adapt this solution to the OP's apparent objective of listing a bunch of unnumbered entries in the ToC?

      – Mico
      1 hour ago











    • @Mico: I should've considered that. By leaving out numberline{…} is the answer.

      – Circumscribe
      51 mins ago











    • @mico: see modified answer ↑↑.

      – Circumscribe
      26 mins ago














    3












    3








    3







    The lines of the table of contents are generated using contentsline.
    You can also call this macro yourself to create a toc manually.
    The general syntax is



    contentsline{<chapter/section/subsection/subsubsection>}{<title>}{<page>}


    and if you want these entries to be numbered you should insert numberline{<section number>} at the start of the second argument.
    To use the chapter level heading you need to use a document class that supports it (like book or report).



    Here is an example.
    I'm numbering only half of the sections to illustrate how this works and what the result looks like.



    documentclass{article}

    begin{document}

    section*{Table of contents}

    contentsline{section}{Introduction}{1}
    contentsline{subsection}{First subsection}{1}
    contentsline{subsection}{Second subsection}{3}
    contentsline{subsection}{Third subsection}{3}

    contentsline{section}{numberline{2}First real section}{5}
    contentsline{subsection}{numberline{2.1}First subsection}{5}
    contentsline{subsection}{numberline{2.2}Second subsection}{6}
    contentsline{subsection}{numberline{2.3}Third subsection}{8}

    end{document}


    output



    Here is a version that takes care of the section numbers automatically.



    documentclass{article}

    newcommand*tocsection[2]{%
    stepcounter{section}%
    contentsline{section}{numberline{thesection}#1}{#2}%
    }
    newcommand*tocsubsection[2]{%
    stepcounter{subsection}%
    contentsline{subsection}{numberline{thesubsection}#1}{#2}%
    }

    begin{document}

    section*{Table of contents}

    tocsection{Introduction}{1}
    tocsubsection{First subsection}{1}
    tocsubsection{Second subsection}{3}
    tocsubsection{Third subsection}{3}
    tocsection{First real chapter}{5}
    tocsubsection{First subsection}{5}
    tocsubsection{Second subsection}{6}
    tocsubsection{Third subsection}{8}

    end{document}


    In a document class with actual chapters, tocchapter could be implemented in the same way.



    output





    If you need to customise the appearance of the toc you can use either titletoc or tocloft.





    Remark: contentsline takes an additional argument if hyperref is loaded (the target for the hyperlink).
    If someone reading this wants to incorporate the above in a document that uses hyperref, you should add an additional {} after {<page>}.






    share|improve this answer















    The lines of the table of contents are generated using contentsline.
    You can also call this macro yourself to create a toc manually.
    The general syntax is



    contentsline{<chapter/section/subsection/subsubsection>}{<title>}{<page>}


    and if you want these entries to be numbered you should insert numberline{<section number>} at the start of the second argument.
    To use the chapter level heading you need to use a document class that supports it (like book or report).



    Here is an example.
    I'm numbering only half of the sections to illustrate how this works and what the result looks like.



    documentclass{article}

    begin{document}

    section*{Table of contents}

    contentsline{section}{Introduction}{1}
    contentsline{subsection}{First subsection}{1}
    contentsline{subsection}{Second subsection}{3}
    contentsline{subsection}{Third subsection}{3}

    contentsline{section}{numberline{2}First real section}{5}
    contentsline{subsection}{numberline{2.1}First subsection}{5}
    contentsline{subsection}{numberline{2.2}Second subsection}{6}
    contentsline{subsection}{numberline{2.3}Third subsection}{8}

    end{document}


    output



    Here is a version that takes care of the section numbers automatically.



    documentclass{article}

    newcommand*tocsection[2]{%
    stepcounter{section}%
    contentsline{section}{numberline{thesection}#1}{#2}%
    }
    newcommand*tocsubsection[2]{%
    stepcounter{subsection}%
    contentsline{subsection}{numberline{thesubsection}#1}{#2}%
    }

    begin{document}

    section*{Table of contents}

    tocsection{Introduction}{1}
    tocsubsection{First subsection}{1}
    tocsubsection{Second subsection}{3}
    tocsubsection{Third subsection}{3}
    tocsection{First real chapter}{5}
    tocsubsection{First subsection}{5}
    tocsubsection{Second subsection}{6}
    tocsubsection{Third subsection}{8}

    end{document}


    In a document class with actual chapters, tocchapter could be implemented in the same way.



    output





    If you need to customise the appearance of the toc you can use either titletoc or tocloft.





    Remark: contentsline takes an additional argument if hyperref is loaded (the target for the hyperlink).
    If someone reading this wants to incorporate the above in a document that uses hyperref, you should add an additional {} after {<page>}.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited 25 mins ago

























    answered 2 hours ago









    CircumscribeCircumscribe

    5,8161836




    5,8161836













    • How would you adapt this solution to the OP's apparent objective of listing a bunch of unnumbered entries in the ToC?

      – Mico
      1 hour ago











    • @Mico: I should've considered that. By leaving out numberline{…} is the answer.

      – Circumscribe
      51 mins ago











    • @mico: see modified answer ↑↑.

      – Circumscribe
      26 mins ago



















    • How would you adapt this solution to the OP's apparent objective of listing a bunch of unnumbered entries in the ToC?

      – Mico
      1 hour ago











    • @Mico: I should've considered that. By leaving out numberline{…} is the answer.

      – Circumscribe
      51 mins ago











    • @mico: see modified answer ↑↑.

      – Circumscribe
      26 mins ago

















    How would you adapt this solution to the OP's apparent objective of listing a bunch of unnumbered entries in the ToC?

    – Mico
    1 hour ago





    How would you adapt this solution to the OP's apparent objective of listing a bunch of unnumbered entries in the ToC?

    – Mico
    1 hour ago













    @Mico: I should've considered that. By leaving out numberline{…} is the answer.

    – Circumscribe
    51 mins ago





    @Mico: I should've considered that. By leaving out numberline{…} is the answer.

    – Circumscribe
    51 mins ago













    @mico: see modified answer ↑↑.

    – Circumscribe
    26 mins ago





    @mico: see modified answer ↑↑.

    – Circumscribe
    26 mins ago











    2














    You asked,




    Is there a way to make a single page table of contents ... [w]ithout generating it [from] a LaTex-Document?




    I assume that by "without generating it from a LaTeX document", you mean "without creating a LaTeX document prefaced by a tableofcontents directive". Since you posted your query to this site, I'm also assuming that you are not actually averse to creating this table of contents via a documentclass ... begin{document} ... end{document} structure, i.e., via a LaTeX document.



    If these assumptions are correct, the following solution may be of interest to you.



    enter image description here



    documentclass{article}
    usepackage{tocloft} %% used only for 'cftsubsecleader' macro
    begin{document}

    setlengthparindent{0pt}
    obeylines
    textbf{Table of Contents}
    smallskip
    Introduction cftsubsecleader 1
    Next Point cftsubsecleader 2
    end{document}





    share|improve this answer




























      2














      You asked,




      Is there a way to make a single page table of contents ... [w]ithout generating it [from] a LaTex-Document?




      I assume that by "without generating it from a LaTeX document", you mean "without creating a LaTeX document prefaced by a tableofcontents directive". Since you posted your query to this site, I'm also assuming that you are not actually averse to creating this table of contents via a documentclass ... begin{document} ... end{document} structure, i.e., via a LaTeX document.



      If these assumptions are correct, the following solution may be of interest to you.



      enter image description here



      documentclass{article}
      usepackage{tocloft} %% used only for 'cftsubsecleader' macro
      begin{document}

      setlengthparindent{0pt}
      obeylines
      textbf{Table of Contents}
      smallskip
      Introduction cftsubsecleader 1
      Next Point cftsubsecleader 2
      end{document}





      share|improve this answer


























        2












        2








        2







        You asked,




        Is there a way to make a single page table of contents ... [w]ithout generating it [from] a LaTex-Document?




        I assume that by "without generating it from a LaTeX document", you mean "without creating a LaTeX document prefaced by a tableofcontents directive". Since you posted your query to this site, I'm also assuming that you are not actually averse to creating this table of contents via a documentclass ... begin{document} ... end{document} structure, i.e., via a LaTeX document.



        If these assumptions are correct, the following solution may be of interest to you.



        enter image description here



        documentclass{article}
        usepackage{tocloft} %% used only for 'cftsubsecleader' macro
        begin{document}

        setlengthparindent{0pt}
        obeylines
        textbf{Table of Contents}
        smallskip
        Introduction cftsubsecleader 1
        Next Point cftsubsecleader 2
        end{document}





        share|improve this answer













        You asked,




        Is there a way to make a single page table of contents ... [w]ithout generating it [from] a LaTex-Document?




        I assume that by "without generating it from a LaTeX document", you mean "without creating a LaTeX document prefaced by a tableofcontents directive". Since you posted your query to this site, I'm also assuming that you are not actually averse to creating this table of contents via a documentclass ... begin{document} ... end{document} structure, i.e., via a LaTeX document.



        If these assumptions are correct, the following solution may be of interest to you.



        enter image description here



        documentclass{article}
        usepackage{tocloft} %% used only for 'cftsubsecleader' macro
        begin{document}

        setlengthparindent{0pt}
        obeylines
        textbf{Table of Contents}
        smallskip
        Introduction cftsubsecleader 1
        Next Point cftsubsecleader 2
        end{document}






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 1 hour ago









        MicoMico

        276k30374763




        276k30374763






















            Florian Purshall is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            Florian Purshall is a new contributor. Be nice, and check out our Code of Conduct.













            Florian Purshall is a new contributor. Be nice, and check out our Code of Conduct.












            Florian Purshall 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%2f471569%2fsingle-page-table-of-contents%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 label and detect the document text images

            Vallis Paradisi

            Tabula Rosettana