在 Pandoc 中,如何在不修改模板的情况下通过 YAML metablock 在作者之间添加换行符?
In Pandoc, how do I add a newline between authors through the YAML metablock without modifying the template?
我正在尝试将几个作者添加到我正在撰写的报告中。最好是,第二位作者出现在第一位作者之后的新行中。我知道我可以修改模板以添加新字段或 Pandoc 自述文件中给出的多作者示例。但是,我想知道是否有任何字符可用于直接在元区块中的作者之间插入换行符。到目前为止,我已经尝试使用换行符 \newline
、\
、|
和 space、<br>
、<div></div>
,并让作者列出一个字符串在作者姓名之间使用换行符或双 spaces,但没有任何效果。我想要的输出是 pdf。
问题不在于 YAML 元数据格式(有很多 ways to have multiline strings),而是 LaTeX \author
命令去除了换行符。但是对于 PDF 输出(使用 LaTeX)你可以这样做:
---
title: mytitle
author: '\protect\parbox{\textwidth}{\protect\centering Author: 1\ Author: 2\ Author 3}'
---
body text
您可以使用一个简单的列表来实现这一点。
---
title: 'Any title comes here'
author:
- Author One
- Author Two
---
另一种方法是依赖语法略有不同的标题栏。
% Any title comes here
% author(s) (separated by semicolons)
% date
在 pandoc 手册的 metadata-block section 中查找其他变体。
我正在尝试将几个作者添加到我正在撰写的报告中。最好是,第二位作者出现在第一位作者之后的新行中。我知道我可以修改模板以添加新字段或 Pandoc 自述文件中给出的多作者示例。但是,我想知道是否有任何字符可用于直接在元区块中的作者之间插入换行符。到目前为止,我已经尝试使用换行符 \newline
、\
、|
和 space、<br>
、<div></div>
,并让作者列出一个字符串在作者姓名之间使用换行符或双 spaces,但没有任何效果。我想要的输出是 pdf。
问题不在于 YAML 元数据格式(有很多 ways to have multiline strings),而是 LaTeX \author
命令去除了换行符。但是对于 PDF 输出(使用 LaTeX)你可以这样做:
---
title: mytitle
author: '\protect\parbox{\textwidth}{\protect\centering Author: 1\ Author: 2\ Author 3}'
---
body text
您可以使用一个简单的列表来实现这一点。
---
title: 'Any title comes here'
author:
- Author One
- Author Two
---
另一种方法是依赖语法略有不同的标题栏。
% Any title comes here
% author(s) (separated by semicolons)
% date
在 pandoc 手册的 metadata-block section 中查找其他变体。