Multilined and Misformatted Table of Contents in Master/Subfiles Document












0














I'm trying to figure out what I did that screwed up the formatting of this course notes template. I apologize for not having a better MWE, but it seems to all have parts together to it.



MWE (edited):
documentclass[11pt]{article}



newcommand{classheader}[1]{newpagesection*{#1}
phantomsection addcontentsline{toc}{section}{(#1)}
}

usepackage{fancyhdr}
pagestyle{fancy}
rfoot{parbox[t]{0.9in}{centering Page thepage\ classheader}}

usepackage{hyperref}

begin{document}

thispagestyle{empty}
tableofcontents

newpage
thispagestyle{empty}


section*{Introduction}

include{SecurityisMathematics}

end{document}


Security is Mathematics.tex (as an MWE)



classheader{Security is Mathematics}
section{Security is Mathematics}label{security-is-mathematics}

Insert Text Here


These two documents, compiled while in the same directory, provide the following first page as output. Not exactly what I'm looking for. Any thoughts on how to fix this and make it cleaner? Thanks all!



Output










share|improve this question





























    0














    I'm trying to figure out what I did that screwed up the formatting of this course notes template. I apologize for not having a better MWE, but it seems to all have parts together to it.



    MWE (edited):
    documentclass[11pt]{article}



    newcommand{classheader}[1]{newpagesection*{#1}
    phantomsection addcontentsline{toc}{section}{(#1)}
    }

    usepackage{fancyhdr}
    pagestyle{fancy}
    rfoot{parbox[t]{0.9in}{centering Page thepage\ classheader}}

    usepackage{hyperref}

    begin{document}

    thispagestyle{empty}
    tableofcontents

    newpage
    thispagestyle{empty}


    section*{Introduction}

    include{SecurityisMathematics}

    end{document}


    Security is Mathematics.tex (as an MWE)



    classheader{Security is Mathematics}
    section{Security is Mathematics}label{security-is-mathematics}

    Insert Text Here


    These two documents, compiled while in the same directory, provide the following first page as output. Not exactly what I'm looking for. Any thoughts on how to fix this and make it cleaner? Thanks all!



    Output










    share|improve this question



























      0












      0








      0







      I'm trying to figure out what I did that screwed up the formatting of this course notes template. I apologize for not having a better MWE, but it seems to all have parts together to it.



      MWE (edited):
      documentclass[11pt]{article}



      newcommand{classheader}[1]{newpagesection*{#1}
      phantomsection addcontentsline{toc}{section}{(#1)}
      }

      usepackage{fancyhdr}
      pagestyle{fancy}
      rfoot{parbox[t]{0.9in}{centering Page thepage\ classheader}}

      usepackage{hyperref}

      begin{document}

      thispagestyle{empty}
      tableofcontents

      newpage
      thispagestyle{empty}


      section*{Introduction}

      include{SecurityisMathematics}

      end{document}


      Security is Mathematics.tex (as an MWE)



      classheader{Security is Mathematics}
      section{Security is Mathematics}label{security-is-mathematics}

      Insert Text Here


      These two documents, compiled while in the same directory, provide the following first page as output. Not exactly what I'm looking for. Any thoughts on how to fix this and make it cleaner? Thanks all!



      Output










      share|improve this question















      I'm trying to figure out what I did that screwed up the formatting of this course notes template. I apologize for not having a better MWE, but it seems to all have parts together to it.



      MWE (edited):
      documentclass[11pt]{article}



      newcommand{classheader}[1]{newpagesection*{#1}
      phantomsection addcontentsline{toc}{section}{(#1)}
      }

      usepackage{fancyhdr}
      pagestyle{fancy}
      rfoot{parbox[t]{0.9in}{centering Page thepage\ classheader}}

      usepackage{hyperref}

      begin{document}

      thispagestyle{empty}
      tableofcontents

      newpage
      thispagestyle{empty}


      section*{Introduction}

      include{SecurityisMathematics}

      end{document}


      Security is Mathematics.tex (as an MWE)



      classheader{Security is Mathematics}
      section{Security is Mathematics}label{security-is-mathematics}

      Insert Text Here


      These two documents, compiled while in the same directory, provide the following first page as output. Not exactly what I'm looking for. Any thoughts on how to fix this and make it cleaner? Thanks all!



      Output







      table-of-contents formatting subfiles






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 8 at 13:50

























      asked Dec 8 at 7:09









      Michael Link

      159110




      159110






















          1 Answer
          1






          active

          oldest

          votes


















          1














          You can drastically reduce your ca 500 line long master document to the following MWE that still reproduces your problem with the table of contents:



          documentclass[11pt]{article}

          newcommand{classheader}[1]{newpagesection*{#1}
          phantomsection addcontentsline{toc}{section}{(#1)}
          }

          usepackage{fancyhdr}
          pagestyle{fancy}
          rfoot{parbox[t]{0.9in}{centering Page thepage\ classheader}}

          usepackage{hyperref}

          begin{document}

          thispagestyle{empty}
          tableofcontents

          newpage
          thispagestyle{empty}


          section*{Introduction}

          include{SecurityisMathematics}

          end{document}


          enter image description here



          If you now comment out line 4 (phantomsection...), you achieve the following output:



          enter image description here



          Applied to your original example, you get:



          enter image description here





          Apart from that, you might be interested in using a different documentclass like report or even book that are better suited for longer documents. They also provide the chapter command that automatically starts on a new page.






          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%2f463774%2fmultilined-and-misformatted-table-of-contents-in-master-subfiles-document%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









            1














            You can drastically reduce your ca 500 line long master document to the following MWE that still reproduces your problem with the table of contents:



            documentclass[11pt]{article}

            newcommand{classheader}[1]{newpagesection*{#1}
            phantomsection addcontentsline{toc}{section}{(#1)}
            }

            usepackage{fancyhdr}
            pagestyle{fancy}
            rfoot{parbox[t]{0.9in}{centering Page thepage\ classheader}}

            usepackage{hyperref}

            begin{document}

            thispagestyle{empty}
            tableofcontents

            newpage
            thispagestyle{empty}


            section*{Introduction}

            include{SecurityisMathematics}

            end{document}


            enter image description here



            If you now comment out line 4 (phantomsection...), you achieve the following output:



            enter image description here



            Applied to your original example, you get:



            enter image description here





            Apart from that, you might be interested in using a different documentclass like report or even book that are better suited for longer documents. They also provide the chapter command that automatically starts on a new page.






            share|improve this answer


























              1














              You can drastically reduce your ca 500 line long master document to the following MWE that still reproduces your problem with the table of contents:



              documentclass[11pt]{article}

              newcommand{classheader}[1]{newpagesection*{#1}
              phantomsection addcontentsline{toc}{section}{(#1)}
              }

              usepackage{fancyhdr}
              pagestyle{fancy}
              rfoot{parbox[t]{0.9in}{centering Page thepage\ classheader}}

              usepackage{hyperref}

              begin{document}

              thispagestyle{empty}
              tableofcontents

              newpage
              thispagestyle{empty}


              section*{Introduction}

              include{SecurityisMathematics}

              end{document}


              enter image description here



              If you now comment out line 4 (phantomsection...), you achieve the following output:



              enter image description here



              Applied to your original example, you get:



              enter image description here





              Apart from that, you might be interested in using a different documentclass like report or even book that are better suited for longer documents. They also provide the chapter command that automatically starts on a new page.






              share|improve this answer
























                1












                1








                1






                You can drastically reduce your ca 500 line long master document to the following MWE that still reproduces your problem with the table of contents:



                documentclass[11pt]{article}

                newcommand{classheader}[1]{newpagesection*{#1}
                phantomsection addcontentsline{toc}{section}{(#1)}
                }

                usepackage{fancyhdr}
                pagestyle{fancy}
                rfoot{parbox[t]{0.9in}{centering Page thepage\ classheader}}

                usepackage{hyperref}

                begin{document}

                thispagestyle{empty}
                tableofcontents

                newpage
                thispagestyle{empty}


                section*{Introduction}

                include{SecurityisMathematics}

                end{document}


                enter image description here



                If you now comment out line 4 (phantomsection...), you achieve the following output:



                enter image description here



                Applied to your original example, you get:



                enter image description here





                Apart from that, you might be interested in using a different documentclass like report or even book that are better suited for longer documents. They also provide the chapter command that automatically starts on a new page.






                share|improve this answer












                You can drastically reduce your ca 500 line long master document to the following MWE that still reproduces your problem with the table of contents:



                documentclass[11pt]{article}

                newcommand{classheader}[1]{newpagesection*{#1}
                phantomsection addcontentsline{toc}{section}{(#1)}
                }

                usepackage{fancyhdr}
                pagestyle{fancy}
                rfoot{parbox[t]{0.9in}{centering Page thepage\ classheader}}

                usepackage{hyperref}

                begin{document}

                thispagestyle{empty}
                tableofcontents

                newpage
                thispagestyle{empty}


                section*{Introduction}

                include{SecurityisMathematics}

                end{document}


                enter image description here



                If you now comment out line 4 (phantomsection...), you achieve the following output:



                enter image description here



                Applied to your original example, you get:



                enter image description here





                Apart from that, you might be interested in using a different documentclass like report or even book that are better suited for longer documents. They also provide the chapter command that automatically starts on a new page.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 8 at 11:03









                leandriis

                8,1071528




                8,1071528






























                    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%2f463774%2fmultilined-and-misformatted-table-of-contents-in-master-subfiles-document%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

                    Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                    ComboBox Display Member on multiple fields

                    Is it possible to collect Nectar points via Trainline?