I want to use fontawesome symbols in an md yaml-block that then get converted into latex and from there to pdf.

I used the fontawesome package in xelatex and I tried to convert a string in an md yaml-block to something like \faTwitter in latex. It didn't work, though. Pandoc either deletes the string so that it cannot render from xelatex to pdf, or it interprets it as literal, which also prevents xelatex from rendering it.

any idea how to use fontawesome with markdown and pandoc?

  • Could you post some code?
    – DG'
    Oct 15, 2018 at 7:21

1 Answer 1


This seems to work:

    - '\defaultfontfeatures{Extension = .otf}'
    - '\usepackage{fontawesome}'
author: '\faTwitter @Author'
title: 'Title'

# My Paper
\faTwitterSquare @Author

Then run pandoc like this: pandoc filename.md --pdf-engine=xelatex -o filename.pdf

enter image description here

  • 1
    I actually think that it's a bug and shouldn't be necessary at all. Glad it works for you
    – DG'
    Oct 17, 2018 at 21:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .