为什么使用 pdftex 时 pinlabel 找不到 fig.pdf?

为什么使用 pdftex 时 pinlabel 找不到 fig.pdf?

我刚刚发现别针标签,并想用它给我的图形添加标签。

我正在使用 Adob​​e Illustrator 创建我的图形:我有一台 Mac,使用最新的操作系统,似乎很难/不可能安装xfig。我正在使用 TeXShop,我更喜欢使用pdftexLaTeX 来处理我的文件,所以我使用 AI 创建 PDF 图形。

问题是,当我将 pinlabel 标签添加到我的图形时,我收到无法找到.ps.eps文件的错误。Colin Rourke 的 pinlabel 说明表明,使用 pdftex 时,它会自动搜索.pdf图形文件,但显然并非如此。

以下是我使用的 TeX 示例。示例图可在此处获取:

http://www.math.cornell.edu/~tsh/math/cropped-C3-example.pdf

\documentclass{amsart}   
\usepackage{graphicx}
\usepackage{pinlabel}        
\begin{document}        
\begin{figure}[ht]
\labellist
\small\hair 2pt
\pinlabel $(0,0)$ at 160 190
\endlabellist
\centering
\includegraphics{cropped-C3-example}
\caption{We are interested in the shaded region.}
\label{fig:C3}
\end{figure}    
\end{document}

如果我注释掉 中的行\labellist to \endlabellistpdftex将产生一个完美的图形。有了这些行,我得到了错误

未找到 cropped-C3-example.{ps,eps}(或没有 BBox)

有其他人遇到过这个问题吗?你找到解决办法了吗?

答案1

如果您愿意使用TikZ而不是pinlabel,这里有一个解决方案。注释掉的行会在图像顶部绘制一个帮助网格,以便您可以看到将节点放在何处。

我无法让它pinlabel工作,并且看到了您提到的错误。

\documentclass{amsart}
\usepackage{tikz}
\usepackage{graphicx}



\begin{document}

\begin{figure}[ht]
\begin{center}
\begin{tikzpicture}

\node[anchor=south west,inner sep=0] at (0,0) {\includegraphics{cropped-C3-example.pdf}};

%%\draw[help lines] (0,0) grid (8,8);

%% This is done by drawing a label above and right
%% of the vertex you're labeling, rather than giving
%% the coordinates of the label itself.
%% Alternately, if you wanted to position the label
%% yourself, you could use a command like:
\node[label=above right:{$(0,0)$}] at (1.6,3.6){};
%%
%% \node at (2.2,4.1){$(0,0)$};
%%
\end{tikzpicture}

\end{center}
\caption{We are interested in the shaded region.}
\label{fig:C3}
\end{figure}

\end{document}

答案2

我看到 Tara 找到了一个解决方案,但对于其他正在谷歌搜索此问题的人来说:

安装 pinlabel 后,我得到了同样的错误报告。我的 Windows MikTeX 安装没有抱怨我使用的是 1.1 版,而不是没有抱怨 pinlabel 未安装。如果我将 pinlabel.sty 的副本放在与我的 tex 文件相同的文件夹中,我也会出现错误。最重要的是,由于某种原因,MikTeX 更新程序没有检测到我过时的 pinlabel.sty。pinlabel 文档说 pdf 图像需要 1.2 版。

我找到了 1.2 版http://www.ctan.org/pkg/pinlabel,将其放在与我的 tex 文件相同的文件夹中(UGA 没有管理员权限),它就可以正常工作。因此,如果您有 pdf 图像,请确保您使用的是 1.2。

相关内容