Pander list indentation different between Quarto and Rmarkdown

This code:

pander::pander(list("1", "2", 3, c(1, 2)))

renders a list that looks like this in an Rmarkdown file:
rmarkdownlist

and a list that looks like this in a Quarto file:
quartolist

I'm curious as to the why, but way more interested in now to prevent the second indent.

This renders in qmd as

and in rmd as

Try fresh qmd and rmd documents with just this chunk.

That's exactly what I did before i posted. :thinking: Thank you for checking.

I updated Rmarkdown, quarto and pander. Fresh Rstudio start, not in an Rproject either.
Any ideas as to the next step to debug?

> sessionInfo()
R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets 
[6] methods   base     

loaded via a namespace (and not attached):
 [1] compiler_4.2.1   fastmap_1.1.0    rsconnect_0.8.27
 [4] cli_3.3.0        htmltools_0.5.3  tools_4.2.1     
 [7] rstudioapi_0.13  yaml_2.3.6       Rcpp_1.0.9      
[10] pander_0.6.5     rmarkdown_2.19   knitr_1.39      
[13] xfun_0.31        digest_0.6.29    rlang_1.0.4     
[16] evaluate_0.15

@Norcalbiostat I can reproduce on my side with latest Quarto - Seems like a bug, and maybe a regression from @technocrat tests.

Which Quarto versions are you all using ?

Here's zsh's idea of quarto

carbon

There's another buried in the RStudio.app tree that I saw flash by, but can't say which is used.

Here's sessionInfo()

sessionInfo()
#> R version 4.2.2 (2022-10-31)
#> Platform: aarch64-apple-darwin20 (64-bit)
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] rstudioapi_0.14   knitr_1.41        magrittr_2.0.3    R.cache_0.16.0   
#>  [5] rlang_1.0.6       fastmap_1.1.0     stringr_1.5.0     styler_1.8.1     
#>  [9] highr_0.10        tools_4.2.2       xfun_0.36         R.oo_1.25.0      
#> [13] cli_3.6.0         withr_2.5.0       htmltools_0.5.4   yaml_2.3.6       
#> [17] digest_0.6.31     lifecycle_1.0.3   purrr_1.0.1       vctrs_0.5.1      
#> [21] R.utils_2.12.2    fs_1.5.2          glue_1.6.2        evaluate_0.19    
#> [25] rmarkdown_2.19    reprex_2.0.2      stringi_1.7.12    compiler_4.2.2   
#> [29] R.methodsS3_1.8.2

Created on 2023-01-17 with reprex v2.0.2

Just for amusement

v0.9.312 is pretty old ! This is pre stable v1.0 when Quarto was announced.

v1.2 is the latest release, and soon v1.3 will be out. You should probably update.

But this confirms that somethings has changed somewhere.

1 Like

Looks like i'm using 1.2.269
I don't believe I installed quarto outside of updating Rstudio itself.

I'm glad that @cderv can reproduce the error at least!

Is there something I need to do to report the bug, or...?

I'm now with

quarto --version
1.2.313

and the rendering of my qmd and Rmd files is as before, without the indentation trouble.

Oh really interesting !

Can you reshare your session information including pander version ?

Thank you

library(pander)
sessionInfo()
#> R version 4.2.2 (2022-10-31)
#> Platform: aarch64-apple-darwin20 (64-bit)
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] pander_0.6.5
#> 
#> loaded via a namespace (and not attached):
#>  [1] Rcpp_1.0.9        rstudioapi_0.14   knitr_1.41        magrittr_2.0.3   
#>  [5] R.cache_0.16.0    rlang_1.0.6       fastmap_1.1.0     stringr_1.5.0    
#>  [9] styler_1.8.1      highr_0.10        tools_4.2.2       xfun_0.36        
#> [13] R.oo_1.25.0       cli_3.6.0         withr_2.5.0       htmltools_0.5.4  
#> [17] yaml_2.3.6        digest_0.6.31     lifecycle_1.0.3   purrr_1.0.1      
#> [21] vctrs_0.5.1       R.utils_2.12.2    fs_1.5.2          glue_1.6.2       
#> [25] evaluate_0.19     rmarkdown_2.19    reprex_2.0.2      stringi_1.7.12   
#> [29] compiler_4.2.2    R.methodsS3_1.8.2

Thanks I got the same pander version

How do you render to qmd ?
This is the test document

---
title: "Untitled"
format: html
keep-md: true
---

```{r}
pander::pander(list("1", "2", 3, c(1, 2)))
```

Then I am using quarto render in terminal

In IDE

From cli

The difference being

shell

which quarto
/usr/local/bin/quarto

Rstudio

Sys.which("quarto")
#>                                                               quarto 
#> "/Applications/RStudio.app/Contents/Resources/app/quarto/bin/quarto"

TIL, with the drop of pandoc 3.0 that RStudio installs its own version of pandoc in /Applications/RStudio.app/Contents/Resources/app/quarto/bin And, in the subdirectory tools other binaries that I have already installed.

I think I've reached the tipping point that the only way forward is to switch to RStudio Server running in a virtual ubuntu, maybe in docker. That or VSCode, if it's not giving me two watches with which to be uncertain what time it is.

Related posts

@technocrat Pandoc is shipped with RStudio IDE since a long time. Nothing to do with Pandoc 3.0

Since a few version of RStudio IDE, and since Quarto v1 is out probably, Quarto is shipped with RStudio IDE too. As Quarto bundles Pandoc itself, RStudio IDE is now using the Pandoc version shipped with Quarto.

Latest version of RStudio IDE should use Quarto binary found on PATH, and if none, it will be using the bundled version.

Regarding Pandoc,

  • Quarto will always use the Pandoc version it is shipping (because a Quarto version only works with a specific Pandoc version).
  • If only Pandoc is necessary, like with rmarkdown::render(), the detection process of rmarkdown is to use the pandoc binary with higher version from PATH or the one bundle in RStudio IDE.

Anyway, I am surprised you don't get the same result in CLI and IDE:

  • Which version of the IDE are you using ?
  • Can you do quarto check install inside your Terminal and inside RStudio IDE's terminal ?

Thank you

Hi, @cderv

Here's the terminal pane

~/projects/demo via 📐 v4.2.2 
❯ quarto check

[✓] Checking Quarto installation......OK
      Version: 1.2.313
      Path: /Applications/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.9.6
      Path: /Applications/Xcode.app/Contents/Developer/usr/bin/python3
      Jupyter: 4.11.2
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.2.2
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library
      rmarkdown: 2.19

[✓] Checking Knitr engine render......OK

Here's from Warp terminal

quarto check

[✓] Checking Quarto installation......OK
      Version: 1.2.313
      Path: /Applications/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.9.6
      Path: /Applications/Xcode.app/Contents/Developer/usr/bin/python3
      Jupyter: 4.11.2
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.2.2
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library
      rmarkdown: 2.19

[✓] Checking Knitr engine render......OK

And here is what will happen when the Elspeth looks in $PATH for quarto

> Sys.which("quarto")
                                                              quarto 
"/Applications/RStudio.app/Contents/Resources/app/quarto/bin/quarto" 
> system("quarto check")
/Applications/RStudio.app/Contents/Resources/app/quarto/bin/quarto: line 19: dirname: command not found
/Applications/RStudio.app/Contents/Resources/app/quarto/bin/quarto: line 23: basename: command not found
ERROR: Cannot determine the Quarto source path. This script must be run from the bin or common folder.

All of this implicates something evil done to ignore $PATH, leading, of course, to

install.packages("A3")
#> also installing the dependency 'pbapply'
#> Warning in system(paste0("tar zxf \"", path.expand(what), "\" -C \"",
#> path.expand(where), : error in running command
#> Warning: 'tar' returned non-zero exit code 127
#> Error: file '/var/folders/0j/3g7q2zss7fb55q5wqg9t141r0000gn/T//RtmpbnuOm1/downloaded_packages/pbapply_1.7-0.tgz' is not a macOS binary package

and with update.packages(). Wrong $PATH means no tar means no unzip, which means no install.

Thanks for sharing - we've got a bit off track for original issue though.

I don't understand this would error. quarto is found as the one bundled in IDE, so next command should work; Somehow this is broken. Check your IDE version and maybe update to more recent one if not already. Latest version is recommended with Quarto.

It seems like you have a independant quarto on PATH - this is good and should have been found and used by IDE. Again not sure what is wrong, except not latest version.

Please do open issues in RStudio IDE if you get the same with latest version.

I opened it there

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.