Pandoc Markdown 到 Latex PDF:table 将行合并为一行?
Pandoc Markdown to Latex PDF: table merges rows in single row?
为 test.md
Markdown 文件考虑此示例:
---
title: "Testing"
author: Bob Alice
date: July 07, 2010
geometry: margin=2cm
documentclass: extarticle
fontsize: 12pt
output: pdf_document
---
Here is a test of a table:
+----------+-------------------+-----------------+
| Box name | Another parameter | The IP address |
+==========+===================+=================+
| Test 1 | random-string-01 | 10.0.0.20 |
| Test 2 | random-string-02 | 10.0.0.30 |
+----------+-------------------+-----------------+
如果我通过 pandoc 转换它:
$ pandoc --version
pandoc.exe 2.10 ...
...与:
pandoc test.md --pdf-engine=xelatex -o test.pdf
...结果是:
也就是说,“测试 1”和“测试 2”被压缩成一行 - 即使文档明确说明 grid_tables
:
https://pandoc.org/MANUAL.html#tables
Pandoc does not support grid tables with row spans or column spans. This means that neither variable numbers of columns across rows nor variable numbers of rows across columns are supported by Pandoc. All grid tables must have the same number of columns in each row, and the same number of rows in each column.
所以,我真的不明白它是如何将这些行合并为一个的。
是否可以让 pandoc -> latex -> pdf 将“测试 1”和“测试 2”保留在各自的单元格中?是否可以去掉 table 底部的空白垂直 space?
Grid tables 使用明确的垂直线来分隔行。其他单元格中有换行符是偶然的,因为内容不适合一行。
改用这个:
+----------+-------------------+-----------------+
| Box name | Another parameter | The IP address |
+==========+===================+=================+
| Test 1 | random-string-01 | 10.0.0.20 |
+----------+-------------------+-----------------+
| Test 2 | random-string-02 | 10.0.0.30 |
+----------+-------------------+-----------------+
为 test.md
Markdown 文件考虑此示例:
---
title: "Testing"
author: Bob Alice
date: July 07, 2010
geometry: margin=2cm
documentclass: extarticle
fontsize: 12pt
output: pdf_document
---
Here is a test of a table:
+----------+-------------------+-----------------+
| Box name | Another parameter | The IP address |
+==========+===================+=================+
| Test 1 | random-string-01 | 10.0.0.20 |
| Test 2 | random-string-02 | 10.0.0.30 |
+----------+-------------------+-----------------+
如果我通过 pandoc 转换它:
$ pandoc --version
pandoc.exe 2.10 ...
...与:
pandoc test.md --pdf-engine=xelatex -o test.pdf
...结果是:
也就是说,“测试 1”和“测试 2”被压缩成一行 - 即使文档明确说明 grid_tables
:
https://pandoc.org/MANUAL.html#tables
Pandoc does not support grid tables with row spans or column spans. This means that neither variable numbers of columns across rows nor variable numbers of rows across columns are supported by Pandoc. All grid tables must have the same number of columns in each row, and the same number of rows in each column.
所以,我真的不明白它是如何将这些行合并为一个的。
是否可以让 pandoc -> latex -> pdf 将“测试 1”和“测试 2”保留在各自的单元格中?是否可以去掉 table 底部的空白垂直 space?
Grid tables 使用明确的垂直线来分隔行。其他单元格中有换行符是偶然的,因为内容不适合一行。
改用这个:
+----------+-------------------+-----------------+
| Box name | Another parameter | The IP address |
+==========+===================+=================+
| Test 1 | random-string-01 | 10.0.0.20 |
+----------+-------------------+-----------------+
| Test 2 | random-string-02 | 10.0.0.30 |
+----------+-------------------+-----------------+