Rendering PDF from Markdown file with literal emoji characters using Pandoc












2














I'd like to convert markdown text like:



This is a smile 😀


To a PDF with the emoji on it. To be clear, I want to be able to insert the emoji character itself in the source text, not something like :smile:.



How can I do this with Pandoc?










share|improve this question



























    2














    I'd like to convert markdown text like:



    This is a smile 😀


    To a PDF with the emoji on it. To be clear, I want to be able to insert the emoji character itself in the source text, not something like :smile:.



    How can I do this with Pandoc?










    share|improve this question

























      2












      2








      2


      1





      I'd like to convert markdown text like:



      This is a smile 😀


      To a PDF with the emoji on it. To be clear, I want to be able to insert the emoji character itself in the source text, not something like :smile:.



      How can I do this with Pandoc?










      share|improve this question













      I'd like to convert markdown text like:



      This is a smile 😀


      To a PDF with the emoji on it. To be clear, I want to be able to insert the emoji character itself in the source text, not something like :smile:.



      How can I do this with Pandoc?







      markdown pandoc






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 14 at 20:45









      hsribei

      2,65793130




      2,65793130






















          2 Answers
          2






          active

          oldest

          votes


















          1














          Try replacing the :smile: with HTML like so:



          This is a smile <img src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f604.png"/>





          share|improve this answer

















          • 1




            Thing is I have sources with literal emoji already and I'm specifically trying to not have to replace them with anything, but have the unicode characters be properly rendered directly.
            – hsribei
            Oct 22 at 23:36



















          0














          After initially having read the OP too superficially (overlooking his need to NOT use :smile: & friends in his source Markdown), here is a better answer. Try one of these:



          pandoc -o emoji.pdf --pdf-engine=lualatex -V mainfonts="DejaVu Sans"
          pandoc -o emoji.pdf --pdf-engine=xelatex -V mainfonts="DejaVu Sans"


          If you use the default pdf-engine (pdflatex), you'll not succeed, but get an error like



           ! Package inputenc Error: Unicode character 😀 (U+1F600)
          (inputenc) not set up for use with LaTeX.


          If you do not specify the mainfonts param, you'll get an warning message of



           [WARNING] Missing character: There is no 😄 (U+1F604) in font [lmroman10-regular]:+tlig;


          for XeLaTeX and of



           [WARNING] Missing character: There is no 😄 in font [lmroman10-regular]:mapping=tex-text;!


          for LuaLaTeX. While both will be producing a PDF, they'll have no emoji where you wanted it.






          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%2f1366748%2frendering-pdf-from-markdown-file-with-literal-emoji-characters-using-pandoc%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









            1














            Try replacing the :smile: with HTML like so:



            This is a smile <img src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f604.png"/>





            share|improve this answer

















            • 1




              Thing is I have sources with literal emoji already and I'm specifically trying to not have to replace them with anything, but have the unicode characters be properly rendered directly.
              – hsribei
              Oct 22 at 23:36
















            1














            Try replacing the :smile: with HTML like so:



            This is a smile <img src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f604.png"/>





            share|improve this answer

















            • 1




              Thing is I have sources with literal emoji already and I'm specifically trying to not have to replace them with anything, but have the unicode characters be properly rendered directly.
              – hsribei
              Oct 22 at 23:36














            1












            1








            1






            Try replacing the :smile: with HTML like so:



            This is a smile <img src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f604.png"/>





            share|improve this answer












            Try replacing the :smile: with HTML like so:



            This is a smile <img src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f604.png"/>






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Oct 18 at 7:52









            Adam J Limbert

            171112




            171112








            • 1




              Thing is I have sources with literal emoji already and I'm specifically trying to not have to replace them with anything, but have the unicode characters be properly rendered directly.
              – hsribei
              Oct 22 at 23:36














            • 1




              Thing is I have sources with literal emoji already and I'm specifically trying to not have to replace them with anything, but have the unicode characters be properly rendered directly.
              – hsribei
              Oct 22 at 23:36








            1




            1




            Thing is I have sources with literal emoji already and I'm specifically trying to not have to replace them with anything, but have the unicode characters be properly rendered directly.
            – hsribei
            Oct 22 at 23:36




            Thing is I have sources with literal emoji already and I'm specifically trying to not have to replace them with anything, but have the unicode characters be properly rendered directly.
            – hsribei
            Oct 22 at 23:36













            0














            After initially having read the OP too superficially (overlooking his need to NOT use :smile: & friends in his source Markdown), here is a better answer. Try one of these:



            pandoc -o emoji.pdf --pdf-engine=lualatex -V mainfonts="DejaVu Sans"
            pandoc -o emoji.pdf --pdf-engine=xelatex -V mainfonts="DejaVu Sans"


            If you use the default pdf-engine (pdflatex), you'll not succeed, but get an error like



             ! Package inputenc Error: Unicode character 😀 (U+1F600)
            (inputenc) not set up for use with LaTeX.


            If you do not specify the mainfonts param, you'll get an warning message of



             [WARNING] Missing character: There is no 😄 (U+1F604) in font [lmroman10-regular]:+tlig;


            for XeLaTeX and of



             [WARNING] Missing character: There is no 😄 in font [lmroman10-regular]:mapping=tex-text;!


            for LuaLaTeX. While both will be producing a PDF, they'll have no emoji where you wanted it.






            share|improve this answer




























              0














              After initially having read the OP too superficially (overlooking his need to NOT use :smile: & friends in his source Markdown), here is a better answer. Try one of these:



              pandoc -o emoji.pdf --pdf-engine=lualatex -V mainfonts="DejaVu Sans"
              pandoc -o emoji.pdf --pdf-engine=xelatex -V mainfonts="DejaVu Sans"


              If you use the default pdf-engine (pdflatex), you'll not succeed, but get an error like



               ! Package inputenc Error: Unicode character 😀 (U+1F600)
              (inputenc) not set up for use with LaTeX.


              If you do not specify the mainfonts param, you'll get an warning message of



               [WARNING] Missing character: There is no 😄 (U+1F604) in font [lmroman10-regular]:+tlig;


              for XeLaTeX and of



               [WARNING] Missing character: There is no 😄 in font [lmroman10-regular]:mapping=tex-text;!


              for LuaLaTeX. While both will be producing a PDF, they'll have no emoji where you wanted it.






              share|improve this answer


























                0












                0








                0






                After initially having read the OP too superficially (overlooking his need to NOT use :smile: & friends in his source Markdown), here is a better answer. Try one of these:



                pandoc -o emoji.pdf --pdf-engine=lualatex -V mainfonts="DejaVu Sans"
                pandoc -o emoji.pdf --pdf-engine=xelatex -V mainfonts="DejaVu Sans"


                If you use the default pdf-engine (pdflatex), you'll not succeed, but get an error like



                 ! Package inputenc Error: Unicode character 😀 (U+1F600)
                (inputenc) not set up for use with LaTeX.


                If you do not specify the mainfonts param, you'll get an warning message of



                 [WARNING] Missing character: There is no 😄 (U+1F604) in font [lmroman10-regular]:+tlig;


                for XeLaTeX and of



                 [WARNING] Missing character: There is no 😄 in font [lmroman10-regular]:mapping=tex-text;!


                for LuaLaTeX. While both will be producing a PDF, they'll have no emoji where you wanted it.






                share|improve this answer














                After initially having read the OP too superficially (overlooking his need to NOT use :smile: & friends in his source Markdown), here is a better answer. Try one of these:



                pandoc -o emoji.pdf --pdf-engine=lualatex -V mainfonts="DejaVu Sans"
                pandoc -o emoji.pdf --pdf-engine=xelatex -V mainfonts="DejaVu Sans"


                If you use the default pdf-engine (pdflatex), you'll not succeed, but get an error like



                 ! Package inputenc Error: Unicode character 😀 (U+1F600)
                (inputenc) not set up for use with LaTeX.


                If you do not specify the mainfonts param, you'll get an warning message of



                 [WARNING] Missing character: There is no 😄 (U+1F604) in font [lmroman10-regular]:+tlig;


                for XeLaTeX and of



                 [WARNING] Missing character: There is no 😄 in font [lmroman10-regular]:mapping=tex-text;!


                for LuaLaTeX. While both will be producing a PDF, they'll have no emoji where you wanted it.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Dec 17 at 16:12

























                answered Dec 14 at 23:30









                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%2f1366748%2frendering-pdf-from-markdown-file-with-literal-emoji-characters-using-pandoc%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á

                    Eduardo VII do Reino Unido