插入元数据块标题的分页符和Pandoc的TOC

问题描述 投票:0回答:1

我正在使用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 \

输出看起来像这样:

enter image description here显式\pagebreak可以正常工作。但是我想在标题和目录之间以及目录和内容之间进行分页,这不是我所能达到的。

我已经阅读了可以修改的模板。 pandoc -D latex模板非常庞大,我尝试引入分页符,但没有成功。

latex markdown r-markdown pandoc
1个回答
0
投票

如果您手动插入目录,则可以控制周围是否应有分页符:

---
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
© www.soinside.com 2019 - 2024. All rights reserved.