Skip to content

Commit

Permalink
fix #10, fix #49, fix #70, and fix #149 by putting chunk output in a …
Browse files Browse the repository at this point in the history
…raw latex block ```{=latex} for R Journal articles, which is the same fix as 8da3d29
  • Loading branch information
yihui committed Jul 3, 2018
1 parent 86d1326 commit 928d6cd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rticles
Type: Package
Title: Article Formats for R Markdown
Version: 0.4.5
Version: 0.4.6
Authors@R: c(
person("JJ", "Allaire", role = c("aut", "cre"), email = "jj@rstudio.com"),
person(family = "R Foundation", role = c("aut", "cph")),
Expand Down
7 changes: 4 additions & 3 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ rticles 0.5 (unreleased)

- Add MDPI journal template

- Fixed #6 and #132: dollar signs can be used in code chunks in JSS articles
now, but it will require Pandoc 2.x (you can use the Preview version of
RStudio if you do not want to install Pandoc separately).
- Fixed #6, #10, #49, #132, and #149: dollar signs and other special LaTeX
characters such as `^` can be used in code chunks in JSS and R Journal
articles now, but Pandoc 2.x will be required (you can use the Preview version
of RStudio if you do not want to install Pandoc separately).

rticles 0.4.1
---------------------------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion R/rjournal_article.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#' @export
rjournal_article <- function(...) {

rmarkdown::pandoc_available('2.2', TRUE)

template <- find_resource("rjournal_article", "template.tex")

base <- inherit_pdf_document(..., template = template)
Expand All @@ -45,7 +47,7 @@ rjournal_article <- function(...) {
hilight_source <- knitr_fun('hilight_source')
hook_chunk = function(x, options) {
if (output_asis(x, options)) return(x)
paste('\\begin{Schunk}\n', x, '\\end{Schunk}', sep = '')
paste0('```{=latex}\n\\begin{Schunk}\n', x, '\\end{Schunk}\n```')
}
hook_input <- function(x, options)
paste(c('\\begin{Sinput}', hilight_source(x, 'sweave', options), '\\end{Sinput}', ''),
Expand Down

0 comments on commit 928d6cd

Please sign in to comment.