pandoc markdown在不同文件之间保留部分数字
是否可以在不同文件之间保留节编号?
例如,我有这个文件:
---
title: Title
number_sections: true
output: latex
graphics: yes
header-includes:
- '\usepackage{graphics}'
---
# Section 1
## SUbsection
# Section 2
输出文件(pdf)将具有以下编号:
1 Section 1
1.1 Subsection
2 Section 2
如果我有第二个文件,例如:
---
title: Title
number_sections: true
output: latex
graphics: yes
header-includes:
- '\usepackage{graphics}'
---
# Section 3
输出文件(pdf)将具有以下编号:
1 Section 3
但我希望它是这样的:
3 Section 3
唯一的我现在找到的解决方法是重复以前文件的内容:
---
title: Title
number_sections: true
output: latex
graphics: yes
header-includes:
- '\usepackage{graphics}'
---
# Section 1
## SUbsection
# Section 2
## Another subsection
\newpage
# Section 3
The new content
这给出了一个 pdf 文件,例如:
1 Section 1
1.1 Subsection
2 Section 2
3 Section 3
New content...
我也可以保留小节的编号。
我正在编译:
pandoc file.md -o file.pdf --pdf-engine=xelatex --number-sections --highlight-style tango
感谢任何帮助。
Is it possible to keep section numeration between different files?
For instance, I have this file:
---
title: Title
number_sections: true
output: latex
graphics: yes
header-includes:
- '\usepackage{graphics}'
---
# Section 1
## SUbsection
# Section 2
The output file (pdf) will have the following numeration:
1 Section 1
1.1 Subsection
2 Section 2
If I have a 2nd file like:
---
title: Title
number_sections: true
output: latex
graphics: yes
header-includes:
- '\usepackage{graphics}'
---
# Section 3
The output file (pdf) will have the following numeration:
1 Section 3
But I wanted it to be like:
3 Section 3
The only workaround I found for now is to repeat the content of previous files:
---
title: Title
number_sections: true
output: latex
graphics: yes
header-includes:
- '\usepackage{graphics}'
---
# Section 1
## SUbsection
# Section 2
## Another subsection
\newpage
# Section 3
The new content
Which gives a pdf file like:
1 Section 1
1.1 Subsection
2 Section 2
3 Section 3
New content...
I would also be able to keep numeration of subsections as well.
I'm compiling with:
pandoc file.md -o file.pdf --pdf-engine=xelatex --number-sections --highlight-style tango
Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如@tarleb建议的那样
,
手动完成工作。
As suggested by @tarleb
and
get the job done manually.