繁体   English   中英

tikzDevice无法在emacs上运行

[英]tikzDevice not working on emacs

我在Linux终端中使用R运行了以下代码,并且工作正常

td <- tempdir()
tf <- file.path(td, "examplelast.tex" )
oldwd <- getwd()
setwd(td)
library(tikzDevice)
# Minimal plot
tikz(tf,standAlone = T)
plot(1,main="\\TeX")
dev.off()
# View the output
tools::texi2dvi(tf,pdf=T)
system(paste(getOption("pdfviewer"),file.path("examplelast.pdf")))
setwd(oldwd)

但是在emacs上运行会给我以下错误:

## (/home/DJJ/.emacs.d/elpa/auctex-11.87.2/latex/preview.sty
## Package: preview 2010-02-14 CVS-1.126 (AUCTeX/preview-latex)
## \pr@markerbox=\box35
## (/home/DJJ/.emacs.d/elpa/auctex-11.87.2/latex/prtightpage.def
## \PreviewBorder=\dimen148
## )
## \pr@snippet=\count107
## \pr@box=\box36
## \pr@output=\toks24
## )
## ! Missing = inserted for \ifnum.
## <to be read again> 

## ...

## !  ==> Fatal error occurred, no output PDF file produced!
## Error in getMetricsFromLatex(TeXMetrics) : 
## TeX was unable to calculate metrics for the following string
## or character:

##         m

我怀疑与Preview.sty有一些冲突,但是我不确定。

这是我的.emacs关于R的一部分:

;(add-to-list 'load-path "~/R/ess-5.13/lisp")
(require 'ess-site)

还有我的sessioninfo()

## R version 3.1.1 (2014-07-10)
## Platform: x86_64-redhat-linux-gnu (64-bit)

## locale:
##  [1] LC_CTYPE=en_US.utf8       LC_NUMERIC=C             
##  [3] LC_TIME=en_US.utf8        LC_COLLATE=en_US.utf8    
##  [5] LC_MONETARY=en_US.utf8    LC_MESSAGES=en_US.utf8   
##  [7] LC_PAPER=en_US.utf8       LC_NAME=C                
##  [9] LC_ADDRESS=C              LC_TELEPHONE=C           
## [11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C      

## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     

## other attached packages:
## [1] tikzDevice_0.7.0 filehash_2.2-2  

## loaded via a namespace (and not attached):
## [1] grid_3.1.1  tools_3.1.1

更新 此处的一种解决方案建议从Auctex附带的软件包中更新preview.sty软件包。 如何做呢?

它给了我一段时光,但我设法理解了这篇文章的含义。 如果您使用的是fedora,则不妨检查一下帖子。

基本上我从fedora存储库安装了Preview.sty

yum install tex-preview

然后我从tex-live切换为Auctex的preview.sty和preview.sty。

kpsewhere preview.sty可能会帮助您从tex-live(一旦安装)中找到preview.sty。 就我而言,它在这里:

 /usr/share/texlive/texmf-dist/tex/latex/preview/.

然后从auctex中找到preview.sty很简单:它是我粘贴在问题中的日志中。 以我为例:

/home/DJJ/.emacs.d/elpa/auctex-11.87.2/latex/preview.sty

暂无
暂无

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

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