knitr::opts_chunk$set(echo = F)
# グラフの標準フォント設定
# うまく行かない場合は手動で設定してください
rmdja::set_graphics_font(rmdja::get_default_font_family("xelatex")["serif"])

rmdja パッケージテンプレートの使い方

bookdown の機能をフルに使うには, 以下の点に注意してください.

  1. "Knit" ボタンではなく Build ペーンから文書をビルドする
  2. 最初に読み込むファイルは必ず index.Rmd という名前にする

図 \@ref(fig:plot) を見よ.

(ref:ggplot-example-article) ggplot2 を使用したデータのプロット

ggplot(mutate(mtcars, cyl = factor(cyl)),
       aes(x = mpg, y = wt, color = cyl)) +
  geom_point() + labs(x = "マイル毎米ガロン", y = "重量 (1000ポンド)") +
  theme_bw(base_family = rmdja::get_default_font_family("lualatex")["serif"]) +
  scale_color_grey() + scale_fill_grey()

表 \@ref(tab:example-table) を見よ

knitr::kable(head(mtcars[, 1:4]), caption = "表の例", booktabs = T)

このファイルの出力例は以下のコマンドでコピーすることができます.

file.copy(system.file("resources/examples/templates/pdf_book_ja/", package = "rmdja"), "./", recursive = T)


Gedevan-Aleksizde/rmdja documentation built on Sept. 28, 2021, 2:49 a.m.