pandoc - 在 YAML 标头中指定资源路径
问题描述
根据文档,我们可以使用--resource-path=...
来指定资源目录的路径。例如:
---
title: Sample document
author: myself
date: now
#resource-path:
#- figures/
...
# Hi all!
Here is my sample document! And also, there is an wonderful image in
this document.
![The wonderful image.](wimage.pdf)
Done.
该文件wimage.pdf
位于figures/
. 使用以下命令编译,一切正常,找到文件并嵌入到输出 PDF 文件中。
$ pandoc --resource-path=figures test.md -o test.pdf
仍然根据文档,我也可以resource-path:
在 YAML 标头中使用。所以我在上面的例子中取消注释相应的 2 行,并尝试编译
$ pandoc test.md -o test.pdf
[WARNING] Could not fetch resource wimage.pdf: replacing image with description
如警告所示,图像未嵌入到输出 PDF 文件中。
YAML 标头中的是否应该resource-path:
工作?
解决方案
这是对默认文件的误解。这些是包含选项的单独文件,并通过--defaults
/-D
命令行选项传递。放入resource-path
文档的元数据将不起作用。
推荐阅读
- csv - Weka J48 卡在基于训练数据的构建模型上
- git - 使用 TFS 2015 (esp. master) 保护 git 分支不被贡献者删除
- python - 先前定义的函数名,但无法调用
- javascript - 具有不同捆绑包的 Webpack 多个入口点
- iis - IIS 默认将站点日志保留多长时间?
- postgresql - 使用带有 SSL 的 Cloud Shell 连接到 Google Cloud SQL PostgreSQL?
- php - PHP:用逗号(,)分割字符串但忽略方括号内的任何内容?
- python - 基于另一列迭代地为 Pandas 列赋值
- scala - Scala Spark udf java.lang.UnsupportedOperationException
- git - 如何通过 API 从 SonarQube 项目中检索分支信息?