Skip to content

Commit 8da3d29

Browse files
committed
fix #132 and fix #6: put JSS code chunks in a raw latex block ```{=latex}, which requires Pandoc 2.x
this is a less hackish fix than #161 also fixes rstudio/rmarkdown#398
1 parent 064153c commit 8da3d29

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: rticles
22
Type: Package
33
Title: Article Formats for R Markdown
4-
Version: 0.4.4
4+
Version: 0.4.5
55
Authors@R: c(
66
person("JJ", "Allaire", role = c("aut", "cre"), email = "[email protected]"),
77
person(family = "R Foundation", role = c("aut", "cph")),

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ rticles 0.5 (unreleased)
33

44
- Add MDPI journal template
55

6+
- Fixed #6 and #132: dollar signs can be used in code chunks in JSS articles
7+
now, but it will require Pandoc 2.2.1 (you can use the Preview version of
8+
RStudio if you do not want to install Pandoc separately).
9+
610
rticles 0.4.1
711
---------------------------------------------------------------------
812

R/jss_article.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#' @export
2121
jss_article <- function(..., keep_tex = TRUE, citation_package = 'natbib') {
2222

23+
rmarkdown::pandoc_available('2.2.1', TRUE)
24+
2325
template <- find_resource("jss_article", "template.tex")
2426

2527
base <- inherit_pdf_document(
@@ -40,7 +42,7 @@ jss_article <- function(..., keep_tex = TRUE, citation_package = 'natbib') {
4042
base$knitr$opts_chunk$fig.align <- "center"
4143
hook_chunk <- function(x, options) {
4244
if (output_asis(x, options)) return(x)
43-
paste0('\\begin{CodeChunk}\n', x, '\\end{CodeChunk}')
45+
paste0('```{=latex}\n\\begin{CodeChunk}\n', x, '\\end{CodeChunk}\n```')
4446
}
4547
hook_input <- function(x, options) {
4648
if (options$prompt && length(x)) {

0 commit comments

Comments
 (0)