Pandoc Markdown转换为Latex PDF:表格将行合并成一行吗? [英] Pandoc Markdown to Latex PDF: table merges rows in single row?

查看:49
本文介绍了Pandoc Markdown转换为Latex PDF:表格将行合并成一行吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Pandoc不支持具有行跨度或列跨度的网格表.这意味着Pandoc不支持行间可变列数或行间可变行数.所有网格表的每一行必须具有相同数量的列,并且每一列必须具有相同数量的行.

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.

所以,我真的看不到它如何将这些行合并为一个.

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:表格将行合并成一行吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆