gt() doesn't show Euro-Sign € in PDF, showing EUR instead
When it comes to using tidyverse in non-American contexts it gets often a little
bit tricky. The last time I encountered a problem was when I tried to show the
Euro-sign (€) in a PDF created with quarto
and the gt
-package.
Using html as output format everything was fine, but when I tried to create a PDF the Euro-sign was replaced by EUR.
There’s already an open issue at github ([ https://github.com/rstudio/gt/issues/1345]). But it’s getting pushed further and further down on the list of expected release versions.
So I had to find a workaround. The easiest way for me was to use fmt_number()
followed
by text_transfor()
instead of fmt_currency()
.
So I format the columns with fmt_number()
and then add the Euro-sign using paste0()
and the unicode for the Euro-sign (\u20AC).
|
|