Can't make fontawesome work with pdf

I'm trying to print icons using fontawesome in pdf documents. Although the package now seems to supports pdf, I can't make it work.

E.g., the following only prints "foo".

output: pdf_document

#| echo: false
#| results: asis

paste("foo", fontawesome::fa("orcid")) |> cat()

You should not include that in a paste and behind a cat. This will prevent knitr to know what to do with the output, and load the right dependencies and right syntax for the chosen output format.

Use inline R code

output: pdf_document

foo `r fontawesome::fa("orcid")`

See examples in README: GitHub - rstudio/fontawesome: Easily insert FontAwesome icons into R Markdown docs and Shiny apps

1 Like

Thanks for your reply.

Then I guess what I initially wanted to do isn't possible since I needed to produce this kind of output dynamically:

Too bad, I'll stick to my clumsy solution for now :slight_smile:

I don't really understand how this related to your try with a chunk instead of an inline.

This looks like the author part of a paper to me. To do this kind of things, we usually to this at the Latex template level when processing the author field.

See example in rticles package, like JSS

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.