macos - pandoc via launchd——获取错误 : "pdflatex not found. pdflatex 是 pdf 输出所必需的

标签 macos launchd pdflatex pandoc

我正在尝试每 90 秒从 Markdown 文档生成一个 pdf 文档。我已经在 launchd 中设置了一个任务来为我处理这个问题。不幸的是,我收到一条错误消息,提示无法找到 pdflatex,即使我可以从命令行调用它。这是 ddd_publisher.sh 的全部内容,它是 launchd 每 90 秒运行一次的文件:

/usr/local/bin/pandoc -o /Users/Jon/dev/intercontinental/ddd.pdf /Users/Jon/dev/intercontinental/ddd.ddd

程序每 90 秒运行一次,但它会将以下行写入标准错误:

pandoc: pdflatex not found. pdflatex is needed for pdf output.

如果我在命令行输入 pdflatex -v 它会告诉我它已安装:

pdfTeX 3.1415926-2.4-1.40.13 (TeX Live 2012)

这是我启动的 plist 文件:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>ddd.intercontinental.publisher</string>
<key>ProgramArguments</key>
<array>
    <string>/Users/Jon/dev/intercontinental/ddd_publisher.sh</string>
</array>
<key>StandardErrorPath</key>
<string>/Users/Jon/dev/intercontinental/ddd.stderr</string>
<key>StandardOutPath</key>
<string>/Users/Jon/dev/intercontinental/ddd.stdout</string>
<key>StartInterval</key>
<integer>90</integer>

最佳答案

解决办法是在bash脚本中加入pdflatex的路径,如下:

#!/bin/bash
PATH=$PATH:/usr/texbin
/usr/local/bin/pandoc -o /Users/Jon/dev/intercontinental/ddd.pdf /Users/Jon/dev/intercontinental/ddd.ddd

关于macos - pandoc via launchd——获取错误 : "pdflatex not found. pdflatex 是 pdf 输出所必需的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16026793/

相关文章:

latex - 无法启动命令 pdflatex -synctex=1 -interaction=nonstopmode %.tex 错误

macos - 使用 Cocoa 绑定(bind)的类似 iTunes 的计数按钮

objective-c - 10.6 (Snow Leopard) 之后以编程方式设置 Mac OS X 音量

objective-c - 尝试实现OpenGL画笔

ruby - 无法从 OSX 中的 Launch Agent 运行终端通知程序(Ruby 应用程序)。环境变量问题?

r - "Compile PDF"和 knit2pdf 的区别

c++ - OSX 运行时动态库路径搜索

osx-yosemite - launchctl - 删除启用/禁用覆盖

macos - OSX : How to check the return value of launchctl command

error-handling - 包 pdftex.def 错误 : File; What can I do so that LATEX can display the image?