我最近上传了一个新版本的R软件包,其中R markdown小插图在我的Ubuntu系统上使用pandoc 2.2运行良好。
今天我通知R CRAN检查以下内容
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.
在我看来,关于\ xa9的错误是一场疯狂的追逐。
Pandoc说明已经改变。取代这个老节
header-includes:
- \usepackage{xcolor}
- \usepackage{fancybox}
- \usepackage{calc}
- \usepackage{subfig}
有了这个新的解决了这个问题。
header-includes:
- |
```{=latex}
\usepackage{xcolor}
\usepackage{fancybox}
\usepackage{calc}
\usepackage{subfig}
```
在那之后,我在Pandoc 2.6上取得了成功。
起初我以为我理解了这个问题,但后来它再次发生了,我完全重新输入了新的节,Pandoc不再给出错误了。所以我不知所措。
我还没有找到Macintosh上的PNG问题的答案。