为什么LaTeX生成的EPS图形背景是黑色的?
中的示例http://roth.cs.kuleuven.be/w-ess/index.php/Creating_LaTeX_figures_with_the_use_packages_tikz_and_pgfplots#Export_as_eps用于生成EPS数字。
\documentclass[a4paper]{article}
\usepackage{lipsum}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{
compat=1.3,
tick label style={font=\small},
label style={font=\small},
legend style={font=\footnotesize}
}
\usepgfplotslibrary{external}
\tikzexternalize[prefix=fig/]
\tikzset{external/system call={latex \tikzexternalcheckshellescape -halt-on-error
-interaction=batchmode -jobname "\image" "\texsource";
dvips -o "\image".ps "\image".dvi;
ps2eps "\image.ps"}}
\title{\LaTeX\ plots with \texttt{tikz} and \texttt{pgfplots}}
\author{Roel Van Beeumen}
\date{April 17, 2012}
\begin{document}
\maketitle
% == A first plot ======================================== %
\section{A first plot}
\lipsum[1]
\begin{figure}[h]
\centering
% -------------------------------------------------------- %
\tikzsetnextfilename{first-plot}
\begin{tikzpicture}
\begin{axis}
[xlabel=$x$,ylabel=$\sqrt{|x|}$,
axis x line=bottom,axis y line=left,
ymax=2.1,xmax=4.4]
\addplot[blue,mark=none,domain=-4:4,samples=201]
{sqrt(abs(x))};
\end{axis}
\end{tikzpicture}
% -------------------------------------------------------- %
\end{figure}
\lipsum[2]
% == A second plot ======================================= %
\section{A second plot}
\lipsum[3]
\begin{figure}[h]
\centering
% -------------------------------------------------------- %
\tikzsetnextfilename{second-plot}
\begin{tikzpicture}
\begin{loglogaxis}
[xlabel=Dof,ylabel=Error,
width=\textwidth]
\addplot file{datafile1a.dat};
\addplot file{datafile1b.dat};
\legend{Case 1,Case 2}
\end{loglogaxis}
\end{tikzpicture}
% -------------------------------------------------------- %
\end{figure}
\lipsum[4-5]
% == A third plot ======================================== %
\section{A third plot}
\lipsum[6]
\begin{figure}[hbtp]
\centering
% -------------------------------------------------------- %
\tikzsetnextfilename{third-plot}
\begin{tikzpicture}
\begin{loglogaxis}[xlabel=Dof,ylabel=Error,width=\textwidth]
\addplot table[x=dof1,y=error1] {datafile2.dat};
\addplot table[x=dof2,y=error2] {datafile2.dat};
\legend{Case 1,Case 2}
\end{loglogaxis}
\end{tikzpicture}
% -------------------------------------------------------- %
\end{figure}
\lipsum[7]
\end{document}
终端命令:latex -shell-escape example.tex
更多信息 (1) 黑色背景 查看图片https://www.dropbox.com/sh/gyxm8gzd2p5jfdu/AABqrV27uLmoxut0Qu98mCQca?dl=0. (2)使用Texmaker 4.5版本。(3) 文件列表
article.cls 2007/10/19 v1.4h Standard LaTeX document class
size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
lipsum.sty 2011/04/14 v1.2 150 paragraphs of Lorem Ipsum dummy text
tikz.sty 2010/10/13 v2.10 (rcs-revision 1.76)
pgf.sty 2008/01/15 v2.10 (rcs-revision 1.12)
pgfrcs.sty 2010/10/25 v2.10 (rcs-revision 1.24)
everyshi.sty 2001/05/15 v3.00 EveryShipout Package (MS)
pgfrcs.code.tex
pgfcore.sty 2010/04/11 v2.10 (rcs-revision 1.7)
graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
graphics.sty 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live
dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
pgfsys.sty 2010/06/30 v2.10 (rcs-revision 1.37)
pgfsys.code.tex
pgfsyssoftpath.code.tex 2008/07/18 (rcs-revision 1.7)
pgfsysprotocol.code.tex 2006/10/16 (rcs-revision 1.4)
xcolor.sty 2007/01/21 v2.11 LaTeX color extensions (UK)
color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
pgfcore.code.tex
pgfcomp-version-0-65.sty 2007/07/03 v2.10 (rcs-revision 1.7)
pgfcomp-version-1-18.sty 2007/07/23 v2.10 (rcs-revision 1.1)
pgffor.sty 2010/03/23 v2.10 (rcs-revision 1.18)
pgfkeys.sty
pgfkeys.code.tex
pgffor.code.tex
tikz.code.tex
pgfplots.sty 2013/10/03 v1.9 Data Visualization (1.9)
fig/first-plot.eps
fig/second-plot.eps
fig/third-plot.eps
***********
文件列表
article.cls 2014/09/29 v1.4h 标准 LaTeX 文档类 size10.clo 2014/09/29 v1.4h 标准 LaTeX 文件(大小选项) lipsum.sty 2014/07/27 v1.3 150 段 Lorem Ipsum 虚拟文本 tikz.sty 2015/08/07 v3.0.1a (rcs-revision 1.151) pgf.sty 2015/08/07 v3.0.1a (rcs-revision 1.15) pgfrcs.sty 2015/08/07 v3.0.1a (rcs-revision 1.31) everyshi.sty 2001/05/15 v3.00 EveryShipout 包 (MS) pgfrcs.code.tex pgfcore.sty 2010/04/11 v3.0.1a (rcs-revision 1.7) graphicx.sty 2014/10/28 v1.0g 增强型 LaTeX 图形 (DPC、SPQR) keyval.sty 2014/10/28 v1.15 键=值解析器 (DPC) graphics.sty 2016/07/10 v1.0t 标准 LaTeX 图形 (DPC、SPQR) trig.sty 2016/01/03 v1.10 sin cos tan (DPC) graphics.cfg 2016/06/04 v1.11 示例图形配置 dvips.def 2016/07/10 v3.1a 驱动程序相关文件 (DPC、SPQR) pgfsys.sty 2014/07/09 v3.0.1a (rcs-revision 1.48) pgfsys.code.tex pgfsyssoftpath.code.tex 2013/09/09 (rcs-revision 1.9) pgfsysprotocol.code.tex 2006/10/16 (rcs-revision 1.4) xcolor.sty 2016/05/11 v2.12 LaTeX 颜色扩展 (英国) color.cfg 2016/01/02 v1.6 示例颜色配置 pgfcore.code.tex pgfcomp-version-0-65.sty 2007/07/03 v3.0.1a (rcs-revision 1.7) pgfcomp-version-1-18.sty 2007/07/23 v3.0.1a (rcs-revision 1.1) pgffor.sty 2013/12/13 v3.0.1a (rcs-revision 1.25) pgfkeys.sty
pgfkeys.code.tex pgfmath.sty
pgfmath.code.tex pgffor.code.tex tikz.code.tex pgfplots.sty 2016/08/10 v1.14 数据可视化 (1.14) pdftexcmds.sty 2016/05/21 v0.22 pdfTeX for LuaTeX 的实用函数 (HO) infwarerr.sty 2016/05/16 v1.4 提供信息/警告/错误消息 (HO) ifluatex.sty 2016/05/16 v1.4 提供 ifluatex 开关 (HO) ltxcmds.sty 2016/05/16 v1.23 通用 LaTeX 内核命令 (HO) ifpdf.sty 2016/05/14 v3.1 提供 ifpdf 开关 atveryend.sty 2016/05/16 v1.9 文档末尾的挂钩(HO) fig/first-plot.eps fig/second-plot.eps fig/third-plot.eps
更新到最新版本后,问题依旧。