![为什么 Calc->SVG->Inkscape->PDF_Tex 创建的乳胶输入文件中的乳胶文本位置不正确?](https://linux22.com/image/376095/%E4%B8%BA%E4%BB%80%E4%B9%88%20Calc-%3ESVG-%3EInkscape-%3EPDF_Tex%20%E5%88%9B%E5%BB%BA%E7%9A%84%E4%B9%B3%E8%83%B6%E8%BE%93%E5%85%A5%E6%96%87%E4%BB%B6%E4%B8%AD%E7%9A%84%E4%B9%B3%E8%83%B6%E6%96%87%E6%9C%AC%E4%BD%8D%E7%BD%AE%E4%B8%8D%E6%AD%A3%E7%A1%AE%EF%BC%9F.png)
在查看了大量问题和指南之后,我尝试了这两个版本,但最终都将所有文本叠加在图像的左上角。
我选择了从 latex 输出包含文本的 pdf_tex 文件的选项,并且认为应该确保文本位于正确的位置?
\begin{figure}[h]
\centering{
\resizebox{75mm}{!}{\input{images/image.pdf_tex}}
\caption{Top view.}
\label{fig:topView}
}
\end{figure}
\begin{figure}
\def\svgwidth{\linewidth}
\input{images/image.pdf_tex}
\caption{Top view.}
\label{fig:topView}
\end{figure}
inkscape 生成的代码:
\begingroup%
\makeatletter%
\providecommand\color[2][]{%
\errmessage{(Inkscape) Color is used for the text in Inkscape, but the package 'color.sty' is not loaded}%
\renewcommand\color[2][]{}%
}%
\providecommand\transparent[1]{%
\errmessage{(Inkscape) Transparency is used (non-zero) for the text in Inkscape, but the package 'transparent.sty' is not loaded}%
\renewcommand\transparent[1]{}%
}%
\providecommand\rotatebox[2]{#2}%
\ifx\svgwidth\undefined%
\setlength{\unitlength}{453.54330709bp}%
\ifx\svgscale\undefined%
\relax%
\else%
\setlength{\unitlength}{\unitlength * \real{\svgscale}}%
\fi%
\else%
\setlength{\unitlength}{\svgwidth}%
\fi%
\global\let\svgwidth\undefined%
\global\let\svgscale\undefined%
\makeatother%
\begin{picture}(1,0.5625)%
\put(0,0){\includegraphics[width=\unitlength,page=1]{images/image.pdf}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{1}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{6}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{11}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{16}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{21}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{26}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{31}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{36}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{41}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{46}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{51}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{0}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{5}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{10}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{15}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{20}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{25}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{30}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{35}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{40}}}%
\put(0,0){\includegraphics[width=\unitlength,page=2]{images/image.pdf}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{Cars}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{Trucks/Vans}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{Sample}}}%
\put(-0.35075002,0.13462498){\rotatebox{90}{\makebox(0,0)[lb]{\smash{caption text}}}}%
\end{picture}%
\endgroup%
链接到从 calc 导入到 inkscape 的 svg 文件(仅使用 calc 保存):https://svgshare.com/i/6gb.svg
答案1
实际上不可能按照发布的方式运行示例,但您的文件清楚地显示了
\put(0,0.5625){\makebox(0,0)[lb]{\smash{Cars}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{Trucks/Vans}}}%
\put(0,0.5625){\makebox(0,0)[lb]{\smash{Sample}}}%
也就是说,所有文本都位于完全相同的坐标上,因此将会叠印。
无法说清这是否是原始文档中的错误或从 svg 转换时出现的错误,但 latex(包括此 tex)必须套印这些文字。