简体   繁体   English

如何在Ubuntu 12.04上将PATH设置为pdfLaTeX

[英]How to set PATH to pdfLaTeX on Ubuntu 12.04

When I attempt to build my package, saber , I get the following error message in the RStudio Compile PDF window. 当我尝试构建我的包, saber ,我在RStudio Compile PDF窗口中收到以下错误消息。

Unabled to find specified LaTeX program 'pdfLaTeX' on the system path

The R-bloggers post describes the problem I'm experiencing. R-bloggers帖子描述了我遇到的问题。 So I run: 所以我跑:

> Sys.which("pdflatex")
pdflatex 
      "" 
> Sys.getenv("PATH")
[1] "/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

That second path seems absolutely wrong. 第二条路似乎是完全错误的。 The problem is, I'm still in my first year working on a linux-based system and have no idea what to change so that pdfLaTeX is in the path. 问题是,我仍然在我的第一年工作在基于Linux的系统上,并且不知道要改变什么,以便pdfLaTeX在路径中。 I admittedly don't spend a lot of time running commands in the terminal, and need some guidance on how to get this fixed so I can build the package without errors. 我承认不会花很多时间在终端上运行命令,并且需要一些如何解决这个问题的指导,这样我就可以毫无错误地构建软件包。 How do I find, then change the PATH so that pdfLaTeX is in the path? 如何查找,然后更改PATH以便pdfLaTeX在路径中?

> version
               _                           
platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          3                           
minor          1.0                         
year           2014                        
month          04                          
day            10                          
svn rev        65387                       
language       R                           
version.string R version 3.1.0 (2014-04-10)
nickname       Spring Dance          

You need to install texlive. 你需要安装texlive。 Use this at the command line: 在命令行中使用此命令:

sudo apt-get install texlive
# or if you want all the packages (big install)
sudo apt-get install texlive-full

It will be installed into a location that is already on your path too so you won't need to fiddle with the PATH to get it to work once it's installed. 它将被安装到已经在您的路径上的位置,因此您不需要使用PATH来使其在安装后工作。

Get to a terminal and type: 到达终端并键入:

which pdflatex

You'll probably get something like: 你可能会得到类似的东西:

/usr/bin/pdflatex

Check if that folder appears in the output of the PATH variable. 检查该文件夹是否出现在PATH变量的输出中。

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

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