问题描述
为 test.md
Markdown文件考虑以下示例:
Consider this example for test.md
Markdown file:
---
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进行了转换:
If I convert this via pandoc:
$ pandoc --version
pandoc.exe 2.10 ...
...和:
pandoc test.md --pdf-engine=xelatex -o test.pdf
...结果是:
就是说,测试1"和测试2"被压缩为一行-即使文档是关于 grid_tables
的明确声明:
That is to say, "Test 1" and "Test 2" were compacted into a single row - even if the documentation is explicit about grid_tables
:
https://pandoc.org/MANUAL.html#tables
所以,我真的看不到它如何将这些行合并为一个.
So, I can't really see how come it managed to merge these rows into one.
是否可以获得pandoc->乳胶->pdf以保留"Test 1"和测试2"在每个自己的细胞中?并有可能摆脱表格底部的空白垂直空间吗?
Is it possible to get pandoc -> latex -> pdf to keep "Test 1" and "Test 2" in each their own cell? And is it possible to get rid of the blank vertical space at the bottom of the table?
推荐答案
网格表使用明确的垂直线分隔行.其他单元格中存在换行符的事实是偶然的,因为内容不适合一行.
Grid tables use explicit vertical lines to separate rows. The fact that there are line breaks in the other cells is incidental, as the contents don't fit into a single line.
改为使用此:
+----------+-------------------+-----------------+
| 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 Markdown转换为Latex PDF:表格将行合并成一行吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!