我正在使用 Inkscape 处理图片。这些图片是在 Ecplise 中导入的。我不知道如何找到\put(....,...)
输入来定义 pdf 文件中的文本:
\put(???,???){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$C^{\alpha}$}}}%
在:
\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}{213.92344656bp}%
\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.98997011)%
\put(0,0){\includegraphics[width=\unitlength]{inkscape_01.pdf}}%
\put(0.82234036,0.24887298){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$C^{\alpha}$}}}%
\put(0.20053521,0.87303284){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$\sigma_{\mathrm{T}}$}}}%
\end{picture}%
\endgroup%
答案1
考虑以下
\documentclass{article}
\usepackage{graphicx}
%\usepackage{pict2e}
\begin{document}
\begin{picture}(100,100)(0,0)%
\put(0,0){\includegraphics[width=100\unitlength,height=100\unitlength]{example-image-a}}%
\put(20,20){$C^{\alpha}$}%
\put(60,60){$\sigma_{\mathrm{T}}$}%
\end{picture}
\end{document}
这里\begin{picture}(100,100)(0,0)
创建一个尺寸为的边界框100 x 100
,其左下角有坐标(0,0)
,右上角有坐标(100,100)
,并且unitlength
为 1。因此,
\put(20,20){$C^{\alpha}$}%
将 放在和 处$C^{\alpha}$
。如果您希望它位于中心,则使用。希望它很清楚。在您的例子中 (100,100) 转换为并且第二个参数是可选的,因此。x=20\unitlength
y=20\unitlength
\put(50,50){$C^{\alpha}$}
(1,0.98997011)
(0,0)
答案2
和 Harish 的回答一样,这种方法将文本置于图像之上。但是,在这种情况下,它使用了包\stackinset
中的宏stackengine
。
MWE 显示单个插图以及嵌套插图。
\documentclass{article}
\usepackage{graphicx}
\usepackage[usestackEOL]{stackengine}
\begin{document}
\stackinset{c}{}{c}{}{Center}{\includegraphics[width=1in,height=1in]{example-image-A}}
And here shown nested:
\stackinset{c}{-12mm}{b}{15mm}{$\alpha^2$}{%
\stackinset{r}{2mm}{c}{}{\Longstack[r]{2mm offset from\\ center right}}{%
\stackinset{l}{2mm}{t}{2mm}{2mm offset from upper left}{%
\includegraphics[width=3in,height=3in]{example-image-A}%
}}}
\end{document}