Søren ONeill
2015-06-11 11:23:44 UTC
I have spent the last two days (being sick) and looking at this very
annoying issue:
*The problem:*
using Rstudio to knit Rmd->HTML (with embedded R-code and
citations/bibliographies):
1. I am successful as long as I dont specify a csl file in the header
2. if I do specify a csl file I get the following error in the console:
pandoc-citeproc: error while reading the XML file: XMLParseError "syntax
error" (XMLParseLocation {xmlLineNumber = 1, xmlColumnNumber = 0,
xmlByteIndex = 0, xmlByteCount = 0})
pandoc: Error running filter /usr/lib/rstudio/bin/pandoc/pandoc-citeproc
Fejl: pandoc document conversion failed with error 83
Execution halted
*The platform:*
I have reproduced this issue on two separate linux installations, including
a fresh ubuntu 14.04 install, with a fresh install of Rstudio and pandoc.
The bibtex and csl files are both available in the same folder as the Rmd
file.
*The investigation:*
As the problem appears (to me) to be related to pandoc-citeproc I have
tried to install newer versions than what is available in the Ubuntu
repositories (1.12):
I tried the latest available binary from the pandoc site -- did not help
I tried installing the haskell platform itself and installing pandoc
(1.14.0.4) and pandoc-citeproc (0.7.2) via cabal -- did not help
I have also tried doing the motions manually instead of via Rstudio:
Knit'ing from Rmd to md via R works flawlessly, but the resulting .md file
pandoc-citeproc: error while parsing the XML string
pandoc: Error running filter pandoc-citeproc
*The suggestions:*
The closest I have come to a solution online is this link
<https://github.com/jgm/pandoc-citeproc/issues/81>
I gather I need to 'pull in hexpat', what ever that means ...
Whether that is the correct solution or not I don't know, but it's
certainly not a very accessible solution to us non-haskellians
*The solution:*
...? ... this is where you come in :-)
*The appendix:*
My Rmd file:
---
title: "Test of R, Rmarkdown & BibTeX"
csl: bmcart.cls
output: html_document
bibliography: references.bib
---
This is a test of R, Rmarkdown and BibTeX in which I hope to use RStudio to
generate HTML, Word files and pdf files from an Rmarkdown script.
Particularly, I want the script to include text, embedded R code, citations[
@clar_clinical_2014] from a BibTeX catalogue and graphics.
Can it all be done **in a single file**, I wonder?
```{r}
summary(cars)
```
You can also embed plots, for example:
```{r, echo=FALSE}
plot(cars)
```
Note that the `echo = FALSE` parameter was added to the code chunk to
prevent printing of the R code that generated the plot.
#References
..after knitting with R:
---
title: "Test of R, Rmarkdown & BibTeX"
csl: bmcart.cls
output: html_document
bibliography: references.bib
---
This is a test of R, Rmarkdown and BibTeX in which I hope to use RStudio to
generate HTML, Word files and pdf files from an Rmarkdown script.
Particularly, I want the script to include text, embedded R code, citations[
@clar_clinical_2014] from a BibTeX catalogue and graphics.
Can it all be done **in a single file**, I wonder?
```r
summary(cars)
```
```
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
```
You can also embed plots, for example:

Note that the `echo = FALSE` parameter was added to the code chunk to
prevent printing of the R code that generated the plot.
#References
annoying issue:
*The problem:*
using Rstudio to knit Rmd->HTML (with embedded R-code and
citations/bibliographies):
1. I am successful as long as I dont specify a csl file in the header
2. if I do specify a csl file I get the following error in the console:
pandoc-citeproc: error while reading the XML file: XMLParseError "syntax
error" (XMLParseLocation {xmlLineNumber = 1, xmlColumnNumber = 0,
xmlByteIndex = 0, xmlByteCount = 0})
pandoc: Error running filter /usr/lib/rstudio/bin/pandoc/pandoc-citeproc
Fejl: pandoc document conversion failed with error 83
Execution halted
*The platform:*
I have reproduced this issue on two separate linux installations, including
a fresh ubuntu 14.04 install, with a fresh install of Rstudio and pandoc.
The bibtex and csl files are both available in the same folder as the Rmd
file.
*The investigation:*
As the problem appears (to me) to be related to pandoc-citeproc I have
tried to install newer versions than what is available in the Ubuntu
repositories (1.12):
I tried the latest available binary from the pandoc site -- did not help
I tried installing the haskell platform itself and installing pandoc
(1.14.0.4) and pandoc-citeproc (0.7.2) via cabal -- did not help
I have also tried doing the motions manually instead of via Rstudio:
Knit'ing from Rmd to md via R works flawlessly, but the resulting .md file
pandoc Test_manuscript.md -o Test_manuscript.docx --bibliography
references.bibpandoc-citeproc: error while parsing the XML string
pandoc: Error running filter pandoc-citeproc
*The suggestions:*
The closest I have come to a solution online is this link
<https://github.com/jgm/pandoc-citeproc/issues/81>
I gather I need to 'pull in hexpat', what ever that means ...
Whether that is the correct solution or not I don't know, but it's
certainly not a very accessible solution to us non-haskellians
*The solution:*
...? ... this is where you come in :-)
*The appendix:*
My Rmd file:
---
title: "Test of R, Rmarkdown & BibTeX"
csl: bmcart.cls
output: html_document
bibliography: references.bib
---
This is a test of R, Rmarkdown and BibTeX in which I hope to use RStudio to
generate HTML, Word files and pdf files from an Rmarkdown script.
Particularly, I want the script to include text, embedded R code, citations[
@clar_clinical_2014] from a BibTeX catalogue and graphics.
Can it all be done **in a single file**, I wonder?
```{r}
summary(cars)
```
You can also embed plots, for example:
```{r, echo=FALSE}
plot(cars)
```
Note that the `echo = FALSE` parameter was added to the code chunk to
prevent printing of the R code that generated the plot.
#References
..after knitting with R:
---
title: "Test of R, Rmarkdown & BibTeX"
csl: bmcart.cls
output: html_document
bibliography: references.bib
---
This is a test of R, Rmarkdown and BibTeX in which I hope to use RStudio to
generate HTML, Word files and pdf files from an Rmarkdown script.
Particularly, I want the script to include text, embedded R code, citations[
@clar_clinical_2014] from a BibTeX catalogue and graphics.
Can it all be done **in a single file**, I wonder?
```r
summary(cars)
```
```
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
```
You can also embed plots, for example:

Note that the `echo = FALSE` parameter was added to the code chunk to
prevent printing of the R code that generated the plot.
#References
--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+***@googlegroups.com.
To post to this group, send email to pandoc-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/c75a5bce-7acc-438f-9d2e-32bf17d118e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+***@googlegroups.com.
To post to this group, send email to pandoc-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/c75a5bce-7acc-438f-9d2e-32bf17d118e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.