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
How can I do this with Pandoc?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
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 my.markdown -o emoji.pdf --pdf-engine=lualatex -V mainfonts="DejaVu Sans" pandoc my.markdown -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.
Thanks to @jpnadas for noticing a typo in my answer. The parameter should be
-V mainfont=... (not
I leave it to the reader(s) to test the correct commands and look at their results:
pandoc -o emoji.pdf --pdf-engine=lualatex -V mainfont="DejaVu Sans" pandoc -o emoji.pdf --pdf-engine=xelatex -V mainfont="DejaVu Sans"