0

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 '18 at 7:21
2

This seems to work:

---
header-includes:
    - '\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 '18 at 21:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.