数学论文中使用的 Postscript 或 PDF 图像通常主要由几条线和贝塞尔曲线组成。如果有一种简单的方法可以提取这些信息并将其转换为 tikz \draw 命令,则可以方便地用 tikz 图片替换现有的包含图形。有人知道可以做到这一点的转换程序吗?它会不是需要是一个完全通用的解决方案——如果它从所呈现的大多数文件中提取了大多数有用的信息(线条、曲线、标签(?)......),那将非常有用。
添加:
其中一位评论者询问 eps2pgf 的输出是什么样的。以下是示例:
% Created by Eps2pgf 0.7.0 (build on 2008-08-24) on Sat Aug 28 14:14:16 PDT 2010
\begin{pgfpicture}
\pgfpathmoveto{\pgfqpoint{0cm}{0cm}}
\pgfpathlineto{\pgfqpoint{5.186cm}{0cm}}
\pgfpathlineto{\pgfqpoint{5.186cm}{4.092cm}}
\pgfpathlineto{\pgfqpoint{0cm}{4.092cm}}
\pgfpathclose
\pgfusepath{clip}
\begin{pgfscope}
\pgfpathmoveto{\pgfqpoint{0cm}{4.092cm}}
\pgfpathlineto{\pgfqpoint{0cm}{0cm}}
\pgfpathlineto{\pgfqpoint{5.186cm}{0cm}}
\pgfpathlineto{\pgfqpoint{5.186cm}{4.092cm}}
\pgfpathclose
\pgfusepath{clip}
\begin{pgfscope}
\begin{pgfscope}
\pgfsetdash{}{0cm}
\pgfsetlinewidth{0.317mm}
\definecolor{eps2pgf_color}{rgb}{0,0,0}\pgfsetstrokecolor{eps2pgf_color}\pgfsetfillcolor{eps2pgf_color}
\pgfpathmoveto{\pgfqpoint{0.044cm}{2.586cm}}
\pgfpathcurveto{\pgfqpoint{0.789cm}{2.747cm}}{\pgfqpoint{1.394cm}{3.29cm}}{\pgfqpoint{1.633cm}{4.014cm}}
\pgfusepath{stroke}
\end{pgfscope}
\begin{pgfscope}
\pgfsetdash{}{0cm}
\pgfsetlinewidth{0.317mm}
\definecolor{eps2pgf_color}{rgb}{0,0,0}\pgfsetstrokecolor{eps2pgf_color}\pgfsetfillcolor{eps2pgf_color}
\pgfpathmoveto{\pgfqpoint{3.538cm}{4.014cm}}
\pgfpathcurveto{\pgfqpoint{3.629cm}{3.205cm}}{\pgfqpoint{4.31cm}{2.592cm}}{\pgfqpoint{5.125cm}{2.586cm}}
\pgfusepath{stroke}
\end{pgfscope}
\begin{pgfscope}
\pgfsetdash{}{0cm}
\pgfsetlinewidth{0.317mm}
\definecolor{eps2pgf_color}{rgb}{0,0,0}\pgfsetstrokecolor{eps2pgf_color}\pgfsetfillcolor{eps2pgf_color}
\pgfpathmoveto{\pgfqpoint{0.046cm}{4.015cm}}
\pgfpathlineto{\pgfqpoint{5.126cm}{4.015cm}}
\pgfpathlineto{\pgfqpoint{5.126cm}{0.046cm}}
\pgfpathlineto{\pgfqpoint{0.046cm}{0.046cm}}
\pgfpathclose
\pgfusepath{stroke}
\end{pgfscope}
\begin{pgfscope}
\pgfsetdash{}{0cm}
\pgfsetlinewidth{0.317mm}
\definecolor{eps2pgf_color}{rgb}{0,0,0}\pgfsetstrokecolor{eps2pgf_color}\pgfsetfillcolor{eps2pgf_color}
\pgfpathmoveto{\pgfqpoint{0.046cm}{1.316cm}}
\pgfpathlineto{\pgfqpoint{5.126cm}{1.316cm}}
\pgfusepath{stroke}
\end{pgfscope}
\end{pgfscope}
\end{pgfscope}
\end{pgfpicture}