Gnuplot epslatex 文件输出路径问题

问题描述 投票:0回答:1

我在 Gnuplot 中遇到问题。 当我使用相对路径设置输出文件名以将

.tex
.eps
文件保存在不同的文件夹中时,相对路径也包含在
\includegraphics
文件中的
.tex
命令中。

例如,如果我将输出文件设置为当前目录的上两级:

set terminal epslatex color size 6, 3
# ...
set output "../../filename.tex"
# ...

当文件已经在上面两级时,

\includegraphics
命令会保留该路径,并在该目录的上面额外搜索两级,而不是在当前目录中搜索:

% ...
\put(0,0){\includegraphics{../../filename}}%
% ...

如果能在未来的版本中解决这个问题,允许单独设置输出路径和文件名(出现在

\includegraphics
命令中),那就太好了。

path gnuplot
1个回答
0
投票

解决方法:

不要在文件名中包含完整路径(或相对路径),而是将其临时设置为您的工作目录:

 olddir = system("pwd")
 cd '../..'
 set output "filename.tex"
 plot <whatever>
 cd olddir
© www.soinside.com 2019 - 2024. All rights reserved.