Browse Source

ipsum_pdf template

tags/0.8.0
boB Rudis 6 years ago
parent
commit
9c0f98c58b
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 7
      DESCRIPTION
  2. 1
      NAMESPACE
  3. 7
      NEWS.md
  4. 13
      R/ipsum-pdf.R
  5. 5
      README.Rmd
  6. 42
      README.md
  7. BIN
      README_figs/README-unnamed-chunk-10-1.png
  8. BIN
      README_figs/README-unnamed-chunk-11-1.png
  9. BIN
      README_figs/README-unnamed-chunk-12-1.png
  10. BIN
      README_figs/README-unnamed-chunk-5-1.png
  11. BIN
      README_figs/README-unnamed-chunk-6-1.png
  12. BIN
      README_figs/README-unnamed-chunk-7-1.png
  13. BIN
      README_figs/README-unnamed-chunk-8-1.png
  14. BIN
      README_figs/README-unnamed-chunk-9-1.png
  15. 48
      inst/rmarkdown/templates/ipsum_pdf/skeleton/skeleton.Rmd
  16. 4
      inst/rmarkdown/templates/ipsum_pdf/template.yaml
  17. 17
      man/ipsum_pdf.Rd

7
DESCRIPTION

@ -1,8 +1,8 @@
Package: hrbrthemes
Type: Package
Title: Additional Themes, Theme Components and Utilities for 'ggplot2'
Version: 0.4.0
Date: 2017-11-15
Version: 0.5.0
Date: 2017-12-20
Authors@R: c(
person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-5670-2640")),
@ -23,6 +23,7 @@ URL: http://github.com/hrbrmstr/hrbrthemes
BugReports: https://github.com/hrbrmstr/hrbrthemes/issues
Copyright: file inst/COPYRIGHTS
License: MIT + file LICENSE
Encoding: UTF-8
Suggests:
testthat,
dplyr,
@ -48,5 +49,5 @@ Imports:
htmltools,
tools,
magrittr
RoxygenNote: 6.0.1
RoxygenNote: 6.0.1.9000
VignetteBuilder: knitr

1
NAMESPACE

@ -12,6 +12,7 @@ export(import_plex_sans)
export(import_roboto_condensed)
export(ipsum)
export(ipsum_pal)
export(ipsum_pdf)
export(modern_geom_defaults)
export(scale_color_ipsum)
export(scale_colour_ipsum)

7
NEWS.md

@ -1,3 +1,10 @@
# hrbrthemes 0.5.0
## New Stuff
* `flush_ticks()` for easier alignment of x/y axis labels
* `ipsum_pdf` R Markdown format for using hrbrthemes in PDFs
# hrbrthemes 0.3.2
## New Stuff

13
R/ipsum-pdf.R

@ -0,0 +1,13 @@
#' ipsum R markdown template for PDF output
#'
#' Template for creating an R markdown documents with an emphasis on typography
#'
#' @inheritParams rmarkdown::pdf_document
#' @param ... Arguments to \code{rmarkdown::pdf_document}
#'
#' @return R Markdown output format to pass to \code{\link[rmarkdown:render]{render}}
#'
#' @export
ipsum_pdf <- function(...) {
rmarkdown::pdf_document(...)
}

5
README.Rmd

@ -37,6 +37,11 @@ Utilities:
- `gg_check`: Spell check ggplot2 plot labels
- `update_geom_font_defaults`: Update matching font defaults for text geoms (the default is — unsurprisingly — Arial Narrow)
R Mardkdown:
- `ipsum`: minimalism HTML template
- `ipsum_pdf`: everything you need to use hrbrthemes in PDFs
The following global variables are now in your namespace:
- `font_an`: a short global alias for "`Arial Narrow`"

42
README.md

@ -47,6 +47,11 @@ Utilities:
- `update_geom_font_defaults`: Update matching font defaults for text
geoms (the default is — unsurprisingly — Arial Narrow)
R Mardkdown:
- `ipsum`: minimalism HTML template
- `ipsum_pdf`: everything you need to use hrbrthemes in PDFs
The following global variables are now in your namespace:
- `font_an`: a short global alias for “`Arial Narrow`”
@ -222,15 +227,40 @@ gg_check(gg)
library(hrbrthemes)
date()
## [1] "Thu Nov 16 10:13:21 2017"
## [1] "Thu Dec 21 15:25:14 2017"
devtools::test()
## basic functionality: ..........
## themes:
## .
## .
## ✔ | OK F W S | Context
##
⠏ | 0 | basic functionality
⠋ | 1 | basic functionality
⠙ | 2 | basic functionality
⠹ | 3 | basic functionality
⠸ | 4 | basic functionality
⠼ | 5 | basic functionality
⠴ | 6 | basic functionality
⠦ | 7 | basic functionality
⠧ | 8 | basic functionality
⠇ | 9 | basic functionality
⠏ | 10 | basic functionality
✔ | 10 | basic functionality [2.0 s]
##
⠏ | 0 | themes
##
⠋ | 1 | themes
##
⠙ | 2 | themes
✔ | 2 | themes [0.9 s]
##
## ══ Results ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════
## Duration: 3.0 s
##
## OK: 12
## Failed: 0
## Warnings: 0
## Skipped: 0
##
## DONE ===================================================================================================================
## Keep up the good work.
```
### Code of Conduct

BIN
README_figs/README-unnamed-chunk-10-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

BIN
README_figs/README-unnamed-chunk-11-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

BIN
README_figs/README-unnamed-chunk-12-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

BIN
README_figs/README-unnamed-chunk-5-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

BIN
README_figs/README-unnamed-chunk-6-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

BIN
README_figs/README-unnamed-chunk-7-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 KiB

After

Width:  |  Height:  |  Size: 214 KiB

BIN
README_figs/README-unnamed-chunk-8-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

BIN
README_figs/README-unnamed-chunk-9-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 82 KiB

48
inst/rmarkdown/templates/ipsum_pdf/skeleton/skeleton.Rmd

@ -0,0 +1,48 @@
---
title: "Using hrbrthemes in PDFs"
output: hrbrthemes::ipsum_pdf
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, dev = "cairo_pdf")
```
# Purpose
The purpose of this template is to show what you need to do in order to use
Arial Narrow or Roboto Condensed in PDF output documents.
The main consideration is the use of `Cairo` and --- specifically -- the `cairo_pdf`
output device. It is best to set that in the `knit` chunk defaults (as seen in
the `setup` block) but you can also do that in the individual chunks as has also been
demonstrated in the "Roboto Condensed" chunk.
Make sure to include the library calls as they are here.
```{r message = FALSE}
library(hrbrthemes)
library(ggplot2)
library(Cairo)
library(extrafont)
extrafont::loadfonts()
```
### Arial Narrow
```{r}
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
labs(title="Arial Narrow", subtitle="This is a subtitle") +
theme_ipsum()
```
### Roboto Condensed
```{r dev = "cairo_pdf"}
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
labs(title="Roboto Condensed", subtitle="This is a subtitle") +
theme_ipsum_rc()
```

4
inst/rmarkdown/templates/ipsum_pdf/template.yaml

@ -0,0 +1,4 @@
name: ipsum PDF Template
description: >
R Markdown template with an emphasis on typography, targeting PDF output
create_dir: false

17
man/ipsum_pdf.Rd

@ -0,0 +1,17 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ipsum-pdf.R
\name{ipsum_pdf}
\alias{ipsum_pdf}
\title{ipsum R markdown template for PDF output}
\usage{
ipsum_pdf(...)
}
\arguments{
\item{...}{Arguments to \code{rmarkdown::pdf_document}}
}
\value{
R Markdown output format to pass to \code{\link[rmarkdown:render]{render}}
}
\description{
Template for creating an R markdown documents with an emphasis on typography
}
Loading…
Cancel
Save