在Pandoc中,如何在不修改模板的情况下通过YAML元块在作者之间添加换行符? [英] In Pandoc, how do I add a newline between authors through the YAML metablock without modifying the template?

查看:81
本文介绍了在Pandoc中,如何在不修改模板的情况下通过YAML元块在作者之间添加换行符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将几个作者添加到我正在撰写的报告中.优选地,第二作者将在第一作者之后出现在新行上.我知道我可以修改模板以添加新字段或Pandoc自述文件中给出的多作者示例.但是,我想知道是否可以使用任何字符直接在metablock中的作者之间插入新行.到目前为止,我已经尝试使用\newline\\|换行和空格,<br><div></div>,并让作者列出一个在作者姓名之间使用换行符或双倍空格的字符串,但是没有任何效果.我想要的输出是pdf.

I am trying to add a a couple of authors to a report I am writing. Preferably, the second author would appear on a new line after the first. I know I can modify the template to add a new field or the multiple author example given in the Pandoc readme. However, I wonder if there is any character I can use to insert a new line between authors directly in the metablock. So far I have tried \newline, \\, | with newline and space, <br>, <div></div>, and making the author list a string with newline or double spaces between author names, but nothing has worked. My desired output is pdf.

推荐答案

问题不在于YAML元数据格式(为此,有许多

The problem isn't in the YAML metadata formatting (for which there are numerous ways to have multiline strings), but that the LaTeX \author command strips the newlines. But for PDF output (with LaTeX) you can do:

---
title: mytitle
author: '\protect\parbox{\textwidth}{\protect\centering Author: 1\\ Author: 2\\ Author 3}'
---

body text

这篇关于在Pandoc中,如何在不修改模板的情况下通过YAML元块在作者之间添加换行符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆