😎 Give your xaringan slides some style
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

182 Zeilen
12KB

  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>Fonts • xaringanthemer</title>
  9. <!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous">
  10. <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css">
  11. <script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous">
  12. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous">
  13. <!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
  14. <script src="../pkgdown.js"></script><link href="../extra.css" rel="stylesheet">
  15. <meta property="og:title" content="Fonts">
  16. <meta property="og:description" content="xaringanthemer">
  17. <meta name="twitter:card" content="summary">
  18. <meta name="twitter:creator" content="@grrrck">
  19. <meta name="twitter:site" content="@grrrck">
  20. <meta name="robots" content="noindex">
  21. <!-- 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]>
  22. <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  23. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  24. <![endif]-->
  25. </head>
  26. <body data-spy="scroll" data-target="#toc">
  27. <div class="container template-article">
  28. <header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
  29. <div class="container">
  30. <div class="navbar-header">
  31. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
  32. <span class="sr-only">Toggle navigation</span>
  33. <span class="icon-bar"></span>
  34. <span class="icon-bar"></span>
  35. <span class="icon-bar"></span>
  36. </button>
  37. <span class="navbar-brand">
  38. <a class="navbar-link" href="../index.html">xaringanthemer</a>
  39. <span class="version label label-danger" data-toggle="tooltip" data-placement="bottom" title="In-development version">0.2.0.9100</span>
  40. </span>
  41. </div>
  42. <div id="navbar" class="navbar-collapse collapse">
  43. <ul class="nav navbar-nav">
  44. <li>
  45. <a href="../articles/xaringanthemer.html">Get started</a>
  46. </li>
  47. <li>
  48. <a href="../reference/index.html">Reference</a>
  49. </li>
  50. <li>
  51. <a href="../articles/themes.html">Themes</a>
  52. </li>
  53. <li>
  54. <a href="../articles/fonts.html">Fonts</a>
  55. </li>
  56. <li>
  57. <a href="../articles/template-variables.html">Template Variables</a>
  58. </li>
  59. </ul>
  60. <ul class="nav navbar-nav navbar-right">
  61. <li>
  62. <a href="../news/index.html">
  63. <span class="fa fa fa fa-newspaper-o fa-lg"></span>
  64. </a>
  65. </li>
  66. <li>
  67. <a href="https://github.com/gadenbuie/xaringanthemer">
  68. <span class="fa fa-github fa-lg"></span>
  69. </a>
  70. </li>
  71. <li>
  72. <a href="https://twitter.com/grrrck">
  73. <span class="fa fa-twitter fa-lg"></span>
  74. </a>
  75. </li>
  76. <li>
  77. <a href="https://www.garrickadenbuie.com">
  78. <span class="fa fa-home fa-lg"></span>
  79. </a>
  80. </li>
  81. </ul>
  82. </div>
  83. <!--/.nav-collapse -->
  84. </div>
  85. <!--/.container -->
  86. </div>
  87. <!--/.navbar -->
  88. </header><div class="row">
  89. <div class="col-md-9 contents">
  90. <div class="page-header toc-ignore">
  91. <h1 data-toc-skip>Fonts</h1>
  92. <small class="dont-index">Source: <a href="https://github.com/gadenbuie/xaringanthemer/blob/master/vignettes/fonts.Rmd"><code>vignettes/fonts.Rmd</code></a></small>
  93. <div class="hidden name"><code>fonts.Rmd</code></div>
  94. </div>
  95. <!-- Need to set [adding-custom-css] -->
  96. <div id="default-fonts" class="section level3">
  97. <h3 class="hasAnchor">
  98. <a href="#default-fonts" class="anchor"></a>Default Fonts</h3>
  99. <p><strong>xaringanthemer</strong> by default uses a different set of default fonts for heading and body fonts. The new defaults use <a href="https://fonts.google.com/specimen/Cabin">Cabin</a> for headings and <a href="https://fonts.google.com/specimen/Noto+Sans">Noto Sans</a> for body text. These fonts are easier to read on screens and at a distance during presentations, and they support a wide variety of languages and weights. Another reason for the change is that the xaringan (remarkjs) default body font, <em>Droid Serif</em>, is no longer officially included in Google Fonts.</p>
  100. <p>If you would like to use the fonts from the <a href="https://slides.yihui.name/xaringan/">default xaringan theme</a>, you can use the following arguments in your style function.</p>
  101. <div class="sourceCode" id="cb1"><html><body><pre class="r"><span class="fu"><a href="../reference/style_xaringan.html">style_xaringan</a></span>(
  102. <span class="kw">text_font_family</span> <span class="kw">=</span> <span class="st">"Droid Serif"</span>,
  103. <span class="kw">text_font_url</span> <span class="kw">=</span> <span class="st">"https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic"</span>,
  104. <span class="kw">header_font_google</span> <span class="kw">=</span> <span class="fu"><a href="../reference/google_font.html">google_font</a></span>(<span class="st">"Yanone Kaffeesatz"</span>)
  105. )</pre></body></html></div>
  106. </div>
  107. <div id="custom-and-google-font-fonts" class="section level3">
  108. <h3 class="hasAnchor">
  109. <a href="#custom-and-google-font-fonts" class="anchor"></a>Custom and <em>Google Font</em> Fonts</h3>
  110. <p><strong>xaringanthemer</strong> makes it easy to use <a href="https://fonts.google.com">Google Fonts</a> in your presentations (provided you have an internet connection during the presentation) or to fully specify your font files.</p>
  111. <p>To use <a href="https://fonts.google.com">Google Fonts</a>, set the <code>&lt;type&gt;_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. The help documentation in <code><a href="../reference/google_font.html">?google_font</a></code> provides more info.</p>
  112. <div class="sourceCode" id="cb2"><html><body><pre class="r"><span class="fu"><a href="../reference/style_mono_light.html">style_mono_light</a></span>(
  113. <span class="kw">header_font_google</span> <span class="kw">=</span> <span class="fu"><a href="../reference/google_font.html">google_font</a></span>(<span class="st">"Josefin Slab"</span>, <span class="st">"600"</span>),
  114. <span class="kw">text_font_google</span> <span class="kw">=</span> <span class="fu"><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>),
  115. <span class="kw">code_font_google</span> <span class="kw">=</span> <span class="fu"><a href="../reference/google_font.html">google_font</a></span>(<span class="st">"IBM Plex Mono"</span>)
  116. )</pre></body></html></div>
  117. <p>If you set an <code>&lt;type&gt;_font_google</code> theme arguments, then <code>&lt;type&gt;_font_family</code>, <code>&lt;type&gt;_font_weight</code> and <code>&lt;type&gt;_font_url</code> are overwritten – where <code>&lt;type&gt;</code> is one of <code>header</code>, <code>text</code>, or <code>code</code>.</p>
  118. <p>To use a font hosted outside of Google fonts, you need to provide both <code>&lt;type&gt;_font_family</code> and <code>&lt;type&gt;_font_url</code>. For example, suppose you want to use a code font with ligatures for your code chunks, such as <a href="https://github.com/tonsky/FiraCode">Fira Code</a>, which would be declared with <code>code_font_family</code>. The <a href="https://github.com/tonsky/FiraCode#browser-support">browser usage</a> section of the Fira Code README provides a CSS URL to be used with an <code>@import</code> statement that you can use with the <code>code_font_url</code> argument.</p>
  119. <div class="sourceCode" id="cb3"><html><body><pre class="r"><span class="fu"><a href="../reference/style_solarized_dark.html">style_solarized_dark</a></span>(
  120. <span class="kw">code_font_family</span> <span class="kw">=</span> <span class="st">"Fira Code"</span>,
  121. <span class="kw">code_font_url</span> <span class="kw">=</span> <span class="st">"https://cdn.jsdelivr.net/gh/tonsky/FiraCode@2/distr/fira_code.css"</span>
  122. )</pre></body></html></div>
  123. <p>Remember that you need to supply either <code>&lt;type&gt;_google_font</code> using the <code><a href="../reference/google_font.html">google_font()</a></code> helper <em>or both</em> <code>&lt;type&gt;_font_family</code> and <code>&lt;type&gt;_font_url</code>.</p>
  124. </div>
  125. <div id="using-additional-fonts" class="section level3">
  126. <h3 class="hasAnchor">
  127. <a href="#using-additional-fonts" class="anchor"></a>Using Additional Fonts</h3>
  128. <p>If you want to use additional fonts for use in <a href="xaringanthemer.html#adding-custom-css">custom CSS definitions</a>, 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. Notice that you will need to add custom CSS (for example, via <code>extra_css</code>) to use the fonts imported in <code>extra_fonts</code>.</p>
  129. <div class="sourceCode" id="cb4"><html><body><pre class="r"><span class="fu"><a href="../reference/style_mono_light.html">style_mono_light</a></span>(
  130. <span class="kw">extra_fonts</span> <span class="kw">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span>(
  131. <span class="fu"><a href="../reference/google_font.html">google_font</a></span>(<span class="st">"Sofia"</span>),
  132. <span class="co"># Young Serif by uplaod.fr</span>
  133. <span class="st">"https://cdn.jsdelivr.net/gh/uplaod/YoungSerif/fonts/webfonts/fontface.css"</span>,
  134. ),
  135. <span class="kw">extra_css</span> <span class="kw">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span>(
  136. <span class="st">".title-slide h2"</span> <span class="kw">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span>(<span class="st">"font-family"</span> <span class="kw">=</span> <span class="st">"Sofia"</span>),
  137. <span class="kw">blockquote</span> <span class="kw">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span>(<span class="st">"font-family"</span> <span class="kw">=</span> <span class="st">"youngserifregular"</span>)
  138. )
  139. )</pre></body></html></div>
  140. </div>
  141. </div>
  142. <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
  143. </div>
  144. </div>
  145. <footer><div class="copyright">
  146. <p>Developed by <a href="https://www.garrickadenbuie.com">Garrick Aden-Buie</a>.</p>
  147. </div>
  148. <div class="pkgdown">
  149. <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p>
  150. </div>
  151. </footer>
  152. </div>
  153. </body>
  154. </html>