我问了一个相关的问题:检查是否安装了程序
但是在我在所有三个系统上为自己测试解决方案之前,我会避免回答。我可以让 pandoc 在 Windows 机器上的 R 中工作,但在 linux 上,我从 R 终端得到每个方法的这个错误/响应:
1:
> system('pandoc -v')
sh: 1: pandoc: not found
2:
> myPaths <- c("pandoc",
+ "~/.cabal/bin/pandoc",
+ "~/Library/Haskell/bin/pandoc",
+ "C:\\PROGRA~1\\Pandoc\\bin\\pandoc")
> Sys.which(myPaths)
pandoc ~/.cabal/bin/pandoc
"" "/home/tyler/.cabal/bin/pandoc"
~/Library/Haskell/bin/pandoc C:\\PROGRA~1\\Pandoc\\bin\\pandoc
"" ""
3:
> Sys.which("pandoc")
pandoc
""
你可能认为我没有安装 pandoc 并且在路径上,但我相信我有。从干净的终端会话:
> tyler@trinker ~ $ echo $PATH
> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/tyler/.cabal/bin
和
tyler@trinker ~ $ pandoc -v
pandoc 1.10.1
Compiled with citeproc-hs 0.3.7, texmath 0.6.1.3, highlighting-kate 0.5.3.6.
Syntax highlighting is supported for the following languages:
Actionscript, Ada, Alert, Alert_indent, Apache, Asn1, Asp, Awk, Bash,
Bibtex, Boo, C, Changelog, Clojure, Cmake, Coffee, Coldfusion, Commonlisp,
Cpp, Cs, Css, Curry, D, Diff, Djangotemplate, Doxygen, Doxygenlua, Dtd,
Eiffel, Email, Erlang, Fortran, Fsharp, Gnuassembler, Go, Haskell, Haxe,
Html, Ini, Java, Javadoc, Javascript, Json, Jsp, Julia, Latex, Lex,
LiterateCurry, LiterateHaskell, Lua, Makefile, Mandoc, Matlab, Maxima,
Metafont, Mips, Modula2, Modula3, Monobasic, Nasm, Noweb, Objectivec,
Objectivecpp, Ocaml, Octave, Pascal, Perl, Php, Pike, Postscript, Prolog,
Python, R, Relaxngcompact, Rhtml, Ruby, Scala, Scheme, Sci, Sed, Sgml, Sql,
SqlMysql, SqlPostgresql, Tcl, Texinfo, Verilog, Vhdl, Xml, Xorg, Xslt, Xul,
Yacc, Yaml
Copyright (C) 2006-2013 John MacFarlane
Web: http://johnmacfarlane.net/pandoc
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
如何让 Linux Mint 上的 R 识别 pandoc?(我是 Linux 新手)