😎 Give your xaringan slides some style
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

361 行
29KB

  1. <!DOCTYPE html>
  2. <!-- Generated by pkgdown: do not edit by hand --><html lang="en">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>Xaringan CSS Theme Generator • xaringanthemer</title>
  9. <!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/yeti/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
  10. <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous">
  11. <!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
  12. <script src="../pkgdown.js"></script><meta property="og:title" content="Xaringan CSS Theme Generator">
  13. <meta property="og:description" content="">
  14. <meta name="twitter:card" content="summary">
  15. <!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
  16. <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  17. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  18. <![endif]-->
  19. </head>
  20. <body>
  21. <div class="container template-article">
  22. <header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
  23. <div class="container">
  24. <div class="navbar-header">
  25. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
  26. <span class="sr-only">Toggle navigation</span>
  27. <span class="icon-bar"></span>
  28. <span class="icon-bar"></span>
  29. <span class="icon-bar"></span>
  30. </button>
  31. <span class="navbar-brand">
  32. <a class="navbar-link" href="../index.html">xaringanthemer</a>
  33. <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.2.0.9000</span>
  34. </span>
  35. </div>
  36. <div id="navbar" class="navbar-collapse collapse">
  37. <ul class="nav navbar-nav">
  38. <li>
  39. <a href="../index.html">
  40. <span class="fa fa-home fa-lg"></span>
  41. </a>
  42. </li>
  43. <li>
  44. <a href="../articles/xaringanthemer.html">Get started</a>
  45. </li>
  46. <li>
  47. <a href="../articles/singles/themes.html">Themes</a>
  48. </li>
  49. <li>
  50. <a href="../articles/singles/fonts.html">Fonts</a>
  51. </li>
  52. <li>
  53. <a href="../articles/template-variables.html">Template Variables</a>
  54. </li>
  55. <li>
  56. <a href="../articles/css-help.html">CSS Help</a>
  57. </li>
  58. <li>
  59. <a href="../reference/index.html">Reference</a>
  60. </li>
  61. </ul>
  62. <ul class="nav navbar-nav navbar-right">
  63. <li>
  64. <a href="https://github.com/gadenbuie/xaringanthemer">
  65. <span class="fa fa-github fa-lg"></span>
  66. </a>
  67. </li>
  68. <li>
  69. <a href="https://twitter.com/grrrck">
  70. <span class="fa fa-twitter fa-lg"></span>
  71. </a>
  72. </li>
  73. </ul>
  74. </div>
  75. <!--/.nav-collapse -->
  76. </div>
  77. <!--/.container -->
  78. </div>
  79. <!--/.navbar -->
  80. </header><div class="row">
  81. <div class="col-md-9 contents">
  82. <div class="page-header toc-ignore">
  83. <h1>Xaringan CSS Theme Generator</h1>
  84. <small class="dont-index">Source: <a href="https://github.com/gadenbuie/xaringanthemer/blob/master/vignettes/xaringanthemer.Rmd"><code>vignettes/xaringanthemer.Rmd</code></a></small>
  85. <div class="hidden name"><code>xaringanthemer.Rmd</code></div>
  86. </div>
  87. <!-- This vignette was automatically created from README.Rmd
  88. Please consider removing installation instructions, badges, and
  89. any other README-specific material.
  90. You can include short independent documents in README.Rmd using
  91. the following chunk argument syntax:
  92. child='vignettes/rmdhunks/example1.Rmd'
  93. https://yihui.name/knitr/demo/child/
  94. or read-in chunks stored in an independent R script using knitr::read_chunk()
  95. https://yihui.name/knitr/demo/externalization/ -->
  96. <!-- README.md is generated from README.Rmd. Please edit that file -->
  97. <p>Jump to: <a href="#quick-intro">Quick Intro</a>, <a href="#themes">Themes</a>, <a href="#theme-settings">Theme Settings</a>, <a href="#adding-custom-css">Adding Custom CSS</a>, <a href="#fonts">Fonts</a></p>
  98. <div id="quick-intro" class="section level2">
  99. <h2 class="hasAnchor">
  100. <a href="#quick-intro" class="anchor"></a>Quick Intro</h2>
  101. <!-- Set link to theme-settings, template-variables, theme functions -->
  102. <p>First, add the <code>xaringan-themer.css</code> file to the YAML header of your xaringan slides.</p>
  103. <div class="sourceCode" id="cb1"><pre class="sourceCode yaml"><code class="sourceCode yaml"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="fu">output:</span></a>
  104. <a class="sourceLine" id="cb1-2" data-line-number="2"> <span class="fu">xaringan:</span><span class="at">:moon_reader:</span></a>
  105. <a class="sourceLine" id="cb1-3" data-line-number="3"> <span class="fu">lib_dir:</span><span class="at"> libs</span></a>
  106. <a class="sourceLine" id="cb1-4" data-line-number="4"> <span class="fu">css:</span><span class="at"> xaringan-themer.css</span></a></code></pre></div>
  107. <p>Then, in a hidden chunk just after the knitr setup chunk, load <strong>xaringanthemer</strong> and try one of the <a href="#themes">theme functions</a>.</p>
  108. <div class="sourceCode" id="cb2"><pre class="sourceCode markdown"><code class="sourceCode markdown"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="bn">```{r xaringan-themer, include = FALSE}</span></a>
  109. <a class="sourceLine" id="cb2-2" data-line-number="2"><span class="bn">library(xaringanthemer)</span></a>
  110. <a class="sourceLine" id="cb2-3" data-line-number="3"><span class="bn">style_mono_light(</span></a>
  111. <a class="sourceLine" id="cb2-4" data-line-number="4"><span class="bn"> base_color = "#1c5253",</span></a>
  112. <a class="sourceLine" id="cb2-5" data-line-number="5"><span class="bn"> header_font_google = google_font("Josefin Sans"),</span></a>
  113. <a class="sourceLine" id="cb2-6" data-line-number="6"><span class="bn"> text_font_google = google_font("Montserrat", "300", "300i"),</span></a>
  114. <a class="sourceLine" id="cb2-7" data-line-number="7"><span class="bn"> code_font_google = google_font("Droid Mono")</span></a>
  115. <a class="sourceLine" id="cb2-8" data-line-number="8"><span class="bn">)</span></a>
  116. <a class="sourceLine" id="cb2-9" data-line-number="9"><span class="bn">```</span></a></code></pre></div>
  117. <p><img src="images/example_mono_light_1c5253.png" width="100%"></p>
  118. <div id="tab-completion" class="section level3">
  119. <h3 class="hasAnchor">
  120. <a href="#tab-completion" class="anchor"></a>Tab Completion</h3>
  121. <p><strong>xaringanthemer</strong> is <kbd>Tab</kbd> friendly – <a href="#theme-settings">use autocomplete to explore</a> the <a href="template-variables.html">template variables</a> that you can adjust in each of the themes!</p>
  122. <p><img src="images/example-rstudio-completion.gif" width="100%"></p>
  123. </div>
  124. <div id="r-markdown-template-in-rstudio" class="section level3">
  125. <h3 class="hasAnchor">
  126. <a href="#r-markdown-template-in-rstudio" class="anchor"></a>R Markdown Template in RStudio</h3>
  127. <p>You can also skip the above and just create a <em>Ninja Themed Presentation</em> from the New R Markdown Document menu in RStudio.</p>
  128. <center>
  129. <img src="images/rmarkdown-template-screenshot.png" width="350px">
  130. </center>
  131. </div>
  132. </div>
  133. <div id="themes" class="section level2">
  134. <h2 class="hasAnchor">
  135. <a href="#themes" class="anchor"></a>Themes</h2>
  136. <div id="monotone" class="section level3">
  137. <h3 class="hasAnchor">
  138. <a href="#monotone" class="anchor"></a>Monotone</h3>
  139. <p>Use these functions to automatically create a consistent color palette for your slides, based around a single color.</p>
  140. <div id="style_mono_light" class="section level4">
  141. <h4 class="hasAnchor">
  142. <a href="#style_mono_light" class="anchor"></a><code><a href="../reference/style_mono_light.html">style_mono_light()</a></code>
  143. </h4>
  144. <p>A light theme based around a single color.</p>
  145. <div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="kw"><a href="../reference/style_mono_light.html">style_mono_light</a></span>(<span class="dt">base_color =</span> <span class="st">"#23395b"</span>)</a></code></pre></div>
  146. <p><img src="images/example_mono_light.png" width="100%"></p>
  147. </div>
  148. <div id="style_mono_dark" class="section level4">
  149. <h4 class="hasAnchor">
  150. <a href="#style_mono_dark" class="anchor"></a><code><a href="../reference/style_mono_dark.html">style_mono_dark()</a></code>
  151. </h4>
  152. <p>A dark theme based around a single color.</p>
  153. <div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1"><span class="kw"><a href="../reference/style_mono_dark.html">style_mono_dark</a></span>(<span class="dt">base_color =</span> <span class="st">"#cbf7ed"</span>)</a></code></pre></div>
  154. <p><img src="images/example_mono_dark.png" width="100%"></p>
  155. </div>
  156. <div id="style_mono_accent" class="section level4">
  157. <h4 class="hasAnchor">
  158. <a href="#style_mono_accent" class="anchor"></a><code><a href="../reference/style_mono_accent.html">style_mono_accent()</a></code>
  159. </h4>
  160. <p>The default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.).</p>
  161. <div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1"><span class="kw"><a href="../reference/style_mono_accent.html">style_mono_accent</a></span>(<span class="dt">base_color =</span> <span class="st">"#43418A"</span>)</a></code></pre></div>
  162. <p><img src="images/example_mono_accent.png" width="100%"></p>
  163. </div>
  164. <div id="style_mono_accent_inverse" class="section level4">
  165. <h4 class="hasAnchor">
  166. <a href="#style_mono_accent_inverse" class="anchor"></a><code><a href="../reference/style_mono_accent_inverse.html">style_mono_accent_inverse()</a></code>
  167. </h4>
  168. <p>An “inverted” default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.).</p>
  169. <div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1"><span class="kw"><a href="../reference/style_mono_accent_inverse.html">style_mono_accent_inverse</a></span>(<span class="dt">base_color =</span> <span class="st">"#3C989E"</span>)</a></code></pre></div>
  170. <p><img src="images/example_mono_accent_inverse.png" width="100%"></p>
  171. </div>
  172. </div>
  173. <div id="duotone" class="section level3">
  174. <h3 class="hasAnchor">
  175. <a href="#duotone" class="anchor"></a>Duotone</h3>
  176. <p>These themes build from two (ideally) complementary colors.</p>
  177. <div id="style_duo" class="section level4">
  178. <h4 class="hasAnchor">
  179. <a href="#style_duo" class="anchor"></a><code><a href="../reference/style_duo.html">style_duo()</a></code>
  180. </h4>
  181. <p>A two-colored theme based on a primary and secondary color.</p>
  182. <div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1"><span class="kw"><a href="../reference/style_duo.html">style_duo</a></span>(<span class="dt">primary_color =</span> <span class="st">"#1F4257"</span>, <span class="dt">secondary_color =</span> <span class="st">"#F97B64"</span>)</a></code></pre></div>
  183. <p><img src="images/example_duo.png" width="100%"></p>
  184. </div>
  185. <div id="style_duo_accent" class="section level4">
  186. <h4 class="hasAnchor">
  187. <a href="#style_duo_accent" class="anchor"></a><code><a href="../reference/style_duo_accent.html">style_duo_accent()</a></code>
  188. </h4>
  189. <p>The default Xaringan theme with two accent colors.</p>
  190. <div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" data-line-number="1"><span class="kw"><a href="../reference/style_duo_accent.html">style_duo_accent</a></span>(<span class="dt">primary_color =</span> <span class="st">"#006747"</span>, <span class="dt">secondary_color =</span> <span class="st">"#CFC493"</span>)</a></code></pre></div>
  191. <p><img src="images/example_duo_accent.png" width="100%"></p>
  192. </div>
  193. <div id="style_duo_accent_inverse" class="section level4">
  194. <h4 class="hasAnchor">
  195. <a href="#style_duo_accent_inverse" class="anchor"></a><code><a href="../reference/style_duo_accent_inverse.html">style_duo_accent_inverse()</a></code>
  196. </h4>
  197. <p>An “inverted” default Xaringan theme with two accent colors.</p>
  198. <div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" data-line-number="1"><span class="kw"><a href="../reference/style_duo_accent_inverse.html">style_duo_accent_inverse</a></span>(<span class="dt">primary_color =</span> <span class="st">"#006747"</span>, <span class="dt">secondary_color =</span> <span class="st">"#CFC493"</span>)</a></code></pre></div>
  199. <p><img src="images/example_duo_accent_inverse.png" width="100%"></p>
  200. </div>
  201. </div>
  202. <div id="solarized" class="section level3">
  203. <h3 class="hasAnchor">
  204. <a href="#solarized" class="anchor"></a>Solarized</h3>
  205. <p>There are also two themes based around the <a href="http://ethanschoonover.com/solarized">solarized color palette</a>, <code><a href="../reference/style_solarized_light.html">style_solarized_light()</a></code> and <code><a href="../reference/style_solarized_dark.html">style_solarized_dark()</a></code>. For both themes, it is advisted to change the syntax highlighting theme to <code>solarized-light</code> or <code>solarized-dark</code> (looks great paired or constrasted).</p>
  206. <div id="style_solarized_light" class="section level4">
  207. <h4 class="hasAnchor">
  208. <a href="#style_solarized_light" class="anchor"></a><code><a href="../reference/style_solarized_light.html">style_solarized_light()</a></code>
  209. </h4>
  210. <div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" data-line-number="1"><span class="kw"><a href="../reference/style_solarized_light.html">style_solarized_light</a></span>()</a></code></pre></div>
  211. <p><img src="images/example_solarized_light.png" width="100%"></p>
  212. </div>
  213. <div id="style_solarized_dark" class="section level4">
  214. <h4 class="hasAnchor">
  215. <a href="#style_solarized_dark" class="anchor"></a><code><a href="../reference/style_solarized_dark.html">style_solarized_dark()</a></code>
  216. </h4>
  217. <div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" data-line-number="1"><span class="kw"><a href="../reference/style_solarized_dark.html">style_solarized_dark</a></span>()</a></code></pre></div>
  218. <p><img src="images/example_solarized_dark.png" width="100%"></p>
  219. <p>To do this, your YAML header should look more-or-less like this:</p>
  220. <div class="sourceCode" id="cb12"><pre class="sourceCode yaml"><code class="sourceCode yaml"><a class="sourceLine" id="cb12-1" data-line-number="1"><span class="fu">output:</span></a>
  221. <a class="sourceLine" id="cb12-2" data-line-number="2"> <span class="fu">xaringan:</span><span class="at">:moon_reader:</span></a>
  222. <a class="sourceLine" id="cb12-3" data-line-number="3"> <span class="fu">lib_dir:</span><span class="at"> libs</span></a>
  223. <a class="sourceLine" id="cb12-4" data-line-number="4"> <span class="fu">css:</span><span class="at"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/Extract">[</a></span><span class="st">"xaringan-themer.css"</span><span class="kw">]</span></a>
  224. <a class="sourceLine" id="cb12-5" data-line-number="5"> <span class="fu">nature:</span></a>
  225. <a class="sourceLine" id="cb12-6" data-line-number="6"> <span class="fu">highlightStyle:</span><span class="at"> solarized-dark</span></a>
  226. <a class="sourceLine" id="cb12-7" data-line-number="7"> <span class="fu">highlightLines:</span><span class="at"> true</span></a>
  227. <a class="sourceLine" id="cb12-8" data-line-number="8"> <span class="fu">countIncrementalSlides:</span><span class="at"> false</span></a></code></pre></div>
  228. </div>
  229. </div>
  230. </div>
  231. <div id="theme-settings" class="section level2">
  232. <h2 class="hasAnchor">
  233. <a href="#theme-settings" class="anchor"></a>Theme Settings</h2>
  234. <p>The theme functions listed above are just wrappers around the central function of this package, <code><a href="../reference/style_xaringan.html">style_xaringan()</a></code>. If you want to start from the default <strong>xaringan</strong> theme and make a few modifications, start there.</p>
  235. <p>All of the theme template variables are repeated in each of the theme functions (instead of relying on <code>...</code>) so that you can use autocompletion to find and change the defaults for any theme function. To override the default value of any theme functions, set the appropriate argument in the theme function. A table of all template variables is included in <a href="template-variables.html"><code><a href="../articles/template-variables.html">vignette("template-variables", "xaringanthemer")</a></code></a>.</p>
  236. <p>As an example, try loading <code>xaringanthemer</code>, type out <code>style_duo_theme(</code> and then press <kbd>Tab</kbd> to see all of the theme options.</p>
  237. <p>All of the theme options are named so that you first think of the element you want to change, then the property of that element.</p>
  238. <p>Here are some of the <code>text_</code> theme options:</p>
  239. <ul>
  240. <li><code>text_color</code></li>
  241. <li><code>text_bold_color</code></li>
  242. <li><code>text_slide_number_color</code></li>
  243. <li><code>text_font_size</code></li>
  244. <li><code>text_slide_number_font_size</code></li>
  245. <li><em>and more …</em></li>
  246. </ul>
  247. <p>And here are the title slide theme options:</p>
  248. <ul>
  249. <li><code>title_slide_text_color</code></li>
  250. <li><code>title_slide_background_color</code></li>
  251. <li><code>title_slide_background_image</code></li>
  252. <li><code>title_slide_background_size</code></li>
  253. <li><code>title_slide_background_position</code></li>
  254. </ul>
  255. </div>
  256. <div id="adding-custom-css" class="section level2">
  257. <h2 class="hasAnchor">
  258. <a href="#adding-custom-css" class="anchor"></a>Adding Custom CSS</h2>
  259. <p>You can also add custom CSS classes using the <code>extra_css</code> argument in the theme functions. This argument takes a named list of CSS definitions each containing a named list of CSS property-value pairs.</p>
  260. <div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" data-line-number="1">extra_css &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(</a>
  261. <a class="sourceLine" id="cb13-2" data-line-number="2"> <span class="st">".red"</span> =<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(<span class="dt">color =</span> <span class="st">"red"</span>),</a>
  262. <a class="sourceLine" id="cb13-3" data-line-number="3"> <span class="st">".small"</span> =<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(<span class="st">"font-size"</span> =<span class="st"> "90%"</span>),</a>
  263. <a class="sourceLine" id="cb13-4" data-line-number="4"> <span class="st">".full-width"</span> =<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(</a>
  264. <a class="sourceLine" id="cb13-5" data-line-number="5"> <span class="dt">display =</span> <span class="st">"flex"</span>,</a>
  265. <a class="sourceLine" id="cb13-6" data-line-number="6"> <span class="dt">width =</span> <span class="st">"100%"</span>,</a>
  266. <a class="sourceLine" id="cb13-7" data-line-number="7"> <span class="dt">flex =</span> <span class="st">"1 1 auto"</span></a>
  267. <a class="sourceLine" id="cb13-8" data-line-number="8"> )</a>
  268. <a class="sourceLine" id="cb13-9" data-line-number="9">)</a></code></pre></div>
  269. <p>If you would rather keep your additional css definitions in a separate file, you can call <code><a href="../reference/style_extra_css.html">style_extra_css()</a></code> separately. Just be sure to include your new CSS file in the list of applied files in your YAML header.</p>
  270. <div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb14-1" data-line-number="1"><span class="kw"><a href="../reference/style_extra_css.html">style_extra_css</a></span>(<span class="dt">css =</span> extra_css, <span class="dt">outfile =</span> <span class="st">"custom.css"</span>)</a></code></pre></div>
  271. <div class="sourceCode" id="cb15"><pre class="sourceCode css"><code class="sourceCode css"><a class="sourceLine" id="cb15-1" data-line-number="1"><span class="co">/* Extra CSS */</span></a>
  272. <a class="sourceLine" id="cb15-2" data-line-number="2"><span class="fu">.red</span> {</a>
  273. <a class="sourceLine" id="cb15-3" data-line-number="3"> <span class="kw">color</span>: <span class="dv">red</span>;</a>
  274. <a class="sourceLine" id="cb15-4" data-line-number="4">}</a>
  275. <a class="sourceLine" id="cb15-5" data-line-number="5"><span class="fu">.small</span> {</a>
  276. <a class="sourceLine" id="cb15-6" data-line-number="6"> <span class="kw">font-size</span>: <span class="dv">90%</span>;</a>
  277. <a class="sourceLine" id="cb15-7" data-line-number="7">}</a>
  278. <a class="sourceLine" id="cb15-8" data-line-number="8"><span class="fu">.full-width</span> {</a>
  279. <a class="sourceLine" id="cb15-9" data-line-number="9"> <span class="kw">display</span>: flex;</a>
  280. <a class="sourceLine" id="cb15-10" data-line-number="10"> <span class="kw">width</span>: <span class="dv">100%</span>;</a>
  281. <a class="sourceLine" id="cb15-11" data-line-number="11"> <span class="kw">flex</span>: <span class="dv">1</span> <span class="dv">1</span> <span class="dv">auto</span>;</a>
  282. <a class="sourceLine" id="cb15-12" data-line-number="12">}</a></code></pre></div>
  283. <p>This is most helpful when wanting to define helper classes to work with the <a href="https://github.com/gnab/remark">remark.js</a> <code>.class[]</code> syntax. Using the above example, we could color text red <code>.red[like this]</code> or write <code>.small[in smaller font size]</code>.</p>
  284. </div>
  285. <div id="fonts" class="section level2">
  286. <h2 class="hasAnchor">
  287. <a href="#fonts" class="anchor"></a>Fonts</h2>
  288. <!-- Need to set [adding-custom-css] -->
  289. <p>Yihui picked out great fonts for the <a href="https://slides.yihui.name/xaringan/">default xaringan theme</a>, but sometimes you want something new and interesting.</p>
  290. <p><strong>xaringanthemer</strong> makes it easy to use <a href="https://fonts.google.com">Google Fonts</a> in your presentations (well, as long as you have an internet connection) or to fully specify your font files.</p>
  291. <p>To use <a href="https://fonts.google.com">Google Fonts</a>, set the <code>_font_google</code> theme arguments – <code>text_font_google</code>, <code>header_font_google</code>, <code>code_font_google</code> — using the <code><a href="../reference/google_font.html">google_font()</a></code> helper. See <code><a href="../reference/google_font.html">?google_font</a></code> for more info.</p>
  292. <div class="sourceCode" id="cb16"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb16-1" data-line-number="1"><span class="kw"><a href="../reference/style_mono_light.html">style_mono_light</a></span>(</a>
  293. <a class="sourceLine" id="cb16-2" data-line-number="2"> <span class="dt">header_font_google =</span> <span class="kw"><a href="../reference/google_font.html">google_font</a></span>(<span class="st">"Josefin Slab"</span>, <span class="st">"600"</span>),</a>
  294. <a class="sourceLine" id="cb16-3" data-line-number="3"> <span class="dt">text_font_google =</span> <span class="kw"><a href="../reference/google_font.html">google_font</a></span>(<span class="st">"Work Sans"</span>, <span class="st">"300"</span>, <span class="st">"300i"</span>),</a>
  295. <a class="sourceLine" id="cb16-4" data-line-number="4"> <span class="dt">code_font_google =</span> <span class="kw"><a href="../reference/google_font.html">google_font</a></span>(<span class="st">"IBM Plex Mono"</span>)</a>
  296. <a class="sourceLine" id="cb16-5" data-line-number="5">)</a></code></pre></div>
  297. <p>If you set an <code>xxx_font_google</code> theme arguments, then <code>xxx_font_family</code>, <code>xxx_font_weight</code> and <code>xxx_font_url</code> are overwritten – where <code>xxx</code> in <code>{header, text, code}</code>. Of course, you can manually set <code>header_font_url</code>, etc., and ignore the <code>header_font_google</code> argument.</p>
  298. <p>For example, suppose you want to use a ligature font for the code font, such as <a href="https://github.com/yihui/xaringan/issues/83">Fira Code</a>. Just set <code>code_font_family</code> and <code>code_font_url</code>!</p>
  299. <div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-1" data-line-number="1"><span class="kw"><a href="../reference/style_solarized_dark.html">style_solarized_dark</a></span>(</a>
  300. <a class="sourceLine" id="cb17-2" data-line-number="2"> <span class="dt">code_font_family =</span> <span class="st">"Fira Code"</span>,</a>
  301. <a class="sourceLine" id="cb17-3" data-line-number="3"> <span class="dt">code_font_url =</span> <span class="st">"https://cdn.rawgit.com/tonsky/FiraCode/1.204/distr/fira_code.css"</span></a>
  302. <a class="sourceLine" id="cb17-4" data-line-number="4">)</a></code></pre></div>
  303. <p>If you need to import additional fonts for use in <a href="#adding-custom-css">custom CSS definitions</a>, you can use the <code>extra_fonts</code> argument to pass a list of URLs or <code><a href="../reference/google_font.html">google_font()</a></code>s.</p>
  304. <div class="sourceCode" id="cb18"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb18-1" data-line-number="1"><span class="kw"><a href="../reference/style_mono_light.html">style_mono_light</a></span>(</a>
  305. <a class="sourceLine" id="cb18-2" data-line-number="2"> <span class="dt">extra_fonts =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(<span class="kw"><a href="../reference/google_font.html">google_font</a></span>(<span class="st">"Sofia"</span>)),</a>
  306. <a class="sourceLine" id="cb18-3" data-line-number="3"> <span class="dt">extra_css =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(<span class="st">".title-slide h2"</span> =<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(<span class="st">"font-family"</span> =<span class="st"> "Sofia"</span>))</a>
  307. <a class="sourceLine" id="cb18-4" data-line-number="4">)</a></code></pre></div>
  308. <hr>
  309. <p><strong>xaringanthemer</strong> was built by <a href="https://www.garrickadenbuie.com">Garrick Aden-Buie</a> (<a href="https://twitter.com/grrrck">@grrrck</a>).</p>
  310. <p>Big thank you to <a href="https://yihui.name">Yihui Xie</a>, especially for <a href="https://github.com/yihui/xaringan">xaringan</a>. Also thanks to <a href="http://gnab.org">Ole Petter Bang</a> for <a href="https://github.com/gnab/remark">remark.js</a>.</p>
  311. <p>Feel free to <a href="https://github.com/gadenbuie/xaringanthemer/issues">file an issue</a> if you find a bug or have a theme suggestion – or better yet, submit a pull request!</p>
  312. </div>
  313. </div>
  314. <div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
  315. <div id="tocnav">
  316. <h2 class="hasAnchor">
  317. <a href="#tocnav" class="anchor"></a>Contents</h2>
  318. <ul class="nav nav-pills nav-stacked">
  319. <li><a href="#quick-intro">Quick Intro</a></li>
  320. <li><a href="#themes">Themes</a></li>
  321. <li><a href="#theme-settings">Theme Settings</a></li>
  322. <li><a href="#adding-custom-css">Adding Custom CSS</a></li>
  323. <li><a href="#fonts">Fonts</a></li>
  324. </ul>
  325. </div>
  326. </div>
  327. </div>
  328. <footer><div class="copyright">
  329. <p>Developed by <a href="https://www.garrickadenbuie.com">Garrick Aden-Buie</a>.</p>
  330. </div>
  331. <div class="pkgdown">
  332. <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
  333. </div>
  334. </footer>
  335. </div>
  336. </body>
  337. </html>