jimhester / knitrBootstrap

A framework to create bootstrap styled HTML reports from knitr Rmarkdown.
Other
274 stars 61 forks source link

Line breaks are gone in R code and output #189

Closed paullemmens closed 8 years ago

paullemmens commented 8 years ago

I am rebuilding my R setup after having had my laptop stolen and something seems to be amiss with the linebreaks in the R code and output sections of the HTML file. It appears to be related to knitrBootstrap because a regular rmarkdown html_document works as expected (see below).

Not sure how to further debug and/or fix this. Any help much appreciated!

YAML header used:


---
title: 'Import Matlab data'
output:
  html_document:
    toc: true
    theme: default
  knitrBootstrap::bootstrap_document:
    theme: default
    highlight: 'visual studio'
    theme.chooser: true
    highlight.chooser: true
    clean_supporting: true

---

knitrBootstrap screen grab:

image

Regular rmarkdown screen grab:

image

R version 3.2.4 Revised (2016-03-16 r70336)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=Dutch_Netherlands.1252  LC_CTYPE=Dutch_Netherlands.1252    LC_MONETARY=Dutch_Netherlands.1252 LC_NUMERIC=C                       LC_TIME=Dutch_Netherlands.1252    

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

other attached packages:
[1] R.matlab_3.5.0    reshape2_1.4.1    dplyr_0.4.3       scales_0.4.0      stringr_1.0.0     Cairo_1.5-9       rmarkdown_0.9.5.2 ggplot2_2.1.0    

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.3          formatR_1.3          RColorBrewer_1.1-2   plyr_1.8.3           R.methodsS3_1.7.1    R.utils_2.2.0        tools_3.2.4          rpart_4.1-10         digest_0.6.9        
[10] evaluate_0.8.3       gtable_0.2.0         lattice_0.20-33      DBI_0.3.1            yaml_2.1.13          parallel_3.2.4       gridExtra_2.2.1      cluster_2.0.3        knitr_1.12.3        
[19] nnet_7.3-12          grid_3.2.4           R6_2.1.2             survival_2.38-3      foreign_0.8-66       knitrBootstrap_1.0.0 latticeExtra_0.6-28  Formula_1.2-1        magrittr_1.5        
[28] Hmisc_3.17-2         htmltools_0.3        splines_3.2.4        assertthat_0.1       mime_0.4             colorspace_1.2-6     labeling_0.3         stringi_1.0-1        acepack_1.3-3.3     
[37] lazyeval_0.1.10      munsell_0.4.3        markdown_0.7.7       R.oo_1.20.0         
humburg commented 8 years ago

Which version of pandoc do you have installed?

It looks like the recent pandoc 1.17 introduced a bug that removes white space in embedded HTML <pre> tags (jgm/pandoc#2804), which is how knitrBootstrap generates the code chunks.

paullemmens commented 8 years ago

I indeed have the most recent version installed: pandoc 1.17. From the link I read that if I maybe install a beta that everything should be ok?

humburg commented 8 years ago

Yes, the issue had been fixed in the development version and working fine for me. If you don't mind compiling that yourself you should be all set.

I'm closing this issue as it seems to be resolved.

paullemmens commented 8 years ago

Compiling, unfortunately, is not my thing anymore, but I'll try and downgrade a few versions and wait it out :)

thanks!

humburg commented 8 years ago

Looks like a new release, 1.17.0.2, incorporating the fix is already out.