Skip to content

Commit 5792546

Browse files
committed
fix #2599: 7420791 introduced a bug for .md input because knitr::is_latex_output() only works for .Rmd but not for .md; we still check pandoc_to here but also consider the possibility that the output format may include extensions (hence testing -+.* after latex|beamer)
1 parent 0f7f5a5 commit 5792546

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

DESCRIPTION

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

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ rmarkdown 2.30
99

1010
- `convert_ipynb()` no longer drops raw cells with no `format` in metadata (thanks, @katrinabrock, #2587).
1111

12+
- Fixed a bug that prevents `render()` from working when converting `.md` input to PDF (thanks, @mrainers, #2599).
13+
1214

1315
rmarkdown 2.29
1416
================================================================================

R/render.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ render <- function(input,
979979
# if the output format is LaTeX, first convert .md to .tex, and then convert
980980
# .tex to .pdf via latexmk() if PDF output is requested (in rmarkdown <=
981981
# v1.8, we used to call Pandoc to convert .md to .tex and .pdf separately)
982-
if (output_format$pandoc$keep_tex || knitr::is_latex_output()) {
982+
if (output_format$pandoc$keep_tex || grepl("^(latex|beamer)($|[-+].*)", pandoc_to)) {
983983
# do not use pandoc-citeproc if needs to build bibliography
984984
convert(texfile, run_citeproc && !need_bibtex)
985985
# patch the .tex output generated from the default Pandoc LaTeX template

0 commit comments

Comments
 (0)