我正在使用 R 中的 Pandoc 将 Markdown 文档转换为 PDF 文档。我试图将标题居中。
到目前为止,我已经尝试过:
<center># This is my title</center>
和
-># This is my title<-
但都没有奏效。使用 Pandoc 从 Markdown 转换为 PDF 时,是否可以将标题居中?
最佳答案
pandoc
有 its own extended version of markdown .这包括 title block .
如果文件以标题栏开头
% my title
% Me; Someone else
% May 2013
这将被解析为
LaTeX
以及由此产生的 pdf
作为\title{my title}
\author{Me \and Someone Else}
\date{May 2013}
然后`
\maketitle
在文档中调用。
这将创建标准的居中标题。
如果你想改变标题等的格式,你可以使用 titling package .
如果你想改变节标题的格式,你可以使用 titlesec package .
要自动让 pandoc 实现这些,您可以定义 your own template .一个更简单的选择是在标题中包含一个包含您想要的 latex 前导码的文件。然后在调用
pandoc
时使用适当的参数(例如 -H FILE
或 --include-in-header=FILE
)
关于r - 使用 Pandoc 从 Markdown 转换的 PDF 中的中心标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16420706/