I am writing a new version of my Java book with bookdown. The book format is pdf.
I would like to customize the code highlight, specially the multi-line comments. I want only one color and the same style for all characters in these type of comments.
Here is what I have now (with unwanted style in multi-line comments):
I tried with pandoc_args: "--highlight-style=my.theme" in _output.yml:
bookdown::pdf_book:
includes:
in_header: preamble.tex
latex_engine: xelatex
citation_package: natbib
keep_tex: yes
pandoc_args: "--highlight-style=my.theme"
bookdown::epub_book: default
But the following error ocurs:
Could not read highlighting theme my.theme
Error: pandoc document conversion failed with error 6
I generated my.theme this way:
pandoc --print-highlight-style pygments > my.theme
The file my.theme is not the problem because it is working with standalone pandoc this way:
pandoc -f markdown libro_generado/libro_completo.md -o libro_generado/aprendejava.pdf --pdf-engine xelatex --highlight-style my.theme --include-in-header configuracion/titlesec.tex
I would like to use bookdown instead of standalone pandoc because I can have all the chapters, configuration and everything more organized.
I have been dealing with this problem for more than a week. I will be very grateful if I get some help.
Related
I have installed Zim on my MacBook. I already have Latex installed. When I try to add the "Insert Equation" plugin, the following errors are shown:
Dependencies
latex - Failed
dvipng - Failed
It is worth mentioning that when I type "latex" or "dvipng" in the terminal, I see that the corresponsing program is called. So, the installation of Latex seems fine.
How to solve this issue?
I'm trying to knitr a Rmd file on Rserver via command line by running
Rscript -e "rmarkdown::render('testrmd.Rmd')"
But it ran into an error saying
"Error: pandoc version 1.12.3 or higher is required and was not found (see the help page ?rmarkdown::pandoc_available).
Execution halted"
However, I checked and found out that I actually have pandoc version 2.3.1, way higher than the required 1.12.3.
I'm writing a scientific paper (pdf) with R Markdown. The problem is that a want to apply double spacing with header-includes:
\usepackage{setspace}\doublespacing but it does not work.
Then there comes this error message:
tlmgr search --file --global "/setspace.sty"
tlmgr.pl: Remote repository is newer than local (2018 < 2019)
Cross release updates are only supported with
update-tlmgr-latest(.sh/.exe) --update
Please see https://tug.org/texlive/upgrade.html for details.
! LaTeX Error: File `setspace.sty' not found.
! Emergency stop.
<read *>
How can I solve this problem?
I recently uploaded a new version of an R package in which the R markdown vignettes work well enough on my Ubuntu system with pandoc 2.2.
Today I was notified by R CRAN checking of the following
This version fails on both Fedora Linux and macOS with pandoc 2.5
--- re-building ‘Rmarkdown.Rmd’ using rmarkdown
pandoc: Cannot decode byte '\xa9':
Data.Text.Internal.Encoding.streamDecodeUtf8With: Invalid UTF-8 stream
Error: processing vignette 'Rmarkdown.Rmd' failed with diagnostics:
pandoc document conversion failed with error 1
--- failed re-building ‘Rmarkdown.Rmd’
--- re-building ‘code_chunks.Rmd’ using rmarkdown
convert: profile 'icc': 'RGB ': RGB color space not permitted on
grayscale PNG `tmpout/p-chunk65-1.png' #
warning/png.c/MagickPNGWarningHandler/1672.
pandoc: Cannot decode byte '\xa9':
Data.Text.Internal.Encoding.streamDecodeUtf8With: Invalid UTF-8 stream
Error: processing vignette 'code_chunks.Rmd' failed with diagnostics:
pandoc document conversion failed with error 1
--- failed re-building ‘code_chunks.Rmd’
\xa9 is a Latin-1 copyright sign. The PNG error is seen only on macOS.
Unfortunately knitr/pandoc produce no debugging information, so this is
all I know.
It appears to me that the error about \xa9 is a wild goose chase.
The Pandoc instructions have changed. Replacing this old stanza
header-includes:
- \usepackage{xcolor}
- \usepackage{fancybox}
- \usepackage{calc}
- \usepackage{subfig}
With this new one solved the problem.
header-includes:
- |
```{=latex}
\usepackage{xcolor}
\usepackage{fancybox}
\usepackage{calc}
\usepackage{subfig}
```
After that, I do get a success with Pandoc 2.6.
At first I thought that I understood the problem, but then it happened again and I re-typed the new stanza entirely and Pandoc does not give the error anymore. So I am nonplussed.
I have not yet found an answer for the PNG problem on Macintosh.
I am trying to create a RMarkdown document with RStudio using shiny server. It works fine if the ouptut is pdf but if I want it as html I get this following error at the end of the process (in the RMarkdown console I can see it reached 100%).
Error: unrecognized fields specified in html_dependency: attachment
I have no idea why this error is happening.
Can anyone help me with this?
Thank you
I had a similar problem and found that it was caused by RStudio attempting to use Knitr to build a Shiny page. You can fix this by running using rmarkdown::run() instead of rmarkdown::render(). In some older versions of RStudio, the "Knit html" button runs this:
rmarkdown::render('filename.Rmd', 'html_document')
whereas, you can get the the results you want by running this command instead:
rmarkdown::run('filename.Rmd')
You could use this command or just update to the latest version of RStudio.
There is more info about authoring Shiny document here: http://rmarkdown.rstudio.com/authoring_shiny.html.
This is caused by a recent update of the relevant rmarkdown package or related ones.
Update RStudio to the latest version and then the error should disappear. It worked in my case.
Updating RStudio didn't work for me. What did work was updating all R packages (Tools > Check for Package Updates...).