Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pandoc error with pander and pandoc 2.0 #320

Open
muschellij2 opened this issue Mar 5, 2018 · 3 comments
Open

Pandoc error with pander and pandoc 2.0 #320

muschellij2 opened this issue Mar 5, 2018 · 3 comments

Comments

@muschellij2
Copy link

pandoc: PandocLuaException "[string \"local fig_caption = true...\"]:456: bad argument #2 to 'format' (number has no integer representation)"
Error: pandoc document conversion failed with error 1

Example Rmd where this occurs:

break_pandoc.zip

I have pander * 0.6.1 2017-08-06 CRAN (R 3.4.1) and I get the following error:

library(pander)
res = unzip("break_pandoc.zip", files = "break_pandoc.Rmd")
#> Warning in unzip("break_pandoc.zip", files = "break_pandoc.Rmd"): error 1
#> in extracting from zip file
rmarkdown::render("break_pandoc.Rmd")
#> processing file: break_pandoc.Rmd
#> output file: break_pandoc.knit.md
#> /usr/local/bin/pandoc +RTS -K512m -RTS break_pandoc.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output break_pandoc.html --email-obfuscation none --self-contained --variable transition=0.4 --template /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rmarkdown/rmd/ioslides/default.html --include-in-header /var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpjAJmrG/rmarkdown-str113de752a3f1d.html --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' 
#> /usr/local/bin/pandoc +RTS -K512m -RTS break_pandoc.utf8.md --to ioslides_presentation.lua --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output /var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpjAJmrG/ioslides-output113de2895c503.html --slide-level 2
#> Error: pandoc document conversion failed with error 1

Session Information

devtools::session_info()
#> Session info -------------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.4.3 (2017-11-30)
#>  system   x86_64, darwin15.6.0        
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_US.UTF-8                 
#>  tz       America/New_York            
#>  date     2018-03-05
#> Packages -----------------------------------------------------------------
#>  package   * version date       source        
#>  backports   1.1.2   2017-12-13 CRAN (R 3.4.3)
#>  base      * 3.4.3   2017-12-07 local         
#>  compiler    3.4.3   2017-12-07 local         
#>  datasets  * 3.4.3   2017-12-07 local         
#>  devtools    1.13.5  2018-02-18 CRAN (R 3.4.3)
#>  digest      0.6.15  2018-01-28 CRAN (R 3.4.3)
#>  evaluate    0.10.1  2017-06-24 cran (@0.10.1)
#>  graphics  * 3.4.3   2017-12-07 local         
#>  grDevices * 3.4.3   2017-12-07 local         
#>  htmltools   0.3.6   2017-04-28 CRAN (R 3.4.0)
#>  knitr       1.18    2017-12-27 CRAN (R 3.4.3)
#>  magrittr    1.5     2014-11-22 CRAN (R 3.4.0)
#>  memoise     1.1.0   2017-04-21 CRAN (R 3.4.0)
#>  methods   * 3.4.3   2017-12-07 local         
#>  pander    * 0.6.1   2017-08-06 CRAN (R 3.4.1)
#>  Rcpp        0.12.15 2018-01-20 CRAN (R 3.4.3)
#>  rmarkdown   1.8     2017-11-17 CRAN (R 3.4.2)
#>  rprojroot   1.2     2017-01-16 CRAN (R 3.4.0)
#>  stats     * 3.4.3   2017-12-07 local         
#>  stringi     1.1.6   2017-11-17 CRAN (R 3.4.2)
#>  stringr     1.3.0   2018-02-19 cran (@1.3.0) 
#>  tools       3.4.3   2017-12-07 local         
#>  utils     * 3.4.3   2017-12-07 local         
#>  withr       2.1.1   2017-12-19 CRAN (R 3.4.3)
#>  yaml        2.1.16  2017-12-12 cran (@2.1.16)
MacBook-Pro-6$ pandoc --version
pandoc 2.1.2
Compiled with pandoc-types 1.17.3.1, texmath 0.10.1.1, skylighting 0.6
Copyright (C) 2006-2018 John MacFarlane
Web:  http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.
@daroczig
Copy link
Member

daroczig commented Mar 6, 2018

Are you sure it's a pander issue? Eg pander is generating some markdown failling pandoc? Checking the below:

root@56d2b523ff38:/tmp$ /usr/bin/pandoc -v
pandoc 2.1.1
Compiled with pandoc-types 1.17.3, texmath 0.10.1, skylighting 0.6
Default user data directory: /root/.pandoc
Copyright (C) 2006-2018 John MacFarlane
Web:  http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.

root@56d2b523ff38:/tmp$ /usr/bin/pandoc -t html

---------------------
 V1     V2      V3   
----- ------- -------
 hey   DICOM   NIfTI 
---------------------

<table style="width:31%;">
<colgroup>
<col style="width: 8%" />
<col style="width: 11%" />
<col style="width: 11%" />
</colgroup>
<thead>
<tr class="header">
<th style="text-align: center;">V1</th>
<th style="text-align: center;">V2</th>
<th style="text-align: center;">V3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: center;">hey</td>
<td style="text-align: center;">DICOM</td>
<td style="text-align: center;">NIfTI</td>
</tr>
</tbody>
</table>

@muschellij2
Copy link
Author

muschellij2 commented Mar 6, 2018 via email

@afranks86
Copy link

I have the same error trying to render the following markdown table:

"Code Rendered math
$x$ $x$
$\theta$ $\theta$
$x_i^2$ $x_i^2$
$\frac{1}{n}\sum_{i=1}^n x_i$ $\frac{1}{n} \sum_{i=1}^n x_i$
$\frac{1}{n}\sum_{i=1}^n (x_i-\bar x)^2$ $\frac{1}{n} \sum_{i=1}^n \bar (x_i - x)^2$"

It seems to have to do with the length of the last cell in the last line, as if I shorten it, I don't get the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants