Skip to content

Commit 7bc6575

Browse files
committed
fix #1802: change to = 'pdf' to to = 'latex', and update the non-working examples
1 parent 8074707 commit 7bc6575

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: rmarkdown
22
Type: Package
33
Title: Dynamic Documents for R
4-
Version: 2.1.8
4+
Version: 2.1.9
55
Authors@R: c(
66
person("JJ", "Allaire", role = "aut", email = "[email protected]"),
77
person("Yihui", "Xie", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")),

NEWS.md

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ rmarkdown 2.2
2525

2626
- `render()` now respects the YAML metadata in the R script when rendering the script with Pandoc 2.8 or later (thanks, @nsoranzo #1740, @cderv #1741).
2727

28+
- For `pandoc_convert()`, when the argument `to = 'pdf'`, it will be changed to `'latex'` internally (thanks, @JohannesFriedrich, #1802).
29+
2830

2931
rmarkdown 2.1
3032
================================================================================

R/pandoc.R

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
#'
2929
#' # convert markdown to various formats
3030
#' pandoc_convert("input.md", to = "html")
31-
#' pandoc_convert("input.md", to = "pdf")
31+
#' pandoc_convert("input.md", to = "latex")
3232
#'
3333
#' # process citations
3434
#' pandoc_convert("input.md", to = "html", citeproc = TRUE)
3535
#'
3636
#' # add some pandoc options
37-
#' pandoc_convert("input.md", to="pdf", options = c("--listings"))
37+
#' pandoc_convert("input.md", to = "latex", options = c("--listings"))
3838
#' }
3939
#' @export
4040
pandoc_convert <- function(input,
@@ -61,6 +61,7 @@ pandoc_convert <- function(input,
6161
args <- c(input)
6262
if (!is.null(to)) {
6363
if (to == 'html') to <- 'html4'
64+
if (to == 'pdf') to <- 'latex'
6465
args <- c(args, "--to", to)
6566
}
6667
if (!is.null(from))

man/pandoc_convert.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)