我想从rmarkdown / RStudio调用一个pandoc过滤器(this one)。但是,pandoc似乎没有识别过滤器。我已经在YAML标题中移交了过滤器。考虑一下这个rmd
文件:
---
title: "test"
output: pdf_document
header-includes:
- \usepackage{xspace}
pandoc_args:
- --filter
- pandoc-filter/typography.py
---
test
s.S.
编织输出没有显示过滤器被移交给pandoc的迹象:
/usr/local/bin/pandoc +RTS -K512m -RTS test_typography-py.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output test_typography-py.pdf --template /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rmarkdown/rmd/latex/default-1.17.0.2.tex --highlight-style tango --pdf-engine pdflatex --variable graphics=yes --variable 'geometry:margin=1in'
(过滤器的效果是在诸如“z.B.”或“eg”之类的短语之间呈现薄空格。)
如何通过rmarkdown(最好使用YAML标头)通过pandoc运行此过滤器?
我刚刚意识到(感谢@NMarkgraf)我有一个缩进错误。 YAML的正确意图是这样的:
---
title: "test"
header-includes:
- \usepackage{xspace}
output:
pdf_document:
pandoc_args:
- --filter
- typography.py
---
然后它工作 - 过滤器被识别。