Rapporter / pander

An R Pandoc Writer: Convert arbitrary R objects into markdown
http://rapporter.github.io/pander/
Open Software License 3.0
294 stars 66 forks source link

incompatibility between ** and : #306

Closed pachadotdev closed 7 years ago

pachadotdev commented 7 years ago

Hi

If I write

library(pander)
pander(sessionInfo())

The part about **Platform:** is wrongly displayed in html/LaTeX after markdown conversion.

If I just replace to <b>Platform:<b>its displayed ok.

daroczig commented 7 years ago

Can you share your sessionInfo() and how the pander version looks? I can only test on Linux now which seems to work fine:

image

pachadotdev commented 7 years ago

here is it

> library(pander)
> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /usr/local/Cellar/openblas/0.2.19_1/lib/libopenblasp-r0.2.19.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.0 bindrcpp_0.2 dplyr_0.7.2 

loaded via a namespace (and not attached):
 [1] compiler_3.4.1   magrittr_1.5     assertthat_0.2.0 R6_2.2.2         tools_3.4.1      glue_1.1.1      
 [7] tibble_1.3.3     yaml_2.1.14      Rcpp_0.12.12     digest_0.6.12    pkgconfig_2.0.1  rlang_0.1.1     
[13] bindr_0.1     
> pander(sessionInfo())
**R version 3.4.1 (2017-06-30)**

**Platform:** x86_64-apple-darwin15.6.0 (64-bit) 

**locale:**
en_US.UTF-8||en_US.UTF-8||en_US.UTF-8||C||en_US.UTF-8||en_US.UTF-8

**attached base packages:** 
_stats_, _graphics_, _grDevices_, _utils_, _datasets_, _methods_ and _base_

**other attached packages:** 
_pander(v.0.6.0)_, _bindrcpp(v.0.2)_ and _dplyr(v.0.7.2)_

**loaded via a namespace (and not attached):** 
_compiler(v.3.4.1)_, _magrittr(v.1.5)_, _assertthat(v.0.2.0)_, _R6(v.2.2.2)_, _tools(v.3.4.1)_, _glue(v.1.1.1)_, _tibble(v.1.3.3)_, _yaml(v.2.1.14)_, _Rcpp(v.0.12.12)_, _digest(v.0.6.12)_, _pkgconfig(v.2.0.1)_, _rlang(v.0.1.1)_ and _bindr(v.0.1)_
daroczig commented 7 years ago

Thanks for your prompt reply, but I don't see any markdown issue in this output, so I'm closing the ticket. But please feel free to reopen with some additional information, eg screenshot of the malformed PDF and HTML and some research on what might be wrong with the current markdown. Thanks!

pachadotdev commented 7 years ago

sorry, I misunderstood

here is a sample in Rmd


title: "Reporting :** error " output: html_document

knitr::opts_chunk$set(echo = TRUE)

R Markdown

library(pander)
pander(sessionInfo())

And the result is (see the "Platform")

screen shot 2017-08-14 at 15 04 31

If I find a solution I'll send a pull request :)

daroczig commented 7 years ago

Thanks for the clarification -- now I see the problem :)

daroczig commented 7 years ago

Debugging this for a while, I don't think that it's a pander issue -- pander is providing proper markdown. Rendering that into HTML or PDF or other document format works without problem using pandoc.

But you are right, it indeed fails when running from RStudio, and that's because RStudio runs pandoc when knitting the document to HTLM with the markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash pandoc extensions -- as per the docs:

By default R Markdown is defined as all pandoc markdown extensions with the following tweaks for backward compatibility with the markdown package:

I'm pretty sure those extra tweaks can be disabled somehow in the R Markdown yaml header, but I'm not sure how to do that. I hope this helped.