Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
762 views
in Technique[技术] by (71.8m points)

markdown - Error converting pandoc tables from .md to PDF

I try to convert Markdown files to PDF with

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

But it wont convert pandoc-tables. instead there occurs an error saying

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

Simply Version of the tables it wont convert are :

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

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

and

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

like its explained in the Pandoc User's Guid

I have installed Miktex 2.9 and pandoc 2.11.2 on Win 10

Without the tables, the conversion is doing well, even when i try out tables without the first line like

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

it works.

any suggestions? Is it a bug, or what am i doing wrong?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It seems that your custom template does not load all necessary packages.

Add

usepackage{calc,array}

to your template to ensure the necessary commands are available.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...