March 4, 2023
| デザイン性 | 労力 | 保守性 | |
|---|---|---|---|
| Powerpoint | 👩🎨 | ❌ | ❌ | 
| Beamer | ❌ | ✔️ | ✔️ | 
| Quarto | ✔️ | ✔️ | ✔️ | 
---で区切りますより複雑な例はTom Mockのこの部分のプレゼンをみるとよいと思います
.columns というクラスの中で.column とその widthを指定することで, 縦割りにできます. 3つ以上の分割も可能です.
custom.scss
// fonts
$font-family-sans-serif: Montserrat, sans-serif !default;
$font-family-monospace: "Fira Code", monospace  !default;
// colors
$body-bg: #fff !default;
$body-color: #272822 !default;
$link-color: #055099 !default;
// headings
$presentation-heading-font: "Josefin Sans", sans-serif !default;
$presentation-heading-color: #1C5253 !default;
$h1-font-size: 1.6em !default;
$h2-font-size: 1.3em !default;
$h3-font-size: 1.15em !default;
$h4-font-size: 1em !default;SASS変数(リスト) をscssファイルの中で指定することで, テーマをカスタムできます
グローバル設定
font_title <- "Josefin Sans"
font_text <- "Montserrat"
size_base <- 20
theme_set(theme_minimal(
            base_size = size_base,
            base_family = font_text))
theme_update(
  plot.title = element_text(
                size = size_base * 1.2,
                face = "bold",
                family = font_title),
  panel.grid.minor = element_blank(),
  legend.position = "bottom",
  plot.title.position = "plot"
)オリジナルテーマ
theme_quarto <- function(
                  font_title = "Josefin Sans",
                  font_text = "Montserrat",
                  size_base = 20) {
  theme_minimal(base_family = font_text,
                base_size = size_base) +
    theme(
      plot.title = element_text(
                    size = size_base * 1.2,
                    face = "bold",
                    family = font_title),
      panel.grid.minor = element_blank(),
      legend.position = "bottom",
      plot.title.position = "plot"
    )
}デフォルトのカラーパレットを替えたければ, 以下のようにできます
scale_colour_discrete <- function(...) {
  scale_colour_manual(values = c("#00AFBB", "#E7B800", "#FC4E07"))
}
scale_fill_discrete <- function(...) {
  scale_fill_manual(values = c("#00AFBB", "#E7B800", "#FC4E07"))
}しかし, このやり方だと例外が多く発生してしまったので, 私は基本的に
scale_*_manual() で毎回指定geom_point(color = color_base) なども毎回指定していますメインとアクセントカラーの選び方は, HUE/360などを参考にすればいいと思います
gghighlightgghighlightで色を絞りましょうkazuyanagimoto/quartomonothemerというパッケージを作りました.
style_mono_quarto() を実行するとcustom.scssが作られるtheme_quarto() というggplot2のテーマが作られる (フォントのみ)library(showtext)
library(quartomonothemer)
font_title <- "Noto Sans JP"
font_text <- "Noto Sans JP"
font_code <- "Fira Code"
color_base <- "#0086AB"
font_add_google(font_title)
font_add_google(font_code)
showtext_auto()
style_mono_quarto(
  font_title = font_title,
  font_text = font_text,
  font_code = font_code,
  google_fonts = c(font_title, font_code),
  color_base = color_base
)MarkdownやkableExtraもいいですが, プレゼン用ではgtExtrasが便利だと思います.
gtは文法がkableExtraより, 洗練されているgt_highlight_rows() が簡単できれい. 色はベースカラーの薄い色がおすすめ一部だけをCSSで見た目を変更したい場合は, 以下のようにstyle環境で調整します.
SASS変数にない部分でデザインの変更をしたい場合は, custom.scssに書くか, Quartoファイルにコードブロックとして書きましょう
ちょっとした図の挿入にはDraw.io Intergrationがいいです
*.drawio.svg, *.drawio.pngというファイル名ならエクスポートせずに図を使えるkazuyanagimoto/quartomonothemer・ Codes for Today’s Slides