Pandoc:如何在目录之前添加表?

时间:2018-12-21 10:14:47

标签: markdown pandoc tableofcontents

我想在pandoc / markdown生成的内容表之前添加一个表。

我找到了参数“ include-before”。这样,我可以在目录之前添加文本。但是有办法添加表吗?

在下面显示我的代码。我希望toc在两个表和header1之间,而不是在表之前。

还有另一种方法可以实现吗?我只想使用一个文件。

感谢您的帮助

---
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. 

1 个答案:

答案 0 :(得分:1)

有两个选项:您可以使用include-before字段,它适用于文本以及列表或表格。只要确保缩进表格即可。

---
toc: true
toc-title: Table des matières
include-before: |
    ----------------------------------------------------------------------
    **VERSION**  **DATE**      **MODIFICATION**                **AUTHOR**
    -----------  ------------- ------------------------------- -----------
    1.0          20-12-2018    Initial                         DGO 

    ----------------------------------------------------------------------

或者,您可以禁用pandoc的toc机制,并手动添加LaTeX命令以在所需位置生成目录:

---
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.