rmarkdown icon indicating copy to clipboard operation
rmarkdown copied to clipboard

`keep_md` is not respected when there's a LaTeX error.

Open dmurdoch opened this issue 1 year ago • 0 comments

I just noticed this while trying to debug a LaTeX error in an R Markdown document: if there's a LaTeX error, the .md file isn't kept. For example:

---
title: "Untitled"
date: "2023-01-17"
output: 
  pdf_document:
    keep_md: true
---

This is the markdown, with a LaTeX error:  \foobar

When I process this I see a LaTeX error, but I don't see the .md file (or I do see one, but it is from an earlier run and is not replaced).

> xfun::session_info('rmarkdown')
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.6.2, RStudio 2022.12.0.353

Locale: en_US.UTF-8 / en_US.UTF-8 / en_US.UTF-8 / C / en_US.UTF-8 / en_US.UTF-8

Package version:
  base64enc_0.1.3 bslib_0.4.2     cachem_1.0.6    cli_3.6.0      
  digest_0.6.31   ellipsis_0.3.2  evaluate_0.19   fastmap_1.1.0  
  fs_1.5.2        glue_1.6.2      graphics_4.2.1  grDevices_4.2.1
  highr_0.10      htmltools_0.5.4 jquerylib_0.1.4 jsonlite_1.8.4 
  knitr_1.41.1    lifecycle_1.0.3 magrittr_2.0.3  memoise_2.0.1  
  methods_4.2.1   mime_0.12       R6_2.5.1        rappdirs_0.3.3 
  rlang_1.0.6     rmarkdown_2.19  sass_0.4.4      stats_4.2.1    
  stringi_1.7.12  stringr_1.5.0   tinytex_0.43    tools_4.2.1    
  utils_4.2.1     vctrs_0.5.1     xfun_0.36       yaml_2.3.6     

Pandoc version: 2.19.2

Checklist

When filing a bug report, please check the boxes below to confirm that you have provided us with the information we need. Have you:

  • [x ] formatted your issue so it is easier for us to read?

  • [x ] included a minimal, self-contained, and reproducible example?

  • [ x] pasted the output from xfun::session_info('rmarkdown') in your issue?

  • [ ] upgraded all your packages to their latest versions (including your versions of R, the RStudio IDE, and relevant R packages)?

  • [ ] installed and tested your bug with the development version of the rmarkdown package using remotes::install_github("rstudio/rmarkdown")?

dmurdoch avatar Jan 17 '23 21:01 dmurdoch