noamross / redoc

[NOTE: Project in suspended animation for now] Reversible Reproducible Documents
https://noamross.github.io/redoc
Other
514 stars 44 forks source link

LaTex equation as inline R object is retained after dedoc #68

Open shirdekel opened 4 years ago

shirdekel commented 4 years ago

reprex.Rmd

YAML:

---
title: Reversible R Markdown Document
subtitle: Your subtitle
author: Your Name
date: Created `r Sys.Date()`
output:
  redoc::redoc:
    highlight_outputs: TRUE
    margins: 1 
    line_numbers: FALSE 
---

Code chunk:

latex1 <- "$x=1$"
latex2 <- "$x=1$, $x=2$"

Inline:

$x=1$

$x=1$, $x=2$

`r latex1`

`r latex2`

Output

reprex.docx

Dedoc

YAML:

---
title: Reversible R Markdown Document
subtitle: Your subtitle
author: Your Name
date: Created `r Sys.Date()`
output:
  redoc::redoc:
    highlight_outputs: TRUE
    margins: 1 
    line_numbers: FALSE 
---

Code chunk:

latex1 <- "$x=1$"
latex2 <- "$x=1$, $x=2$"

Inline:

$x=1$

$x=1$, $x=2$

$x = 1$

$x = 1$`r latex2` $x = 2$

In the third line, the R code was completely removed; while in the fourth line, it now appears within the two equations.


Session Info ```r ─ Session info ───────────────────────── setting value version R version 3.5.3 (2019-03-11) os macOS Mojave 10.14.6 system x86_64, darwin15.6.0 ui RStudio language (EN) collate en_AU.UTF-8 ctype en_AU.UTF-8 tz Australia/Sydney date 2020-03-26 ``` Pandoc version (get with rmarkdown::pandoc_version): 2.3.1 RStudio version (if applicable): 1.3.300