将Pandoc与Markdown一起使用时出现紧缩列表错误 [英] tightlist error using Pandoc with Markdown

查看:212
本文介绍了将Pandoc与Markdown一起使用时出现紧缩列表错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Mac OS 10.12上使用pandoc v.18,通过一个简单的命令行将此markdown文件转换为pdf:

I am using pandoc v. 1.18 on Mac OS 10.12 to transform this markdown file to a pdf, using a simple command line:

# A list that does not work
- one
- two
- three

我收到此错误:

! Undefined control sequence.
l.53 \tightlist

pandoc: Error producing PDF

如何解决?

推荐答案

\tightlist在pandoc 1.14中引入(请参见此提交).导致此错误的最可能原因是您使用的是以前版本的模板,而没有使用更新它.可以通过在乳胶模板中添加几行来解决此问题.对于常规乳胶,可以在$DATA-DIR/templates/default.latex中找到,对于投影机,可以在$DATA-DIR/templates/default.beamer中找到它们.您需要添加这两行(在\begin{document}之前):

\tightlist was introduced with pandoc 1.14 (see this commit). The most probable cause for this error is that you are using a template from a previous version and did not update it. This can be fixed by adding a couple of lines to your latex template. They can be found at $DATA-DIR/templates/default.latex for regular latex and $DATA-DIR/templates/default.beamer for beamer. You'll need to add those two lines (before the \begin{document}):

\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}

为确保以后的模板版本不再发生这种情况,最好分叉

To make sure this does not happen again with future evolution of the templates, it might be a good idea to fork the pandoc-templates repository.

这篇关于将Pandoc与Markdown一起使用时出现紧缩列表错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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