Quarto Book: Setting default theme for tables

Hello,

I am writing a book in quarto. I want to set a consistent theme for all tables in the book. Usually in bookdown, I set it with a block that goes as below in the index.Rmd

my_ggplot_theme <- ggplot2::theme_minimal() +
  ggplot2::theme(
    plot.title = element_text(hjust = 0.5, size = 16, face = "bold"),
  )
theme_set(my_ggplot_theme)

Now in quarto, with the whole knit and merge concept, do I have to set it in every chapter? Is there no DRY way?

Hi @ibnishak ,

currently this is not possible in quarto. You will have to redo the setup at the start of every chapter.

Aight. Thanks. I hope they come up with something for that.

You could always have an external script in a ".R" file and call it from within a chunk at the beginning of every chapter. That way you would at least avoid duplicating code with all its risks.

This topic was automatically closed 90 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.