├── .Rbuildignore ├── .gitignore ├── DESCRIPTION ├── NAMESPACE ├── R ├── chapter.R ├── index.R ├── plot-hooks.R ├── screenshot.R ├── sidebar.R └── utils.R ├── README.md ├── inst ├── book-template.tex ├── chapter-html.html └── raw-html.html ├── man └── screenshot.Rd └── oldbookdown.Rproj /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^\.travis\.yml$ 2 | ^.*\.Rproj$ 3 | ^\.Rproj\.user$ 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: oldbookdown 2 | Title: Built books with markdown 3 | Version: 0.1 4 | Authors@R: 'Hadley Wickham [aut,cre]' 5 | Description: Use rstudio/bookdown, not this repo. 6 | Depends: 7 | R (>= 3.1.0) 8 | Imports: 9 | rmarkdown, 10 | RJSONIO, 11 | yaml, 12 | stringr, 13 | png, 14 | knitr 15 | License: GPL-3 16 | LazyData: true 17 | RoxygenNote: 5.0.1 18 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(begin_sidebar) 4 | export(check_links) 5 | export(embed_png) 6 | export(end_sidebar) 7 | export(html_chapter) 8 | export(index) 9 | export(knit_print.knit_asis) 10 | export(latex_plot) 11 | export(screenshot) 12 | export(tex_chapter) 13 | -------------------------------------------------------------------------------- /R/chapter.R: -------------------------------------------------------------------------------- 1 | 2 | #' @export 3 | html_chapter <- function(raw = FALSE, toc = NULL, code_width = 80) { 4 | base <- rmarkdown::html_document( 5 | self_contained = FALSE, 6 | lib_dir = "www", 7 | template = if (raw) system.file("raw-html.html", package = "oldbookdown") else system.file("chapter-html.html", package = "oldbookdown"), 8 | mathjax = if (raw) NULL else "default" 9 | ) 10 | # Remove --section-divs option 11 | base$pandoc$args <- setdiff(base$pandoc$args, "--section-divs") 12 | base$pandoc$from <- markdown_style 13 | 14 | 15 | 16 | if (!is.null(toc)) { 17 | old_p <- base$pre_processor 18 | base$pre_processor <- function(yaml_front_matter, utf8_input, runtime, 19 | knit_meta, files_dir, output_dir) { 20 | update_links(utf8_input, toc) 21 | old_p(yaml_front_matter, utf8_input, runtime, 22 | knit_meta, files_dir, output_dir) 23 | } 24 | } 25 | 26 | base 27 | } 28 | 29 | #' @export 30 | tex_chapter <- function(chapter = NULL, 31 | latex_engine = c("xelatex", "pdflatex", "lualatex"), 32 | code_width = 65) { 33 | options(digits = 3) 34 | set.seed(1014) 35 | 36 | latex_engine <- match.arg(latex_engine) 37 | rmarkdown::output_format( 38 | knitr_opts("html", chapter), 39 | rmarkdown::pandoc_options( 40 | to = "latex", 41 | from = "markdown_style", 42 | ext = ".tex", 43 | args = c("--chapters", rmarkdown::pandoc_latex_engine_args(latex_engine)) 44 | ), 45 | clean_supporting = FALSE 46 | ) 47 | } 48 | 49 | markdown_style <- paste0( 50 | "markdown", 51 | "+autolink_bare_uris", 52 | "-auto_identifiers", 53 | "+tex_math_single_backslash", 54 | "-implicit_figures" 55 | ) 56 | 57 | knitr_opts <- function(type = c("html", "latex"), chapter, code_width = 65) { 58 | type <- match.arg(type) 59 | 60 | pkg <- list( 61 | width = code_width 62 | ) 63 | 64 | chunk <- list( 65 | comment = "#>", 66 | collapse = TRUE, 67 | cache.path = paste0("_cache/", chapter, "/"), 68 | cache = TRUE, 69 | fig.path = paste0("_figures/", chapter, "/"), 70 | fig.width = 4, 71 | fig.height = 4, 72 | fig.retina = NULL, 73 | dev = if (type == "html") "png" else "pdf", 74 | dpi = if (type == "html") 96 else 300 75 | ) 76 | 77 | hooks <- list( 78 | plot = if (type == "latex") html_plot(), 79 | small_mar = function(before, options, envir) { 80 | if (before) 81 | par(mar = c(4.1, 4.1, 0.5, 0.5)) 82 | } 83 | ) 84 | 85 | rmarkdown::knitr_options(pkg, chunk, hooks) 86 | } 87 | -------------------------------------------------------------------------------- /R/index.R: -------------------------------------------------------------------------------- 1 | #' @export 2 | index <- function() { 3 | rmd <- dir(pattern = "\\.[rR]md$") 4 | headers <- lapply(rmd, extract_headers) 5 | names(headers) <- rmd 6 | 7 | headers_df <- stack(headers) 8 | headers_df$ind <- as.character(headers_df$ind) 9 | new <- setNames(as.list(headers_df$ind), headers_df$values) 10 | 11 | # Save in human readable and R readable 12 | cat(yaml::as.yaml(headers), file = "toc.yaml") 13 | saveRDS(new, "toc.rds") 14 | } 15 | 16 | #' @export 17 | check_links <- function(path, index_path = "toc.rds") { 18 | index <- readRDS(index_path) 19 | body <- parse_md(path)[[2]] 20 | 21 | get_link <- function(type, contents, format, meta) { 22 | if (type == "Link") 23 | contents[[2]][[1]] 24 | } 25 | links <- walk_inline(body, get_link) 26 | type <- link_type(links) 27 | 28 | links_by_type <- split(links, type) 29 | if (length(links_by_type$bad) > 0) { 30 | message("Bad links: ", paste0(links_by_type$bad, collapse = ", ")) 31 | } 32 | lapply(gsub("^#", "", links_by_type$internal), lookup, index) 33 | invisible() 34 | } 35 | 36 | # Convert internal links to explicit links also containing the file name 37 | update_links <- function(path, index_path = "toc.rds") { 38 | index <- readRDS(index_path) 39 | 40 | contents <- paste0(readLines(path, warn = FALSE), collapse = "\n") 41 | 42 | int_link_pos <- stringr::str_locate_all(contents, "\\(#[A-Za-z_0-9-]+\\)")[[1]] 43 | int_link <- stringr::str_sub(contents, 44 | int_link_pos[, "start"] + 2, # (# 45 | int_link_pos[, "end"] - 1 # ) 46 | ) 47 | 48 | replacement <- vapply(int_link, lookup, character(1), index = index) 49 | 50 | for(i in rev(seq_len(nrow(int_link_pos)))) { 51 | start <- int_link_pos[i, "start"] + 1 52 | end <- int_link_pos[i, "end"] - 1 53 | stringr::str_sub(contents, start, end) <- replacement[i] 54 | } 55 | 56 | writeLines(contents, path) 57 | } 58 | 59 | 60 | # Strategy: before running jekyll, parse all .Rmd files and build index 61 | # Modify rmd2md to add json pass that modifies links 62 | 63 | # Use pandoc to parse a markdown file 64 | parse_md <- function(in_path) { 65 | out_path <- tempfile() 66 | on.exit(unlink(out_path)) 67 | cmd <- paste0("pandoc -f ", markdown_style, " -t json -o ", out_path, " ", in_path) 68 | system(cmd) 69 | 70 | RJSONIO::fromJSON(out_path, simplify = FALSE) 71 | } 72 | 73 | type <- function(x) vapply(x, "[[", "t", FUN.VALUE = character(1)) 74 | contents <- function(x) lapply(x, "[[", "c") 75 | id <- function(x) x[[2]][[1]] 76 | 77 | extract_headers <- function(in_path) { 78 | x <- parse_md(in_path) 79 | body <- x[[2]] 80 | headers <- contents(body[type(body) == "Header"]) 81 | 82 | ids <- vapply(headers, id, FUN.VALUE = character(1)) 83 | ids[ids != ""] 84 | } 85 | 86 | link_type <- function(url) { 87 | ifelse(grepl("^#", url), "internal", 88 | ifelse(grepl("^[a-z]+://", url), "external", 89 | "bad")) 90 | } 91 | 92 | 93 | lookup <- function(name, index = readRDS("toc.rds")) { 94 | path <- index[[name]] 95 | if (length(path) == 0) { 96 | stop("Can't find ref '", name, "'", call. = FALSE) 97 | } else if (length(path) > 1) { 98 | stop("Ambiguous ref '", name, "' found in ", paste0(path, collapse = ", "), 99 | call. = FALSE) 100 | } 101 | 102 | paste0(gsub(".rmd", ".html", path), "#", name) 103 | } 104 | 105 | invert <- function(x) { 106 | if (length(x) == 0) return() 107 | unstack(rev(stack(x))) 108 | } 109 | 110 | # Walkers ---------------------------------------------------------------------- 111 | 112 | # action(key, value, format, meta) 113 | # key is the type of the pandoc object (e.g. 'Str', 'Para') 114 | # value is the contents of the object (e.g. a string for 'Str', a list of 115 | # inline elements for 'Para') 116 | # format is the target output format (which will be taken for the first 117 | # command line argument if present) 118 | # meta is the document's metadata. 119 | # 120 | # Return values: 121 | # NULL, the object to which it applies will remain unchanged. 122 | # If it returns an object, the object will be replaced. 123 | # If it returns a list, the list will be spliced in to the list to which the 124 | # target object belongs. (So, returning an empty list deletes the object.) 125 | 126 | # Walker translated from 127 | # https://github.com/jgm/pandocfilters/blob/master/pandocfilters.py 128 | # Data types at 129 | # http://hackage.haskell.org/package/pandoc-types-1.12.3/docs/Text-Pandoc-Definition.html 130 | walk <- function(x, action, format = NULL, meta = NULL) { 131 | # Base cases 132 | if (is.null(x)) return() 133 | if (is.node(x)) return(action(x$t, action$c, format, meta)) 134 | 135 | lapply(walk, x, action, format = format, meta = meta) 136 | } 137 | 138 | # action must return homogenous output 139 | walk_inline <- function(x, action, format = NULL, meta = NULL) { 140 | 141 | recurse <- function(x) { 142 | unlist(lapply(x, walk_inline, action, format = format, meta = meta), 143 | recursive = FALSE) 144 | } 145 | 146 | # Bare list 147 | if (is.null(names(x))) return(recurse(x)) 148 | if (!is.list(x)) browser() 149 | 150 | switch(x$t, 151 | # A list of inline elements 152 | Plain = , 153 | Para = recurse(x$c), 154 | CodeBlock = NULL, 155 | RawBlock = NULL, 156 | # A list of blocks 157 | BlockQuote = recurse(x$c), 158 | # Attributes & a list of items, each of which is a list of blocks 159 | OrderedList = unlist(lapply(x$c[[2]], recurse)), 160 | # List of items, each a list of blocks 161 | BulletList = unlist(lapply(x$c, recurse)), 162 | # Each list item is a pair consisting of a term (a list of inlines) and 163 | # one or more definitions (each a list of blocks) 164 | DefinitionList = unlist(lapply(x$c, function(x) recurse(x[[1]]), recurse(x[[2]]))), 165 | # Third element is list of inlines 166 | Header = recurse(x$c[[3]]), 167 | HorizontalRule = NULL, 168 | # First element is caption, 4th element column eaders, 5th table rows (list 169 | # of cells) 170 | Table = c(recurse(x$c[[1]]), recurse(x$c[[4]]), unlist(lapply(x$c[[5]], recurse))), 171 | # Second element is list of blocks 172 | Div = recurse(x$c[[2]]), 173 | Null = NULL, 174 | # Anything else must be a inline element 175 | action(x$t, x$c, format = format, meta = meta) 176 | ) 177 | } 178 | -------------------------------------------------------------------------------- /R/plot-hooks.R: -------------------------------------------------------------------------------- 1 | #' @export 2 | latex_plot <- function(x, options) { 3 | paste0( 4 | latex_plot_begin(x, options), 5 | latex_plot_graphics(x, options), 6 | latex_plot_end(x, options) 7 | ) 8 | } 9 | 10 | latex_plot_begin <- function(x, options) { 11 | if (!knitr_first_plot(options)) 12 | return("") 13 | 14 | paste0( 15 | "\\begin{figure}[H]\n", 16 | if (options$fig.align == "center") " \\centering\n" 17 | ) 18 | } 19 | latex_plot_end <- function(x, options) { 20 | if (!knitr_last_plot(options)) 21 | return("") 22 | 23 | paste0( 24 | if (!is.null(options$fig.cap)) { 25 | paste0( 26 | ' \\caption{', options$fig.cap, '}\n', 27 | ' \\label{', options$label, '}\n' 28 | ) 29 | }, 30 | "\\end{figure}\n" 31 | ) 32 | } 33 | latex_plot_graphics <- function(x, options) { 34 | cols <- options$columns %||% 1 35 | max_width <- options$max_width %||% (if (cols == 1) 0.65 else 1) 36 | 37 | # If unknown width/height, compute from columns 38 | if (is.null(options$out.width) && is.null(options$out.height)) { 39 | options$out.width <- paste0(round(max_width / cols, 3), "\\linewidth") 40 | } 41 | 42 | opts <- c( 43 | sprintf('width=%s', options$out.width), 44 | sprintf('height=%s', options$out.height), 45 | options$out.extra 46 | ) 47 | 48 | paste0(" \\includegraphics", 49 | paste0("[", paste(opts, collapse = ", "), "]"), 50 | "{", x, "}", 51 | if (!(options$fig.cur %% col)) "%", 52 | "\n" 53 | ) 54 | } 55 | 56 | knitr_first_plot <- function(x) { 57 | x$fig.show != "hold" || x$fig.cur == 1L 58 | } 59 | knitr_last_plot <- function(x) { 60 | x$fig.show != "hold" || x$fig.cur == x$fig.num 61 | } 62 | 63 | columns <- function(n, aspect_ratio = 1, max_width = if (n == 1) 0.65 else 1) { 64 | if (is_latex()) { 65 | out_width <- paste0(round(max_width / n, 3), "\\linewidth") 66 | knitr::knit_hooks$set(plot = plot_hook_bookdown) 67 | } else { 68 | out_width <- paste0(round(max_width * 100 / n, 1), "%") 69 | } 70 | 71 | width <- 6 / n * max_width 72 | 73 | knitr::opts_chunk$set( 74 | fig.width = width, 75 | fig.height = width * aspect_ratio, 76 | fig.align = if (max_width < 1) "center" else "default", 77 | fig.show = if (n == 1) "asis" else "hold", 78 | fig.retina = NULL, 79 | out.width = out_width, 80 | out.extra = if (!is_latex()) 81 | paste0("style='max-width: ", round(width, 2), "in'") 82 | ) 83 | } 84 | -------------------------------------------------------------------------------- /R/screenshot.R: -------------------------------------------------------------------------------- 1 | #' Embed a screenshot. 2 | #' 3 | #' This embeds a png screenshot into the document. Generally you should use 4 | #' \code{echo = FALSE} on such blocks. By convention, screenshots should 5 | #' live in a \code{screenshots/} directory. 6 | #' 7 | #' @param path Path to screenshot. 8 | #' @param dpi DPI of image. You can leave this blank if the dpi is stored 9 | #' in the png metadata 10 | #' @export 11 | screenshot <- function(path, dpi = NULL) { 12 | meta <- png_meta(path) 13 | dpi <- dpi %||% meta$dpi[1] %||% stop("Unknown dpi", call. = FALSE) 14 | 15 | if (is_latex()) { 16 | width <- round(meta$dim[1] / dpi, 2) 17 | 18 | knitr::asis_output(paste0( 19 | "\\includegraphics[", 20 | "width=", width, "in", 21 | "]{", path, "}" 22 | )) 23 | } else { 24 | knitr::asis_output(paste0( 25 | "" 29 | )) 30 | } 31 | } 32 | 33 | #' @export 34 | #' @rdname screenshot 35 | embed_png <- screenshot 36 | 37 | png_meta <- function(path) { 38 | attr(png::readPNG(path, native = TRUE, info = TRUE), "info") 39 | } 40 | -------------------------------------------------------------------------------- /R/sidebar.R: -------------------------------------------------------------------------------- 1 | #' @export 2 | knit_print.knit_asis <- function(x, ...) x 3 | 4 | #' @export 5 | begin_sidebar <- function(title = NULL) { 6 | if (identical(doc_type(), "latex")) { 7 | knitr::asis_output(paste0("\\begin{SIDEBAR}", title, "\\end{SIDEBAR}\n")) 8 | } else { 9 | knitr::asis_output(paste0("\n") 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /R/utils.R: -------------------------------------------------------------------------------- 1 | 2 | doc_type <- function() knitr::opts_knit$get('rmarkdown.pandoc.to') 3 | 4 | is_latex <- function() { 5 | identical(doc_type(), "latex") 6 | } 7 | 8 | `%||%` <- function(a, b) if (is.null(a)) b else a 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DEPRECATED 2 | 3 | Please use instead 4 | -------------------------------------------------------------------------------- /inst/book-template.tex: -------------------------------------------------------------------------------- 1 | % Modified from pandoc --print-default-template=latex 2 | \documentclass[oneside]{book} 3 | \usepackage[T1]{fontenc} 4 | \usepackage{lmodern} 5 | \usepackage{amssymb,amsmath} 6 | \usepackage{ifxetex,ifluatex} 7 | \usepackage{fixltx2e} % provides \textsubscript 8 | \usepackage{upquote} 9 | 10 | 11 | \usepackage{mathspec} 12 | \usepackage{xltxtra,xunicode} 13 | \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} 14 | \setmonofont[Mapping=tex-ansi]{Inconsolata} 15 | 16 | $if(natbib)$ 17 | \usepackage{natbib} 18 | \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$} 19 | $endif$ 20 | 21 | % Taken from pandoc x.md -o test.tex --standalone 22 | \usepackage{color} 23 | \usepackage{fancyvrb} 24 | \newcommand{\VerbBar}{|} 25 | \newcommand{\VERB}{\Verb[commandchars=\\\{\}]} 26 | \DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}} 27 | \newenvironment{Shaded}{}{} 28 | \newcommand{\KeywordTok} [1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}} 29 | \newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}} 30 | \newcommand{\DecValTok} [1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} 31 | \newcommand{\BaseNTok} [1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} 32 | \newcommand{\FloatTok} [1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} 33 | \newcommand{\CharTok} [1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} 34 | \newcommand{\StringTok} [1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} 35 | \newcommand{\CommentTok} [1]{\textcolor[rgb]{0.38,0.63,0.69}{{#1}}} 36 | \newcommand{\OtherTok} [1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}} 37 | \newcommand{\AlertTok} [1]{\textcolor[rgb]{1.00,0.00,0.00}{{#1}}} 38 | \newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{{#1}}} 39 | \newcommand{\ErrorTok} [1]{\textcolor[rgb]{1.00,0.00,0.00}{{#1}}} 40 | \newcommand{\NormalTok} [1]{{#1}} 41 | 42 | \usepackage{longtable} 43 | \usepackage{booktabs} 44 | \usepackage{graphicx} 45 | 46 | \usepackage[hyphens]{url} 47 | \usepackage[setpagesize=false, % page size defined by xetex 48 | unicode=false, % unicode breaks when used with xetex 49 | xetex]{hyperref} 50 | \hypersetup{breaklinks=true, 51 | bookmarks=true, 52 | pdfauthor={$author-meta$}, 53 | pdftitle={$title-meta$}, 54 | colorlinks=true, 55 | citecolor=$if(citecolor)$$citecolor$$else$blue$endif$, 56 | urlcolor=[rgb]{0.3,0.3,0.3}, 57 | linkcolor=[rgb]{0.3,0.3,0.3}, 58 | pdfborder={0 0 0}} 59 | 60 | % Place links as footnotes 61 | \renewcommand{\href}[2]{#2 (\url{#1})} 62 | % Use ref for internal links 63 | \renewcommand{\hyperref}[2][???]{\autoref{#1}} 64 | \def\chapterautorefname{Chapter} 65 | \def\sectionautorefname{Section} 66 | \def\subsectionautorefname{Section} 67 | 68 | \setlength{\parindent}{0pt} 69 | \setlength{\parskip}{6pt plus 2pt minus 1pt} 70 | \setlength{\emergencystretch}{3em} % prevent overfull lines 71 | 72 | \title{$title-meta$} 73 | \author{$author-meta$} 74 | \date{} 75 | 76 | \begin{document} 77 | $if(toc)$ 78 | \maketitle 79 | $endif$ 80 | 81 | $for(include-before)$ 82 | $include-before$ 83 | $endfor$ 84 | 85 | $if(toc)$ 86 | { 87 | \hypersetup{linkcolor=black} 88 | \setcounter{tocdepth}{3} 89 | \tableofcontents 90 | } 91 | $endif$ 92 | 93 | $body$ 94 | 95 | $if(natbib)$ 96 | $if(biblio-files)$ 97 | \bibliography{$biblio-files$} 98 | $endif$ 99 | $endif$ 100 | 101 | $for(include-after)$ 102 | $include-after$ 103 | $endfor$ 104 | 105 | \end{document} 106 | -------------------------------------------------------------------------------- /inst/chapter-html.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | $if(title-prefix)$$title-prefix$ - $endif$$pagetitle$ 13 | 14 | $for(header-includes)$ 15 | $header-includes$ 16 | $endfor$ 17 | 18 | $if(highlightjs)$ 19 | 20 | 23 | 24 | 29 | 36 | $endif$ 37 | 38 | $if(highlighting-css)$ 39 | 40 | 43 | 48 | 49 | $endif$ 50 | 51 | $for(css)$ 52 | 53 | $endfor$ 54 | 55 | 56 | 57 | 58 | 59 | $if(theme)$ 60 |
61 | $endif$ 62 | 63 | $for(include-before)$ 64 | $include-before$ 65 | $endfor$ 66 | 67 | $if(toc)$ 68 |
69 | $toc$ 70 |
71 | $endif$ 72 | 73 | $body$ 74 | 75 | $for(include-after)$ 76 | $include-after$ 77 | $endfor$ 78 | 79 | $if(theme)$ 80 |
81 | 82 | 90 | $endif$ 91 | 92 | $if(mathjax-url)$ 93 | 94 | 102 | $endif$ 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /inst/raw-html.html: -------------------------------------------------------------------------------- 1 | $body$ 2 | -------------------------------------------------------------------------------- /man/screenshot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/screenshot.R 3 | \name{screenshot} 4 | \alias{embed_png} 5 | \alias{screenshot} 6 | \title{Embed a screenshot.} 7 | \usage{ 8 | screenshot(path, dpi = NULL) 9 | 10 | embed_png(path, dpi = NULL) 11 | } 12 | \arguments{ 13 | \item{path}{Path to screenshot.} 14 | 15 | \item{dpi}{DPI of image. You can leave this blank if the dpi is stored 16 | in the png metadata} 17 | } 18 | \description{ 19 | This embeds a png screenshot into the document. Generally you should use 20 | \code{echo = FALSE} on such blocks. By convention, screenshots should 21 | live in a \code{screenshots/} directory. 22 | } 23 | 24 | -------------------------------------------------------------------------------- /oldbookdown.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | PackageCheckArgs: --as-cran 22 | PackageRoxygenize: rd,collate,namespace 23 | --------------------------------------------------------------------------------