I'm really frustrated. I'm trying for houers to add a drawing from Inkscape (PDF+LaTeX format) into Lyx. I didn't find anything helpfully in this matter on google.
What I did: Inkscape generate two files: the fist one is a .pdf_tex file with coordinates of the text, see code below, the second file is the drawing. After that, I added in the Latex preamble in the document Settings.
Code: Select all
\usepackage{graphicx}
\usepackage{color}
Code: Select all
\input{Zeichnung.pdf_tex}
What's drive me crazy: I exported wiht Lyx the pdflatex code. With TexWorks I am able to generate a PDF file with the drwaing and the text at the right positions.
So what's wrong here? I haven't really got a clue! Please help me in this matter. It's important to me, to have the same font in all my Pictures in my whole master thesis.
PS: Sorry for my english, I'm a german

Code: Select all
%% LyX 2.1.3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{graphicx}
\usepackage{color}
\makeatother
\usepackage{babel}
\begin{document}
Testtext
\begin{figure}
\input{Zeichnung.pdf_tex}
\protect\caption{Testabbildung}
\end{figure}
\end{document}
Code: Select all
%% Creator: Inkscape 0.91_64bit, www.inkscape.org
%% PDF/EPS/PS + LaTeX output extension by Johan Engelen, 2010
%% Accompanies image file 'Zeichnung.pdf' (pdf, eps, ps)
%%
%% To include the image in your LaTeX document, write
%% \input{<filename>.pdf_tex}
%% instead of
%% \includegraphics{<filename>.pdf}
%% To scale the image, write
%% \def\svgwidth{<desired width>}
%% \input{<filename>.pdf_tex}
%% instead of
%% \includegraphics[width=<desired width>]{<filename>.pdf}
%%
%% Images with a different path to the parent latex file can
%% be accessed with the `import' package (which may need to be
%% installed) using
%% \usepackage{import}
%% in the preamble, and then including the image with
%% \import{<path to file>}{<filename>.pdf_tex}
%% Alternatively, one can specify
%% \graphicspath{{<path to file>/}}
%%
%% For more information, please see info/svg-inkscape on CTAN:
%% http://tug.ctan.org/tex-archive/info/svg-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}{595.27559055bp}%
\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,1.41428571)%
\put(0,0){\includegraphics[width=\unitlength,page=1]{Zeichnung.pdf}}%
\put(0.40439913,1.0356032){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{Testabbildung\\ Umbruch}}}%
\end{picture}%
\endgroup%