我正在使用 eisvogel 模板通过 Pandoc 创建 PDF 文档。它不打印摘要标题。我将其添加到元数据中,但我相信它不与 LaTeX 一起使用。这是最小示例:
---
title: "My Example document"
author:
- Luís
language: en-IE
autoSectionLabels: true
listings: true
abstract-title: "Abstract"
abstract: |
This is an example document to test stuff with Pandoc. In this case the goal
is to understand when or why is the Abstract title portrayed.
...
# Example Section
Once upon a time.
```{#lst01 .c caption="A listing."}
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <generated/utsrelease.h>
#include <linux/mm.h>
```
默认 LaTeX 模板
使用默认模板,输出是预期的。
pandoc --number-sections -o example.pdf example.txt
Eisvogel 模板
应用 eisvogel 模板后,摘要标题消失了。我该如何恢复它?
pandoc --number-sections --template eisvogel -o example.pdf example.txt
答案1
在内部,您的文档使用scrartcl
类。您可以使用类选项打开抽象标题abstract
:
---
title: "My Example document"
author:
- Luís
language: en-IE
autoSectionLabels: true
listings: true
abstract-title: "Abstract"
abstract: |
This is an example document to test stuff with Pandoc. In this case the goal
is to understand when or why is the Abstract title portrayed.
classoption:
- abstract
---
# Example Section
Once upon a time.
```{#lst01 .c caption="A listing."}
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <generated/utsrelease.h>
#include <linux/mm.h>
```