我正在使用Pandoc努力在导出的pdf
文件中获得换行符。
我有以下markdown
:
---
title: "Linux assignment"
subtitle: "Very hard"
author: Max
geometry: margin=2cm
output: pdf_document
---
# Introduction
Hello
This is some `code`
\pagebreak
# Technical sections
\pagebreak
我使用此命令将输入导出到pdf
:
pandoc task.md -f markdown \
--toc \
--metadata date="`date +%D`" \
-s -o test1.pdf \
输出看起来像这样:
显式\pagebreak
可以正常工作。但是我想在标题和目录之间以及目录和内容之间进行分页,这不是我所能达到的。
我已经阅读了可以修改的模板。 pandoc -D latex
模板非常庞大,我尝试引入分页符,但没有成功。
如果您手动插入目录,则可以控制周围是否应有分页符:
---
title: "Linux assignment"
subtitle: "Very hard"
author: Max
geometry: margin=2cm
output:
pdf_document:
toc: false
---
\pagebreak
\tableofcontents
\pagebreak
# Introduction
Hello
This is some `code`
\pagebreak
# Technical sections
\pagebreak