将 pandoc 表从 .md 转换为 PDF 时出错

Error converting pandoc tables from .md to PDF

我尝试使用

将 Markdown 文件转换为 PDF

FOR %%i IN (*.md) DO pandoc "%%~fi" -o "%%~dpni.pdf" --template=weber-export.tex --pdf-engine=xelatex

但它不会转换 pandoc 表。相反,出现错误说

Error producing PDF.
! Missing number, treated as zero.
<to be read again>
                   (
l.357 ...columnwidth - 2\tabcolsep) * \real{0.33}}

它不会转换的表格的简单版本是:

 Consumption / yield
---------------------

+--+---+--+
|  |   |  |
|  |   |  |
|  |   |  |
+--+---+--+
|  |   |  |
|  |   |  |
|  |   |  |
+--+---+--+
|  |   |  |
|  |   |  |
|  |   |  |
+--+---+--+

  -------------------------------------------------------------------
  Type                            Sales unit   Number
  ------------------------------- ------------ ----------------------
  Plastic bucket                  30 liters    18 buckets
  -------------------------------------------------------------------

Pandoc User's Guid

中所述

我已经在 Win 10 上安装了 Miktex 2.9 和 pandoc 2.11.2

没有表格,转换效果很好,即使我尝试没有第一行的表格时也是如此

  Type                            Sales unit   Number
  ------------------------------- ------------ ----------------------
  Plastic bucket                  30 liters    18 buckets
  -------------------------------------------------------------------

有效。

有什么建议吗?这是一个错误,还是我做错了什么?

您的自定义模板似乎没有加载所有必需的包。

添加

\usepackage{calc,array}

到您的模板以确保必要的命令可用。