相关疑难解决方法(0)

Pandoc:将文档标题设置为第一个标题

我正在 github 上创建一个库,所以我为此使用了一个 Markdown 文件,其结构如下:

# My main title
## My first section
...
## My second section
...
Run Code Online (Sandbox Code Playgroud)

但不幸的是,当我使用 pandoc 将此文档转换为 Latex 时:

pandoc README.md --number-sections -f markdown -t latex -s -o doc.tex
Run Code Online (Sandbox Code Playgroud)

文档没有任何标题,编号从主标题开始:

1. My main title
1.1. My first section
...
1.2. My second section
...
Run Code Online (Sandbox Code Playgroud)

虽然我想要类似的东西

My main title <=== document title
1. My first section
...
2. My second section
...
Run Code Online (Sandbox Code Playgroud)

我当然可以使用 sed 将所有 ## 更改为 #,并将主标题替换为,% Document My main title但对我来说它看起来很脏。什么是继续的好方法?

谢谢!

markdown latex github pandoc

3
推荐指数
2
解决办法
1955
查看次数

标签 统计

github ×1

latex ×1

markdown ×1

pandoc ×1