对于我的生活,我无法弄清楚如何安装 pandoc。我尝试了其 Github 存储库上推荐的方法以及pandoc 站点上推荐的所有3 种方法。我在 Ubuntu 12.04 上安装,所以我首先做了sudo apt-get install haskell-platform
.
以下是每一步发生错误的地方:
1) 按照 Github 存储库上的建议进行安装:
# cabal install --enable-tests
Registering zlib-conduit-1.0.0...
cabal: Error: some packages failed to install:
http-conduit-1.9.4.5 depends on mime-types-0.1.0.3 which failed to install.
mime-types-0.1.0.3 failed during the building phase. The exception was:
ExitFailure 9
pandoc-1.12 depends on mime-types-0.1.0.3 which failed to install.
Run Code Online (Sandbox Code Playgroud)
2) Pandoc 站点上的主要安装方法:
# cabal install pandoc
[35 of 45] Compiling Text.Pandoc.Parsing ( src/Text/Pandoc/Parsing.hs, dist/build/Text/Pandoc/Parsing.o …
Run Code Online (Sandbox Code Playgroud) 我想使用 Pandoc 将我的 test.epub 转换为 PDF 格式。我试过(这里给出)
pandoc -f epub -t test.epub -o outfile.pdf
Run Code Online (Sandbox Code Playgroud)
这会引发以下错误:
无法从 pdf 生成 pdf 输出
我也尝试了以下命令
pandoc test.epub -f epub -t latex -s -o my.pdf --latex-engine=xelatex
Run Code Online (Sandbox Code Playgroud)
这会引发以下错误:
--latex-engine has been removed. Use --pdf-engine instead.
Try pandoc --help for more information.
Run Code Online (Sandbox Code Playgroud)
然后我试过了
pandoc test.epub -f epub -t latex -s -o my.pdf --pdf-engine=xelatex
Run Code Online (Sandbox Code Playgroud)
它将 EPUB 转换为 PDF 格式,但最终输出不是很好。不尊重分页符和其他东西。页数多于实际。非常有效地将 EPUB 转换为 PDF 格式的任何想法。
我正在使用pandoc
将 LaTeX 文档转换为 Word 格式。源文档包含需要保留在输出中的各种交叉引用。但是,当使用交叉引用过滤器时,pandoc
会抱怨它未安装:
$ pandoc main.tex --filter pandoc-crossref -o main.docx
Error running filter pandoc-crossref:
Could not find executable pandoc-crossref
Run Code Online (Sandbox Code Playgroud)
安装了带有过滤器 Python 绑定的包:
$ dpkg -l | grep pandoc
ii pandoc 2.5-3build2 amd64 general markup converter
ii pandoc-data 2.5-3build2 all general markup converter - data files
ii python3-pandocfilters 1.4.2-2 all python3 bindings for Pandoc's filters
Run Code Online (Sandbox Code Playgroud)
所以我假设过滤器包含在通用pandoc
包中。可能是交叉引用过滤器丢失了。
但没有其他可用的过滤器包:
$ aptitude search pandoc | grep filter
p pandoc-plantuml-filter - Pandoc filter: converts PlantUML code blocks …
Run Code Online (Sandbox Code Playgroud)