将额外的Lua-Filter添加到YAML中
我正在尝试在YAML中添加一个额外的Lua-Filter:
---
title: "TITLE"
subtitle: "SUBTITLE"
date: "07/04/2022"
output:
pdf_document:
pandoc_args:
- --lua-filter=/Users/user/.local/share/pandoc/filters/wordcount.lua
latex_engine: pdflatex
includes:
in_header: style.sty
#keep_tex: true
bookdown::pdf_book:
citation_package: biblatex
bibliography: literature.bib
csl: my.csl
lang: de
fontsize: 12pt
---
好的,现在,当我尝试编织文档时,我会得到这个erorr:
/usr/local/bin/pandoc +RTS -K512m -RTS mother.knit.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output mother.tex --lua-filter /Users/user/Library/R/x86_64/4.1/library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Users/user/Library/R/x86_64/4.1/library/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --highlight-style tango --pdf-engine pdflatex --include-in-header style.sty --variable graphics --lua-filter=/Users/user/.local/share/pandoc/filters/wordcount.lua --variable 'geometry:margin=1in' --citeproc
655 words in body
4171 characters in body
4791 characters in body (including spaces)
Error in readLines(con, warn = FALSE) : cannot open the connection
In addition: Warning message:
In readLines(con, warn = FALSE) :
cannot open file 'mother.tex': No such file or directory
母亲.tex怎么了?为什么没有创建它?
希望有人可以帮忙。已经谢谢。
I'm trying to add an additional lua-filter into the YAML:
---
title: "TITLE"
subtitle: "SUBTITLE"
date: "07/04/2022"
output:
pdf_document:
pandoc_args:
- --lua-filter=/Users/user/.local/share/pandoc/filters/wordcount.lua
latex_engine: pdflatex
includes:
in_header: style.sty
#keep_tex: true
bookdown::pdf_book:
citation_package: biblatex
bibliography: literature.bib
csl: my.csl
lang: de
fontsize: 12pt
---
ok, now when I try to knit the document I'm getting this erorr:
/usr/local/bin/pandoc +RTS -K512m -RTS mother.knit.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output mother.tex --lua-filter /Users/user/Library/R/x86_64/4.1/library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Users/user/Library/R/x86_64/4.1/library/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --highlight-style tango --pdf-engine pdflatex --include-in-header style.sty --variable graphics --lua-filter=/Users/user/.local/share/pandoc/filters/wordcount.lua --variable 'geometry:margin=1in' --citeproc
655 words in body
4171 characters in body
4791 characters in body (including spaces)
Error in readLines(con, warn = FALSE) : cannot open the connection
In addition: Warning message:
In readLines(con, warn = FALSE) :
cannot open file 'mother.tex': No such file or directory
What is wrong with the mother.tex? Why it's not been created?
Hope someone can help. Thanks already.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,我有点努力为
WordCout:Process
参数找到正确的位置。但是,对于那些试图实现解决方法的人的解决方案可能是以下内容:
从 https://github.com/pandoc/lua-filters/blob/04e2d663d663dcb374d2c79ad1a42a42a30714843cb4843cb440/wordcount/wordcount/wordcount/wordcount/wordcount/wordcount/wordcount.lua--
“ 43-45
Ok, I struggled a little bit to find the right position for the
wordcout: process
argument.But a solution for those one who try to achive a workaround could be the following:
edit the following file from https://github.com/pandoc/lua-filters/blob/04e2d663dcb374d2c79ad1a42a30714843cb4e40/wordcount/wordcount.lua
notice the comment-out lines in line 39-42 and 43-45
问题在于过滤器停止转换过程,因此未创建输出。
我假设您正在使用
WordCount
来自 https:// github。 com/pandoc/lua-filters 。该过滤器将中止文档转换,除非 元数据字段wordCount
设置为字符串Process
或convert
。因此,您可以添加
-Metadata = WordCount = Process
pandoc_args
设置:或修改过滤器以始终处理文档,无论是否设置了元数据。
The problem is that the filter stops the conversion process, so no output is created.
I'm assuming you are using the
wordcount
filter from https://github.com/pandoc/lua-filters. That filter will abort the document conversion unless the metadata fieldwordcount
is set to the stringprocess
orconvert
.So you can add
--metadata=wordcount=process
this topandoc_args
setting:or modify the filter to always process the document regardless of whether the metadata field is set or not.