I am following the CTAN documentation for exporting an SVG image with LaTeX symbols from Inkscape to embed as an EPS figure in my latex document. MWE is below:
\documentclass[]{article}
\usepackage{epsfig,graphicx,amsmath,amsfonts}
\usepackage{xcolor,import}
\usepackage{transparent}
\begin{document}
\begin{figure}[h]
\centering
\def\svgwidth{70mm}
\import{}{foo.eps_tex}
\end{figure}
\end{document}
where the file foo.eps_tex
is generated from Inkscape (File → Save As... → Encapsulated PostScript (*.eps) → EPS+LaTeX). The original Inkscape drawing is shown below:
and the resulting image in the PDF (LaTeX + DVItoPs + PStoPDF ) is as seen below:
Though, more or less, the symbols are pretty much where I wanted them, they are not placed exactly at the place as per the original SVG drawing. Of course, I could always go back to my drawing, tweak a little and generate the PDF to see if it looks OK. However, I have many such figures to make and this process is not desirable. How do I get my LaTeX symbols not float when I export the SVG? The foo.eps_tex
file is appended below.
\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}{495.90927734bp}%
\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.91319971)%
\put(0,0){\includegraphics[width=\unitlength]{foo.eps}}%
\put(0.12591704,0.64997299){\color[rgb]{0,0,0}\makebox(0,0) [lb]{\smash{$\Gamma_s$}}}%
\put(0.12401264,0.02224006){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$\Omega_ \infty$}}}%
\put(0.45672106,0.40227734){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$\Omega_s$}}}%
\put(0.22841188,0.84721223){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$p^{\mathrm{inc}}$}}}%
\put(0.70651045,0.02827193){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$\Gamma_s^e$
$\mbox{Element}$}}}%
\put(0.86737431,0.22302397){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{$\mbox{Node}$}}}%
\end{picture}%
\endgroup%
The reason for using \import
instead of \input
is to be able to provide the path for the figure data. For example if the Inkscape file foo.svg
and the corresponding foo.eps_tex
are located in ./Chapter1/
then I would use (also see a similar question here)
\import{./Chapter1/}{foo.eps_tex}
\input(Chapter1/foo.eps_tex}
? Since all he text is positioned at absolute coordinates by inkskape there's not much you could do at the text level. If you change the (0,0) in the first \put you will move the image relative to the text so you may find values that work for all your examples if they are all displaced by the same amount.