简体   繁体   English

将md转换为pdf时,pandoc“无法解析yaml标头”

[英]pandoc “cannot parse yaml header” when converting md to pdf

I am trying to convert a markdown document to pdf using pandoc, and it was working fine until it just started to show an error: 我正在尝试使用pandoc将markdown文档转换为pdf,并且它工作正常,直到它刚开始显示错误:

pandoc: Could not parse YAML header: did not find expected alphabetic or numeric character "source" (line 32, column 85
pandoc: YAML header is not an object "source" (line 17, column 1)
pandoc: Could not parse YAML header: did not find expected alphabetic or numeric character "source" (line 8, column 91)

Lines 32 and 8 are blank lines between paragraphs, and all that's on line 17 is "---". 第32行和第8行是段落之间的空白行,第17行的所有行都是“---”。

I don't even know what YAML is, but I don't want to use it, just MD->LaTeX->PDF. 我甚至不知道YAML是什么,但我不想使用它,只是MD-> LaTeX-> PDF。

Searched for these errors but could only find stuff mentioning YAML, not the errors. 搜索了这些错误,但只能找到提及YAML的内容,而不是错误。

Any help would be appreciated. 任何帮助,将不胜感激。

See http://johnmacfarlane.net/pandoc/README.html#yaml-metadata-block 请参阅http://johnmacfarlane.net/pandoc/README.html#yaml-metadata-block

There must be something in your document that looks like a YAML metadata block, but isn't. 您的文档中必须存在看起来像YAML元数据块的内容,但事实并非如此。 Such a block would start with --- on a line by itself and end with --- or ... on a line by itself. 这样的一个块将以---在一条线上开始,以---...在一条线上结束。 The line numbers in the error message refer to lines inside the metadata block, not to lines of the document. 错误消息中的行号是指元数据块内的行,而不是文档的行。

By the way, you can turn off YAML metadata block parsing entirely by putting 顺便说一句,您可以通过put完全关闭YAML元数据块解析

--from markdown-yaml_metadata_block

in your pandoc command line. 在你的pandoc命令行中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM