简体   繁体   English

升级到 OSX 10.8.2 后“latex: command not found”

[英]After upgrade to OSX 10.8.2 “latex: command not found”

I've been using the vim-latex suite on my mac (10.7.?) for months with no problem.我一直在我的 mac (10.7.?) 上使用 vim-latex 套件几个月没有问题。 Over the weekend, I upgraded the OS to 10.8.2, and now my tex files fail to compile.周末,我将操作系统升级到 10.8.2,现在我的 tex 文件无法编译。 The compile command编译命令

\ll

produces no errors within vim, but no pdf-file gets produced.在 vim 中不会产生错误,但不会产生 pdf 文件。 If I drop to the command line in a terminal, the following command如果我在终端中进入命令行,则执行以下命令

latex document.tex

produces产生

-bash: latex: command not found

Similarly, for pdflatex.同样,对于 pdflatex。 I'm not sure if this is a path error, or if latex for 10.8.2 needs to be reinstalled.我不确定这是否是路径错误,或者是否需要重新安装 10.8.2 的乳胶。 I'm not sure how to proceed in either case.我不确定在这两种情况下如何进行。

I had the same problem and typing:我遇到了同样的问题并输入:

export PATH=/usr/texbin:$PATH

seems to work fine in a shell.似乎在 shell 中工作正常。 Although it no longer works if I open a new shell, this is a faster solution to re-downloading and re-installing the huge MacTeX program.虽然如果我打开一个新的外壳它不再有效,但这是重新下载和重新安装巨大的 MacTeX 程序的更快解决方案。

This happened to me after upgrading to OS X El Capitan.升级到 OS X El Capitan 后,这发生在我身上。 I found the latex executables in /usr/local/texlive/2014/bin/x86_64-darwin .我在/usr/local/texlive/2014/bin/x86_64-darwin找到了乳胶可执行文件。 So, I just added this to my .bashrc所以,我只是将它添加到我的 .bashrc

export PATH="$PATH:/usr/local/texlive/2014/bin/x86_64-darwin"

No need to reinstall.无需重新安装。

On OS X, the standard way for third party installers to add a directory to the path is to put a file under /etc/paths.d .在 OS X 上,第三方安装程序向路径添加目录的标准方法是将文件放在/etc/paths.d下。 TeXLive does this as part of the installation, but the OS upgrade probably blew it away. TeXLive 将其作为安装的一部分执行,但操作系统升级可能将其搞砸了。

You should be able to just create a new file under that directory containing just one line, the path the directory containing the TeX executables.您应该能够在该目录下创建一个仅包含一行的新文件,路径是包含 TeX 可执行文件的目录。

When setting the path via @petew's answer, /usr/local/texlive/2014/bin/x86_64-darwin may not be the correct version.通过@petew 的回答设置路径时, /usr/local/texlive/2014/bin/x86_64-darwin可能不是正确的版本。 On my system /usr/local/texlive/2021/bin/universal-darwin was what was needed.在我的系统/usr/local/texlive/2021/bin/universal-darwin上是需要的。 Make sure to check your texlive binaries to see what file you downloaded.确保检查您的 texlive 二进制文件以查看您下载的文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM