You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by philimho April 12, 2024
Hi, I am trying to change the font in a flextable-body in a pdf output with the 'font()' function. This works fine with a markdown-file:
---
output:
pdf_document:
latex_engine: xelatex
keep_tex: true
title: "Mrkdwn_test"
mainfont: Roboto
---
## Lorem
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin suscipit, nulla eu commodo euismod, justo nisi scelerisque nulla, ut imperdiet turpis lorem vel dolor.
```{r, echo = FALSE}
library(flextable)
flextable::set_flextable_defaults(
font.family = "Roboto",
)
ft <- flextable::flextable(iris) |>
flextable::font(fontname = "Roboto Condensed", part = "body")
ft
```
The resulting pdf uses Roboto correctly for the standalone text and the column headers, while using Roboto Condensed in the flextable-body.
Now trying to do the same in quarto:
---
title: "quarto_test"
format:
pdf:
documentclass: article
pdf-engine: xelatex
mainfont: Roboto
keep-tex: true
---
## Lorem
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin suscipit, nulla eu commodo euismod, justo nisi scelerisque nulla, ut imperdiet turpis lorem vel dolor. Proin eu tincidunt nisi. Mauris volutpat purus ut iaculis venenatis. Sed a purus arcu. Maecenas non nibh libero. Ut gravida velit augue, a rhoncus massa lobortis quis. Vestibulum vestibulum dolor ac iaculis faucibus.
```{r, echo = FALSE}
library(flextable)
flextable::set_flextable_defaults(
font.family = "Roboto",
)
ft <- flextable::flextable(iris) |>
flextable::font(fontname = "Roboto Condensed", part = "body")
ft
```
Results in a pdf-file with only the mainfont, ignoring the defined font for the body of the flextable:
Any idea why the font() is not applied in the .tex file created by quarto? Sorry if this is a quarto problem rather than a flextable issue.
The text was updated successfully, but these errors were encountered:
Discussed in #624
Originally posted by philimho April 12, 2024
Hi, I am trying to change the font in a flextable-body in a pdf output with the 'font()' function. This works fine with a markdown-file:
The resulting pdf uses Roboto correctly for the standalone text and the column headers, while using Roboto Condensed in the flextable-body.
Now trying to do the same in quarto:
Results in a pdf-file with only the mainfont, ignoring the defined font for the body of the flextable:
Any idea why the font() is not applied in the .tex file created by quarto? Sorry if this is a quarto problem rather than a flextable issue.
The text was updated successfully, but these errors were encountered: