tabularx 包和 epstopdf 包之间有冲突吗?

tabularx 包和 epstopdf 包之间有冲突吗?

我正在尝试使用 epstopdf 将 EPS 文件动态转换为 PDF,但我无法让它与该tabularx软件包一起工作。

总之,有人能告诉我为什么下面的例子有效吗?

\documentclass[pdftex,10pt,a4paper]{article}
\usepackage[pdftex]{graphicx}
\def\pdfshellescape{1}
\usepackage{epstopdf}
\usepackage{amssymb,amsmath, amsfonts}
\usepackage{longtable}
\usepackage{ltablex}
\usepackage{tabularx}


\def\pth{X:/Results/results/pictures}
\def\ig{\includegraphics[scale=0.8,keepaspectratio]}


\begin{document}

\begin{longtable}{|c|}
\ig{\pth/result5}\\
\end{longtable}

\end{document}

当我替换时:

\begin{longtable}{|c|}
\ig{\pth/result5}\\
\end{longtable}

和:

\begin{tabularx}{\linewidth}{X}
\ig{\pth/result5}\\
\end{tabularx}

它不再编译?

我收到以下错误:

! Package pdftex.def Error: File
`X:/Research/Results/lung_project_results/pict
ures/result5-eps-converted-to.pdf' not found.

我正在使用 Miktex 2.9.4476

当我添加时\listfiles,日志文件输出以下内容:

*File List*  
 article.cls    2007/10/19 v1.4h Standard LaTeX document class  
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)  
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    2007/01/18 v1.5 graphics configuration of teTeX/TeXLive  
  pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX  
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)  
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)  
epstopdf.sty    2010/02/09 v2.5 Conversion with epstopdf on the fly (HO)  
epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf  
  grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)  
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)  
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)  
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)  
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)  
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)  
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)  
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)  
 amssymb.sty    2009/06/22 v3.00  
amsfonts.sty    2009/06/22 v3.00 Basic AMSFonts support  
 amsmath.sty    2000/07/18 v2.13 AMS math features  
 amstext.sty    2000/06/29 v2.01  
  amsgen.sty    1999/11/30 v2.0  
  amsbsy.sty    1999/11/29 v1.2d    
  amsopn.sty    1999/12/14 v2.01 operator names  
 ltablex.sty    1995/11/06 v1.0 Modified tabularx  
longtable.sty    2004/02/01 v4.11 Multi-page Table package (DPC)  
tabularx.sty    1999/01/07 v2.07 `tabularx' package (DPC)  
   array.sty    2008/09/09 v2.4c Tabular extension package (FMi)  

答案1

尽管有评论说它有效,但事实并非如此:-)(我怀疑他们有一个通过成功运行获得的转换后的 pdf 文件longtable。)

tabularx在试运行期间禁用\write(否则标签和索引条目等将被多次写出并造成严重破坏)但这意味着触发\write18转换直到最后一次运行才被禁用。

如果您忽略错误并继续,<return>您将看到在最终运行中图像确实被转换和包含在内,但这并不理想,它很烦人,这意味着在试运行期间图像宽度不可用,所以宽度计算可能会出错。

您可以\write再次启用它或仅启用它,\write18但我认为最安全的做法是不要触摸tabularx,而只是在丢弃框寄存器中对图像进行初始设置,以便图像在表格之前转换。

\documentclass[pdftex,10pt,a4paper]{article}
\usepackage[pdftex]{graphicx}

\usepackage{epstopdf}
\usepackage{amssymb,amsmath, amsfonts}
\usepackage{longtable}
\usepackage{ltablex}
\usepackage{tabularx}



\def\ig{\includegraphics[scale=0.8,keepaspectratio]}


\begin{document}

%\begin{longtable}{|c|}
\sbox0{\ig{result5}}
\begin{tabularx}{.5\textwidth}{X}
\ig{result5}\\
%\end{longtable}
\end{tabularx}

\end{document}

相关内容