Changing “language” settings used by Pandoc for generated output [Pandoc template variables]












16















This is not directly a LaTeX question since I use Markdown to format my text but this subpart of "stack" seems the most correct place to ask my question.



I generate my PDF with Pandoc from markdown using the command:



pandoc myDoc.md --chapters -o result.pdf


Where it generates chapters from my markdown. This is nice, however it calls the chapters "Chapter 1", "Chapter 2" and so on and so forth (See http://cl.ly/PfRJ ). For English documents this would be okay. However my documents are in Dutch.



Is there any way I can change this? I think there is a template somewhere where it stores these things? But I can't seem to find it.










share|improve this question




















  • 1





    Welcome to TeX.SX! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you.

    – Kurt
    Jun 14 '13 at 10:56
















16















This is not directly a LaTeX question since I use Markdown to format my text but this subpart of "stack" seems the most correct place to ask my question.



I generate my PDF with Pandoc from markdown using the command:



pandoc myDoc.md --chapters -o result.pdf


Where it generates chapters from my markdown. This is nice, however it calls the chapters "Chapter 1", "Chapter 2" and so on and so forth (See http://cl.ly/PfRJ ). For English documents this would be okay. However my documents are in Dutch.



Is there any way I can change this? I think there is a template somewhere where it stores these things? But I can't seem to find it.










share|improve this question




















  • 1





    Welcome to TeX.SX! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you.

    – Kurt
    Jun 14 '13 at 10:56














16












16








16


4






This is not directly a LaTeX question since I use Markdown to format my text but this subpart of "stack" seems the most correct place to ask my question.



I generate my PDF with Pandoc from markdown using the command:



pandoc myDoc.md --chapters -o result.pdf


Where it generates chapters from my markdown. This is nice, however it calls the chapters "Chapter 1", "Chapter 2" and so on and so forth (See http://cl.ly/PfRJ ). For English documents this would be okay. However my documents are in Dutch.



Is there any way I can change this? I think there is a template somewhere where it stores these things? But I can't seem to find it.










share|improve this question
















This is not directly a LaTeX question since I use Markdown to format my text but this subpart of "stack" seems the most correct place to ask my question.



I generate my PDF with Pandoc from markdown using the command:



pandoc myDoc.md --chapters -o result.pdf


Where it generates chapters from my markdown. This is nice, however it calls the chapters "Chapter 1", "Chapter 2" and so on and so forth (See http://cl.ly/PfRJ ). For English documents this would be okay. However my documents are in Dutch.



Is there any way I can change this? I think there is a template somewhere where it stores these things? But I can't seem to find it.







chapters pandoc markdown






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 27 '15 at 9:50









Andrew

30.6k34381




30.6k34381










asked Jun 14 '13 at 10:22









MatthijnMatthijn

19015




19015








  • 1





    Welcome to TeX.SX! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you.

    – Kurt
    Jun 14 '13 at 10:56














  • 1





    Welcome to TeX.SX! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you.

    – Kurt
    Jun 14 '13 at 10:56








1




1





Welcome to TeX.SX! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you.

– Kurt
Jun 14 '13 at 10:56





Welcome to TeX.SX! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you.

– Kurt
Jun 14 '13 at 10:56










4 Answers
4






active

oldest

votes


















23














You can pass the lang option to the template using -V which passes it further to the babel package.



pandoc -V lang=dutch somefile.markdown


This is translated to the following LaTeX code which should result in dutch chapter headings.



usepackage[dutch]{babel}





share|improve this answer
























  • Awesome, I don't even need to change any templates which I thought was needed. Thanks for the solution.

    – Matthijn
    Jun 14 '13 at 11:33











  • This is right, however for some purposes i.e. bibliographies with pandoc-citeproc you will need to set the language as metadata (use -M rather than -V). This will also set the variable. This is explained here: pandoc.org/README.html#reader-options

    – twsh
    Mar 2 '16 at 21:16






  • 3





    Can you write 'dutch'? I thought you needed to use a code like 'nl'.

    – twsh
    Mar 2 '16 at 21:19



















3














It's quite simple. You have to pass the following parameter to the pandoc call.



-V lang=de



You'll have to use language parameters according to BCP 47 (like en-GB, fr, de...)



The exact behavior is described here: http://pandoc.org/README.html#language-variables






share|improve this answer































    1














    @Marco already answered your main question. However, this one is still open:




    " I think there is somewhere a template where it stores these things? But I can't seem to find it."




    If you do not refer a specific template on the Pandoc command line with --template=my-latex-template.tex, then Pandoc will use an internally available template.



    Pandoc has such templates for (almost) all output formats it can generate.



    You can print that template for LaTeX with the following command:



    pandoc -D latex | tee pandoc-default-template.latex


    If you open that template in a text editor, you'll see where it uses variables:




    1. These variables look like $varname$ -- that is, they are enclosed in $ characters.

    2. You can see what the variable names are.

    3. You can see how you can influence the outcome of the generated document by using the command line switch:
      -V varname="some value" or
      --variable=varname:"some value".






    share|improve this answer































      0














      You can also use YAML metadata to store the language settings.



      ---
      lang: nl
      ---


      Add this at the top of your markdown file. You don't need to modify your pandoc command.






      share|improve this answer
























      • Welcome to TeX.SE! Can you please add an complete example or can you add an screenshot of your solution for a fast proof?

        – Kurt
        Jan 20 at 22:58











      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%2f119132%2fchanging-language-settings-used-by-pandoc-for-generated-output-pandoc-templat%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      23














      You can pass the lang option to the template using -V which passes it further to the babel package.



      pandoc -V lang=dutch somefile.markdown


      This is translated to the following LaTeX code which should result in dutch chapter headings.



      usepackage[dutch]{babel}





      share|improve this answer
























      • Awesome, I don't even need to change any templates which I thought was needed. Thanks for the solution.

        – Matthijn
        Jun 14 '13 at 11:33











      • This is right, however for some purposes i.e. bibliographies with pandoc-citeproc you will need to set the language as metadata (use -M rather than -V). This will also set the variable. This is explained here: pandoc.org/README.html#reader-options

        – twsh
        Mar 2 '16 at 21:16






      • 3





        Can you write 'dutch'? I thought you needed to use a code like 'nl'.

        – twsh
        Mar 2 '16 at 21:19
















      23














      You can pass the lang option to the template using -V which passes it further to the babel package.



      pandoc -V lang=dutch somefile.markdown


      This is translated to the following LaTeX code which should result in dutch chapter headings.



      usepackage[dutch]{babel}





      share|improve this answer
























      • Awesome, I don't even need to change any templates which I thought was needed. Thanks for the solution.

        – Matthijn
        Jun 14 '13 at 11:33











      • This is right, however for some purposes i.e. bibliographies with pandoc-citeproc you will need to set the language as metadata (use -M rather than -V). This will also set the variable. This is explained here: pandoc.org/README.html#reader-options

        – twsh
        Mar 2 '16 at 21:16






      • 3





        Can you write 'dutch'? I thought you needed to use a code like 'nl'.

        – twsh
        Mar 2 '16 at 21:19














      23












      23








      23







      You can pass the lang option to the template using -V which passes it further to the babel package.



      pandoc -V lang=dutch somefile.markdown


      This is translated to the following LaTeX code which should result in dutch chapter headings.



      usepackage[dutch]{babel}





      share|improve this answer













      You can pass the lang option to the template using -V which passes it further to the babel package.



      pandoc -V lang=dutch somefile.markdown


      This is translated to the following LaTeX code which should result in dutch chapter headings.



      usepackage[dutch]{babel}






      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Jun 14 '13 at 10:40









      MarcoMarco

      24.1k26999




      24.1k26999













      • Awesome, I don't even need to change any templates which I thought was needed. Thanks for the solution.

        – Matthijn
        Jun 14 '13 at 11:33











      • This is right, however for some purposes i.e. bibliographies with pandoc-citeproc you will need to set the language as metadata (use -M rather than -V). This will also set the variable. This is explained here: pandoc.org/README.html#reader-options

        – twsh
        Mar 2 '16 at 21:16






      • 3





        Can you write 'dutch'? I thought you needed to use a code like 'nl'.

        – twsh
        Mar 2 '16 at 21:19



















      • Awesome, I don't even need to change any templates which I thought was needed. Thanks for the solution.

        – Matthijn
        Jun 14 '13 at 11:33











      • This is right, however for some purposes i.e. bibliographies with pandoc-citeproc you will need to set the language as metadata (use -M rather than -V). This will also set the variable. This is explained here: pandoc.org/README.html#reader-options

        – twsh
        Mar 2 '16 at 21:16






      • 3





        Can you write 'dutch'? I thought you needed to use a code like 'nl'.

        – twsh
        Mar 2 '16 at 21:19

















      Awesome, I don't even need to change any templates which I thought was needed. Thanks for the solution.

      – Matthijn
      Jun 14 '13 at 11:33





      Awesome, I don't even need to change any templates which I thought was needed. Thanks for the solution.

      – Matthijn
      Jun 14 '13 at 11:33













      This is right, however for some purposes i.e. bibliographies with pandoc-citeproc you will need to set the language as metadata (use -M rather than -V). This will also set the variable. This is explained here: pandoc.org/README.html#reader-options

      – twsh
      Mar 2 '16 at 21:16





      This is right, however for some purposes i.e. bibliographies with pandoc-citeproc you will need to set the language as metadata (use -M rather than -V). This will also set the variable. This is explained here: pandoc.org/README.html#reader-options

      – twsh
      Mar 2 '16 at 21:16




      3




      3





      Can you write 'dutch'? I thought you needed to use a code like 'nl'.

      – twsh
      Mar 2 '16 at 21:19





      Can you write 'dutch'? I thought you needed to use a code like 'nl'.

      – twsh
      Mar 2 '16 at 21:19











      3














      It's quite simple. You have to pass the following parameter to the pandoc call.



      -V lang=de



      You'll have to use language parameters according to BCP 47 (like en-GB, fr, de...)



      The exact behavior is described here: http://pandoc.org/README.html#language-variables






      share|improve this answer




























        3














        It's quite simple. You have to pass the following parameter to the pandoc call.



        -V lang=de



        You'll have to use language parameters according to BCP 47 (like en-GB, fr, de...)



        The exact behavior is described here: http://pandoc.org/README.html#language-variables






        share|improve this answer


























          3












          3








          3







          It's quite simple. You have to pass the following parameter to the pandoc call.



          -V lang=de



          You'll have to use language parameters according to BCP 47 (like en-GB, fr, de...)



          The exact behavior is described here: http://pandoc.org/README.html#language-variables






          share|improve this answer













          It's quite simple. You have to pass the following parameter to the pandoc call.



          -V lang=de



          You'll have to use language parameters according to BCP 47 (like en-GB, fr, de...)



          The exact behavior is described here: http://pandoc.org/README.html#language-variables







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 27 '16 at 9:18









          aronadaalaronadaal

          339115




          339115























              1














              @Marco already answered your main question. However, this one is still open:




              " I think there is somewhere a template where it stores these things? But I can't seem to find it."




              If you do not refer a specific template on the Pandoc command line with --template=my-latex-template.tex, then Pandoc will use an internally available template.



              Pandoc has such templates for (almost) all output formats it can generate.



              You can print that template for LaTeX with the following command:



              pandoc -D latex | tee pandoc-default-template.latex


              If you open that template in a text editor, you'll see where it uses variables:




              1. These variables look like $varname$ -- that is, they are enclosed in $ characters.

              2. You can see what the variable names are.

              3. You can see how you can influence the outcome of the generated document by using the command line switch:
                -V varname="some value" or
                --variable=varname:"some value".






              share|improve this answer




























                1














                @Marco already answered your main question. However, this one is still open:




                " I think there is somewhere a template where it stores these things? But I can't seem to find it."




                If you do not refer a specific template on the Pandoc command line with --template=my-latex-template.tex, then Pandoc will use an internally available template.



                Pandoc has such templates for (almost) all output formats it can generate.



                You can print that template for LaTeX with the following command:



                pandoc -D latex | tee pandoc-default-template.latex


                If you open that template in a text editor, you'll see where it uses variables:




                1. These variables look like $varname$ -- that is, they are enclosed in $ characters.

                2. You can see what the variable names are.

                3. You can see how you can influence the outcome of the generated document by using the command line switch:
                  -V varname="some value" or
                  --variable=varname:"some value".






                share|improve this answer


























                  1












                  1








                  1







                  @Marco already answered your main question. However, this one is still open:




                  " I think there is somewhere a template where it stores these things? But I can't seem to find it."




                  If you do not refer a specific template on the Pandoc command line with --template=my-latex-template.tex, then Pandoc will use an internally available template.



                  Pandoc has such templates for (almost) all output formats it can generate.



                  You can print that template for LaTeX with the following command:



                  pandoc -D latex | tee pandoc-default-template.latex


                  If you open that template in a text editor, you'll see where it uses variables:




                  1. These variables look like $varname$ -- that is, they are enclosed in $ characters.

                  2. You can see what the variable names are.

                  3. You can see how you can influence the outcome of the generated document by using the command line switch:
                    -V varname="some value" or
                    --variable=varname:"some value".






                  share|improve this answer













                  @Marco already answered your main question. However, this one is still open:




                  " I think there is somewhere a template where it stores these things? But I can't seem to find it."




                  If you do not refer a specific template on the Pandoc command line with --template=my-latex-template.tex, then Pandoc will use an internally available template.



                  Pandoc has such templates for (almost) all output formats it can generate.



                  You can print that template for LaTeX with the following command:



                  pandoc -D latex | tee pandoc-default-template.latex


                  If you open that template in a text editor, you'll see where it uses variables:




                  1. These variables look like $varname$ -- that is, they are enclosed in $ characters.

                  2. You can see what the variable names are.

                  3. You can see how you can influence the outcome of the generated document by using the command line switch:
                    -V varname="some value" or
                    --variable=varname:"some value".







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 25 '15 at 18:20









                  Kurt PfeifleKurt Pfeifle

                  2,50421730




                  2,50421730























                      0














                      You can also use YAML metadata to store the language settings.



                      ---
                      lang: nl
                      ---


                      Add this at the top of your markdown file. You don't need to modify your pandoc command.






                      share|improve this answer
























                      • Welcome to TeX.SE! Can you please add an complete example or can you add an screenshot of your solution for a fast proof?

                        – Kurt
                        Jan 20 at 22:58
















                      0














                      You can also use YAML metadata to store the language settings.



                      ---
                      lang: nl
                      ---


                      Add this at the top of your markdown file. You don't need to modify your pandoc command.






                      share|improve this answer
























                      • Welcome to TeX.SE! Can you please add an complete example or can you add an screenshot of your solution for a fast proof?

                        – Kurt
                        Jan 20 at 22:58














                      0












                      0








                      0







                      You can also use YAML metadata to store the language settings.



                      ---
                      lang: nl
                      ---


                      Add this at the top of your markdown file. You don't need to modify your pandoc command.






                      share|improve this answer













                      You can also use YAML metadata to store the language settings.



                      ---
                      lang: nl
                      ---


                      Add this at the top of your markdown file. You don't need to modify your pandoc command.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Jan 20 at 21:39









                      Maciej StanekMaciej Stanek

                      11




                      11













                      • Welcome to TeX.SE! Can you please add an complete example or can you add an screenshot of your solution for a fast proof?

                        – Kurt
                        Jan 20 at 22:58



















                      • Welcome to TeX.SE! Can you please add an complete example or can you add an screenshot of your solution for a fast proof?

                        – Kurt
                        Jan 20 at 22:58

















                      Welcome to TeX.SE! Can you please add an complete example or can you add an screenshot of your solution for a fast proof?

                      – Kurt
                      Jan 20 at 22:58





                      Welcome to TeX.SE! Can you please add an complete example or can you add an screenshot of your solution for a fast proof?

                      – Kurt
                      Jan 20 at 22:58


















                      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.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f119132%2fchanging-language-settings-used-by-pandoc-for-generated-output-pandoc-templat%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 send String Array data to Server using php in android

                      Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

                      Is anime1.com a legal site for watching anime?