Pdf pandoc:未定义的控制序列\colorbox 问题
我有一个包含降价和乳胶组合的文件,我想将其转换为PDF。Pandoc似乎在Ubuntu20.04中工作,但在Debian10中不工作 我的装置 我的降价 我在一个名为test.md的文件中有以下文本:Pdf pandoc:未定义的控制序列\colorbox 问题,pdf,debian,latex,markdown,pandoc,Pdf,Debian,Latex,Markdown,Pandoc,我有一个包含降价和乳胶组合的文件,我想将其转换为PDF。Pandoc似乎在Ubuntu20.04中工作,但在Debian10中不工作 我的装置 我的降价 我在一个名为test.md的文件中有以下文本: \centerline{\Large{\textbf{Test 1}}} \colorbox{blue!25}{\Large{\textbf{Test 2}}} **This is a test** 兑换 在Ubuntu 20.04中,我生成了一个漂亮的PDF。 在Debian 10(Doc
\centerline{\Large{\textbf{Test 1}}}
\colorbox{blue!25}{\Large{\textbf{Test 2}}}
**This is a test**
兑换
在Ubuntu 20.04中,我生成了一个漂亮的PDF。在Debian 10(Docker)中,我得到以下错误:
! Undefined control sequence.
l.62 \colorbox
Debian 10中是否缺少一些依赖项?有没有办法查看默认情况下使用的Pandoc引擎?我做错了什么
当运行详细模式时,安装似乎使用不同的引擎,但是,当我指定几何体驱动程序使它们相同时,问题仍然存在
# Debian 10
*geometry* driver: auto-detecting
*geometry* detected driver: xetex
# Ubuntu 20.04
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
更新:解决方法
在阅读了几篇关于类似问题的文章后,我首先尝试将\usepackage{xcolor}添加到文档的开头,但没有成功。然后我发现你必须添加一个YAML头,然后它就可以工作了。然而,最初的问题仍然困扰着我
# Adding this to the start of the document fixed the problem
---
header-includes:
- \usepackage{xcolor}
output:
pdf_document
---
Debian10(buster)和Pandoc2.2.1,而Ubuntu 20.04(focal)和Pandoc2.5。似乎您遇到了一个在更高版本中修复的错误
然而,这很奇怪。变更日志提到了这样一个bug,它比您的任何一个版本都要新。所以说实话,我对你触发的bug的确切性质有点困惑
# Debian 10
*geometry* driver: auto-detecting
*geometry* detected driver: xetex
# Ubuntu 20.04
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
# Adding this to the start of the document fixed the problem
---
header-includes:
- \usepackage{xcolor}
output:
pdf_document
---