How to use Pandoc with double-byte characters?












2














I am trying to convert a Markdown document to PDF. The following works using pandoc test.md -o test.pdf:



# Test

Testing


But this



# Test

日本語


gives me an error:



! Package inputenc Error: Unicode char 日 (U+65E5)
(inputenc) not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...

l.62 日

Try running pandoc with --latex-engine=xelatex.
pandoc: Error producing PDF


Using --latex-engine=xelatex doesn't seem to help. I am using pandoc 1.19.2.1 on Mac OS X.



Using the package markdown-pdf (https://atom.io/packages/markdown-pdf) in Atom also works, but I need to use Pandoc for other reasons.










share|improve this question





























    2














    I am trying to convert a Markdown document to PDF. The following works using pandoc test.md -o test.pdf:



    # Test

    Testing


    But this



    # Test

    日本語


    gives me an error:



    ! Package inputenc Error: Unicode char 日 (U+65E5)
    (inputenc) not set up for use with LaTeX.

    See the inputenc package documentation for explanation.
    Type H <return> for immediate help.
    ...

    l.62 日

    Try running pandoc with --latex-engine=xelatex.
    pandoc: Error producing PDF


    Using --latex-engine=xelatex doesn't seem to help. I am using pandoc 1.19.2.1 on Mac OS X.



    Using the package markdown-pdf (https://atom.io/packages/markdown-pdf) in Atom also works, but I need to use Pandoc for other reasons.










    share|improve this question



























      2












      2








      2


      2





      I am trying to convert a Markdown document to PDF. The following works using pandoc test.md -o test.pdf:



      # Test

      Testing


      But this



      # Test

      日本語


      gives me an error:



      ! Package inputenc Error: Unicode char 日 (U+65E5)
      (inputenc) not set up for use with LaTeX.

      See the inputenc package documentation for explanation.
      Type H <return> for immediate help.
      ...

      l.62 日

      Try running pandoc with --latex-engine=xelatex.
      pandoc: Error producing PDF


      Using --latex-engine=xelatex doesn't seem to help. I am using pandoc 1.19.2.1 on Mac OS X.



      Using the package markdown-pdf (https://atom.io/packages/markdown-pdf) in Atom also works, but I need to use Pandoc for other reasons.










      share|improve this question















      I am trying to convert a Markdown document to PDF. The following works using pandoc test.md -o test.pdf:



      # Test

      Testing


      But this



      # Test

      日本語


      gives me an error:



      ! Package inputenc Error: Unicode char 日 (U+65E5)
      (inputenc) not set up for use with LaTeX.

      See the inputenc package documentation for explanation.
      Type H <return> for immediate help.
      ...

      l.62 日

      Try running pandoc with --latex-engine=xelatex.
      pandoc: Error producing PDF


      Using --latex-engine=xelatex doesn't seem to help. I am using pandoc 1.19.2.1 on Mac OS X.



      Using the package markdown-pdf (https://atom.io/packages/markdown-pdf) in Atom also works, but I need to use Pandoc for other reasons.







      pdf fonts markdown pandoc






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 15 at 1:20









      Kurt Pfeifle

      9,18713555




      9,18713555










      asked Oct 17 '17 at 22:19









      ceiling cat

      1,61231926




      1,61231926






















          1 Answer
          1






          active

          oldest

          votes


















          0














          The problem are not so much the double-byte characters, it's more that you need to tell Pandoc it should tell LaTeX to use a CJK font.



          For me, the current Pandoc version 2.5 on macOS works:




          1. You need to use --pdf-engine=lualatex or xelatex now (no more --latex-engine).

          2. You need to have installed the 'xecjk' package in your LaTeX installation.

          3. You need to add -V CJKmainfont=... to your command line.

          4. You need to have an appropriate font installed on your system, f.e. "STSong".


          So here goes:




          pandoc
          --pdf-engine=lualatex
          -V CJKmainfont="STSong"
          -o out.pdf
          test.md





          share|improve this answer





















            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%2f1260036%2fhow-to-use-pandoc-with-double-byte-characters%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            The problem are not so much the double-byte characters, it's more that you need to tell Pandoc it should tell LaTeX to use a CJK font.



            For me, the current Pandoc version 2.5 on macOS works:




            1. You need to use --pdf-engine=lualatex or xelatex now (no more --latex-engine).

            2. You need to have installed the 'xecjk' package in your LaTeX installation.

            3. You need to add -V CJKmainfont=... to your command line.

            4. You need to have an appropriate font installed on your system, f.e. "STSong".


            So here goes:




            pandoc
            --pdf-engine=lualatex
            -V CJKmainfont="STSong"
            -o out.pdf
            test.md





            share|improve this answer


























              0














              The problem are not so much the double-byte characters, it's more that you need to tell Pandoc it should tell LaTeX to use a CJK font.



              For me, the current Pandoc version 2.5 on macOS works:




              1. You need to use --pdf-engine=lualatex or xelatex now (no more --latex-engine).

              2. You need to have installed the 'xecjk' package in your LaTeX installation.

              3. You need to add -V CJKmainfont=... to your command line.

              4. You need to have an appropriate font installed on your system, f.e. "STSong".


              So here goes:




              pandoc
              --pdf-engine=lualatex
              -V CJKmainfont="STSong"
              -o out.pdf
              test.md





              share|improve this answer
























                0












                0








                0






                The problem are not so much the double-byte characters, it's more that you need to tell Pandoc it should tell LaTeX to use a CJK font.



                For me, the current Pandoc version 2.5 on macOS works:




                1. You need to use --pdf-engine=lualatex or xelatex now (no more --latex-engine).

                2. You need to have installed the 'xecjk' package in your LaTeX installation.

                3. You need to add -V CJKmainfont=... to your command line.

                4. You need to have an appropriate font installed on your system, f.e. "STSong".


                So here goes:




                pandoc
                --pdf-engine=lualatex
                -V CJKmainfont="STSong"
                -o out.pdf
                test.md





                share|improve this answer












                The problem are not so much the double-byte characters, it's more that you need to tell Pandoc it should tell LaTeX to use a CJK font.



                For me, the current Pandoc version 2.5 on macOS works:




                1. You need to use --pdf-engine=lualatex or xelatex now (no more --latex-engine).

                2. You need to have installed the 'xecjk' package in your LaTeX installation.

                3. You need to add -V CJKmainfont=... to your command line.

                4. You need to have an appropriate font installed on your system, f.e. "STSong".


                So here goes:




                pandoc
                --pdf-engine=lualatex
                -V CJKmainfont="STSong"
                -o out.pdf
                test.md






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 15 at 1:17









                Kurt Pfeifle

                9,18713555




                9,18713555






























                    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%2f1260036%2fhow-to-use-pandoc-with-double-byte-characters%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á

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