Skip to content

Commit

Permalink
Merge pull request #210 from cderv/fix/knitr-breakage
Browse files Browse the repository at this point in the history
Fix knitr 1.44 breakage by unlocking opts_current before modifyfing it
  • Loading branch information
ChrisRackauckas authored Dec 4, 2024
2 parents 7b4ec46 + 3a791f3 commit 8cc8b8e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: JuliaCall
Type: Package
Title: Seamless Integration Between R and 'Julia'
Version: 0.17.5
Version: 0.17.5.9000
Date: 2022-09-08
Authors@R: c(
person("Changcheng", "Li", , "[email protected]", c("aut", "cre")),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# JuliaCall 0.17.5.9000

* Fix breakage with **knitr** 1.44 when using Plots in a `julia` chunk ([#209](https://github.com/Non-Contradiction/JuliaCall/issues/209)).

# JuliaCall 0.17.5

* Nineteenth release on CRAN.
Expand Down
5 changes: 5 additions & 0 deletions R/RMarkdown.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ begin_plot <- function(){

## This function is used by Julia plot_display function
finish_plot <- function(){
## FIXME: opts_current is supposed to be read-only
## so it require unlock to be modified since knitr 1.44
## https://yihui.org/en/2023/09/knitr-1-44/
knitr::opts_current$lock(FALSE)
knitr::opts_current$set(Jfig.cur = .julia$pending_plot_number + 1L)
knitr::opts_current$lock(TRUE)
julia$current_plot <- .julia$pending_plot
}

Expand Down

0 comments on commit 8cc8b8e

Please sign in to comment.