Pandoc - how to get pagebreak between title block and the table of contents?












2














Simple markdown file, with YAML block:



---
title: Report
author: Tom Brown 12345678
date: August 2018
toc: true
numbersections: true
geometry: margin=2.5cm
urlcolor: blue
header-includes: |
usepackage{fancyhdr}
pagestyle{fancy}
lfoot{Draft Prepared: 15 August 2018}
rfoot{Page thepage}
---


When I create the PDF output, the title and ToC are on the same page. How can I get the title block on one page and the ToC on the next? I've searched high and low and cannot find a solution.










share|improve this question





























    2














    Simple markdown file, with YAML block:



    ---
    title: Report
    author: Tom Brown 12345678
    date: August 2018
    toc: true
    numbersections: true
    geometry: margin=2.5cm
    urlcolor: blue
    header-includes: |
    usepackage{fancyhdr}
    pagestyle{fancy}
    lfoot{Draft Prepared: 15 August 2018}
    rfoot{Page thepage}
    ---


    When I create the PDF output, the title and ToC are on the same page. How can I get the title block on one page and the ToC on the next? I've searched high and low and cannot find a solution.










    share|improve this question



























      2












      2








      2


      1





      Simple markdown file, with YAML block:



      ---
      title: Report
      author: Tom Brown 12345678
      date: August 2018
      toc: true
      numbersections: true
      geometry: margin=2.5cm
      urlcolor: blue
      header-includes: |
      usepackage{fancyhdr}
      pagestyle{fancy}
      lfoot{Draft Prepared: 15 August 2018}
      rfoot{Page thepage}
      ---


      When I create the PDF output, the title and ToC are on the same page. How can I get the title block on one page and the ToC on the next? I've searched high and low and cannot find a solution.










      share|improve this question















      Simple markdown file, with YAML block:



      ---
      title: Report
      author: Tom Brown 12345678
      date: August 2018
      toc: true
      numbersections: true
      geometry: margin=2.5cm
      urlcolor: blue
      header-includes: |
      usepackage{fancyhdr}
      pagestyle{fancy}
      lfoot{Draft Prepared: 15 August 2018}
      rfoot{Page thepage}
      ---


      When I create the PDF output, the title and ToC are on the same page. How can I get the title block on one page and the ToC on the next? I've searched high and low and cannot find a solution.







      pandoc






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 17 at 21:53









      Kurt Pfeifle

      9,18713555




      9,18713555










      asked Aug 15 at 5:18









      Rob

      112




      112






















          2 Answers
          2






          active

          oldest

          votes


















          3














          Pandoc allows to insert LaTeX between title and the actual document via the include-before metadata field. Adding the following to your YAML header should be sufficient:



          include-before:
          - '`newpage{}`{=latex}'





          share|improve this answer





























            1














            While @tarleb's method of course is correct and more 'YAMLish' (but less intuitive), you can also write the following into your source Markdown file:




            ---
            title: Report
            author: Tom Brown 12345678
            date: August 2018
            toc: true
            numbersections: true
            geometry: margin=2.5cm
            urlcolor: blue
            header-includes: |
            usepackage{fancyhdr}
            pagestyle{fancy}
            lfoot{Draft Prepared: 15 August 2018}
            rfoot{Page thepage}
            ---

            newpage{}

            # First Headline

            Here comes my markdown text ....





            share|improve this answer





















            • The above code only inserts a page-break between toc and content, not between title-block and toc. However, I agree that an alternative, non-YAML solution would be helpful: one could remove the toc entry from YAML and insert the newpage{} toc directly into the document.
              – tarleb
              Dec 17 at 19:50












            • Thx, @tarleb, you are right. You are a sharp observer, and I overlooked something.
              – Kurt Pfeifle
              Dec 17 at 21:52











            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            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: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            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%2fsuperuser.com%2fquestions%2f1349187%2fpandoc-how-to-get-pagebreak-between-title-block-and-the-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














            Pandoc allows to insert LaTeX between title and the actual document via the include-before metadata field. Adding the following to your YAML header should be sufficient:



            include-before:
            - '`newpage{}`{=latex}'





            share|improve this answer


























              3














              Pandoc allows to insert LaTeX between title and the actual document via the include-before metadata field. Adding the following to your YAML header should be sufficient:



              include-before:
              - '`newpage{}`{=latex}'





              share|improve this answer
























                3












                3








                3






                Pandoc allows to insert LaTeX between title and the actual document via the include-before metadata field. Adding the following to your YAML header should be sufficient:



                include-before:
                - '`newpage{}`{=latex}'





                share|improve this answer












                Pandoc allows to insert LaTeX between title and the actual document via the include-before metadata field. Adding the following to your YAML header should be sufficient:



                include-before:
                - '`newpage{}`{=latex}'






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Aug 15 at 21:25









                tarleb

                1414




                1414

























                    1














                    While @tarleb's method of course is correct and more 'YAMLish' (but less intuitive), you can also write the following into your source Markdown file:




                    ---
                    title: Report
                    author: Tom Brown 12345678
                    date: August 2018
                    toc: true
                    numbersections: true
                    geometry: margin=2.5cm
                    urlcolor: blue
                    header-includes: |
                    usepackage{fancyhdr}
                    pagestyle{fancy}
                    lfoot{Draft Prepared: 15 August 2018}
                    rfoot{Page thepage}
                    ---

                    newpage{}

                    # First Headline

                    Here comes my markdown text ....





                    share|improve this answer





















                    • The above code only inserts a page-break between toc and content, not between title-block and toc. However, I agree that an alternative, non-YAML solution would be helpful: one could remove the toc entry from YAML and insert the newpage{} toc directly into the document.
                      – tarleb
                      Dec 17 at 19:50












                    • Thx, @tarleb, you are right. You are a sharp observer, and I overlooked something.
                      – Kurt Pfeifle
                      Dec 17 at 21:52
















                    1














                    While @tarleb's method of course is correct and more 'YAMLish' (but less intuitive), you can also write the following into your source Markdown file:




                    ---
                    title: Report
                    author: Tom Brown 12345678
                    date: August 2018
                    toc: true
                    numbersections: true
                    geometry: margin=2.5cm
                    urlcolor: blue
                    header-includes: |
                    usepackage{fancyhdr}
                    pagestyle{fancy}
                    lfoot{Draft Prepared: 15 August 2018}
                    rfoot{Page thepage}
                    ---

                    newpage{}

                    # First Headline

                    Here comes my markdown text ....





                    share|improve this answer





















                    • The above code only inserts a page-break between toc and content, not between title-block and toc. However, I agree that an alternative, non-YAML solution would be helpful: one could remove the toc entry from YAML and insert the newpage{} toc directly into the document.
                      – tarleb
                      Dec 17 at 19:50












                    • Thx, @tarleb, you are right. You are a sharp observer, and I overlooked something.
                      – Kurt Pfeifle
                      Dec 17 at 21:52














                    1












                    1








                    1






                    While @tarleb's method of course is correct and more 'YAMLish' (but less intuitive), you can also write the following into your source Markdown file:




                    ---
                    title: Report
                    author: Tom Brown 12345678
                    date: August 2018
                    toc: true
                    numbersections: true
                    geometry: margin=2.5cm
                    urlcolor: blue
                    header-includes: |
                    usepackage{fancyhdr}
                    pagestyle{fancy}
                    lfoot{Draft Prepared: 15 August 2018}
                    rfoot{Page thepage}
                    ---

                    newpage{}

                    # First Headline

                    Here comes my markdown text ....





                    share|improve this answer












                    While @tarleb's method of course is correct and more 'YAMLish' (but less intuitive), you can also write the following into your source Markdown file:




                    ---
                    title: Report
                    author: Tom Brown 12345678
                    date: August 2018
                    toc: true
                    numbersections: true
                    geometry: margin=2.5cm
                    urlcolor: blue
                    header-includes: |
                    usepackage{fancyhdr}
                    pagestyle{fancy}
                    lfoot{Draft Prepared: 15 August 2018}
                    rfoot{Page thepage}
                    ---

                    newpage{}

                    # First Headline

                    Here comes my markdown text ....






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Dec 15 at 0:35









                    Kurt Pfeifle

                    9,18713555




                    9,18713555












                    • The above code only inserts a page-break between toc and content, not between title-block and toc. However, I agree that an alternative, non-YAML solution would be helpful: one could remove the toc entry from YAML and insert the newpage{} toc directly into the document.
                      – tarleb
                      Dec 17 at 19:50












                    • Thx, @tarleb, you are right. You are a sharp observer, and I overlooked something.
                      – Kurt Pfeifle
                      Dec 17 at 21:52


















                    • The above code only inserts a page-break between toc and content, not between title-block and toc. However, I agree that an alternative, non-YAML solution would be helpful: one could remove the toc entry from YAML and insert the newpage{} toc directly into the document.
                      – tarleb
                      Dec 17 at 19:50












                    • Thx, @tarleb, you are right. You are a sharp observer, and I overlooked something.
                      – Kurt Pfeifle
                      Dec 17 at 21:52
















                    The above code only inserts a page-break between toc and content, not between title-block and toc. However, I agree that an alternative, non-YAML solution would be helpful: one could remove the toc entry from YAML and insert the newpage{} toc directly into the document.
                    – tarleb
                    Dec 17 at 19:50






                    The above code only inserts a page-break between toc and content, not between title-block and toc. However, I agree that an alternative, non-YAML solution would be helpful: one could remove the toc entry from YAML and insert the newpage{} toc directly into the document.
                    – tarleb
                    Dec 17 at 19:50














                    Thx, @tarleb, you are right. You are a sharp observer, and I overlooked something.
                    – Kurt Pfeifle
                    Dec 17 at 21:52




                    Thx, @tarleb, you are right. You are a sharp observer, and I overlooked something.
                    – Kurt Pfeifle
                    Dec 17 at 21:52


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • 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%2fsuperuser.com%2fquestions%2f1349187%2fpandoc-how-to-get-pagebreak-between-title-block-and-the-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

                    flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                    Mangá

                     ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕