Skip to content

Commit 928d6cd

Browse files
committed
fix #10, fix #49, fix #70, and fix #149 by putting chunk output in a raw latex block ```{=latex} for R Journal articles, which is the same fix as 8da3d29
1 parent 86d1326 commit 928d6cd

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
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.5
4+
Version: 0.4.6
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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +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.x (you can use the Preview version of
8-
RStudio if you do not want to install Pandoc separately).
6+
- Fixed #6, #10, #49, #132, and #149: dollar signs and other special LaTeX
7+
characters such as `^` can be used in code chunks in JSS and R Journal
8+
articles now, but Pandoc 2.x will be required (you can use the Preview version
9+
of RStudio if you do not want to install Pandoc separately).
910

1011
rticles 0.4.1
1112
---------------------------------------------------------------------

R/rjournal_article.R

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

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

2527
base <- inherit_pdf_document(..., template = template)
@@ -45,7 +47,7 @@ rjournal_article <- function(...) {
4547
hilight_source <- knitr_fun('hilight_source')
4648
hook_chunk = function(x, options) {
4749
if (output_asis(x, options)) return(x)
48-
paste('\\begin{Schunk}\n', x, '\\end{Schunk}', sep = '')
50+
paste0('```{=latex}\n\\begin{Schunk}\n', x, '\\end{Schunk}\n```')
4951
}
5052
hook_input <- function(x, options)
5153
paste(c('\\begin{Sinput}', hilight_source(x, 'sweave', options), '\\end{Sinput}', ''),

0 commit comments

Comments
 (0)