问题描述
我想在pandoc/markdown生成的内容表之前添加一个表.
I would like to add a table before the table of content generated by pandoc/markdown.
我找到了参数"include-before".这样,我可以在目录之前添加文本.但是有办法添加表吗?
I've found the parameter "include-before". With this, I can add text before the table of content. But is there a way to add a table ?
在下面显示我的代码.我希望toc在两个表和header1之间,而不是在表之前.
Show my code below. I would like the toc to be between the two tables and the header1 and not before the tables.
还有另一种方法可以实现这一目标吗?我只想使用一个文件.
Is there another way to achieve that ? I would like to use only one file for the generation.
感谢您的帮助
---
geometry: margin=1in
fontfamily: qbookman
numbersections: true
toc: true
toc-title: Table des matières
header-includes: |
\usepackage{graphicx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength\headheight{20pt}
\lhead{\includegraphics[width=4cm]{C:/logo.png}}
\rhead{Doc generator}
---
+---------------+---------------------------------------------------------------+
| **Title** | Markdown - Pandoc - Plantuml \
|
+---------------+---------------------------------------------------------------+
| **Customer** | Customer \
|
+---------------+---------------------------------------------------------------+
| **Project** | Doc generator
|
+---------------+---------------------------------------------------------------+
----------------------------------------------------------------------------------
**VERSION** **DATE** **MODIFICATION** **AUTHOR**
----------- ------------- ------------------------------------------- -----------
1.0 20-12-2018 Initial DGO
----------------------------------------------------------------------------------
# Header 1
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
推荐答案
有两种选择:您可以使用include-before字段,它适用于文本以及列表或表格.只需确保缩进表格即可.
There are two options: you can either use the include-before field, it works for text as well as for lists or tables. Just make sure to indent the table.
---
toc: true
toc-title: Table des matières
include-before: |
----------------------------------------------------------------------
**VERSION** **DATE** **MODIFICATION** **AUTHOR**
----------- ------------- ------------------------------- -----------
1.0 20-12-2018 Initial DGO
----------------------------------------------------------------------
或者,您可以禁用pandoc的toc机制,并手动添加LaTeX命令以在所需位置生成目录:
Alternatively, you can disable pandoc's toc mechanism and manually add the LaTeX commands to generate the table of contents at the desired location:
---
geometry: margin=1in
fontfamily: qbookman
numbersections: true
toc: false
header-includes: |
\usepackage{graphicx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength\headheight{20pt}
\lhead{\includegraphics[width=4cm]{C:/logo.png}}
\rhead{Doc generator}
---
+---------------+---------------------------------------------------------------+
| **Title** | Markdown - Pandoc - Plantuml \
|
+---------------+---------------------------------------------------------------+
| **Customer** | Customer \
|
+---------------+---------------------------------------------------------------+
| **Project** | Doc generator
|
+---------------+---------------------------------------------------------------+
----------------------------------------------------------------------------------
**VERSION** **DATE** **MODIFICATION** **AUTHOR**
----------- ------------- ------------------------------------------- -----------
1.0 20-12-2018 Initial DGO
----------------------------------------------------------------------------------
\renewcommand*\contentsname{Table des matières}
\tableofcontents
# Header 1
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua.
这篇关于Pandoc:如何在目录之前添加表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!