我使用 pandoc 打印我的读书笔记(以 markdown 编写,保存为{文件名}.md) 进入PDF供我的编辑阅读和评论。我创建了一个YAML包含我所有变量的 frontmatter 文件。
我似乎无法弄清楚的变量是如何设置的PDF输出文件名。我希望它的格式如下:文件名_YYYYMMDD_HHMM.pdf。
这是我的基本 yaml 代码(书评.yaml):
---
documentclass: article
fontfamily: libertine
fontenc: T1
pagestyle: headings
papersize: letter
standalone: true
output:
pdf:
pdf-engine: pdflatex
output: $filename_{date_time}.pdf << what should this be written as?
from: markdown
...
以下是 markdown 示例(注释.md):
---
title: notes
tags: tag1, tag2, tag3
keywords: keyword1, keyword2
---
# Lorem Ipsum
>_"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."_
>"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque imperdiet, urna eget rutrum dignissim, dui sem malesuada lorem, ac consequat enim dui eu mi. In faucibus fringilla tempor. Curabitur molestie nibh eu ipsum rhoncus posuere. Nulla fringilla, velit sit amet egestas aliquam, mauris lacus eleifend massa, vel convallis ipsum quam non lorem. Integer suscipit odio eu nisi porta efficitur. Nam ut scelerisque felis. Ut facilisis posuere massa maximus consequat. In aliquet semper nisl vel faucibus. Cras suscipit mattis turpis, id egestas erat laoreet sit amet.
当我尝试生成PDF使用:pandoc booknotes.yaml notes.md
,我得到的屏幕输出似乎是HTML。
我正在使用 pandoc 版本:3.1.1。
提前致谢。