1

enter image description hereAfter looking through numerous questions and guides, I tried these two versions, but both end up placing all the text on top of each other in the top left corner of the image.

I selected the option to output a pdf_tex file with the text from latex and thought that should make sure the text is in the right places?

\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}

Code generated by 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%

Link to the svg file imported into inkscape from calc (only saved with calc): https://svgshare.com/i/6gb.svg

6
  • 1
    This is very hard to tell without more information on the various files in the chain. What do you expect? Someone will produce files along the lines you describe until she or he will find a similar issue, solve it, and post the solution as an answer? Besides, your code fails to meet any criteria of an MWE.
    – user121799
    Commented May 15, 2018 at 22:27
  • As I am only following a standard procedure: 1) Create figure in calc 2) Export as svg 3) Import with svg 4) Save as pdf with inkscape, while selecting the option to create the text tex file 5) Import through standard methods I thought that the error is in 5 and not in 1-4? 5) is completely in the question. Which criterias? You mean to provide a code that includes all the latex packages and an example figure uploaded? I hoped the question was trivial for somebody to answer who is familiar with the svg export import.
    – Jannis
    Commented May 15, 2018 at 22:27
  • 1
    without seeing the input or the output it is impossible to guess what is wrong. you have the syntax for \centering incorrect (there should be no {} but that is unlikely to make anything overprint. Commented May 15, 2018 at 22:32
  • I wondered if the method above is outdated, as it seems to have worked for people in the past.
    – Jannis
    Commented May 15, 2018 at 22:32
  • 1
    I added the problem image and the code generated by inkscape This means that inkscape just exports the calc svg wrong and i have to fix the problem with inkscape? Thanks.
    – Jannis
    Commented May 15, 2018 at 22:39

1 Answer 1

4

It's not really possible to run the example as posted but your file clearly shows

\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}}}%

That is all the text is at the exact same coordinate so will overprint.

Whether that is an error in the original document or in the conversion from svg impossible to say, but latex, including this tex, has to overprint the words.

5
  • I added the svg file from calc to the question now. It loads fine in inkscape. But inkscape exports all the wrong text positions.
    – Jannis
    Commented May 15, 2018 at 22:47
  • @Jannis OK but that isn't a tex question, so not really on topic here, sorry. Commented May 15, 2018 at 22:49
  • Originally my question is how to import a calc figure (same as an svg figure) into tex. This was the suggested way to get it into tex. I might have to try a different path.
    – Jannis
    Commented May 15, 2018 at 22:50
  • 2
    @Jannis well simpler would be just to export to pdf and include that, but inkscape presumably has a bug reporting system or you could use stackoverflow to ask about the export to tex+svg Commented May 15, 2018 at 22:53
  • I ended up saving it as a very high resolution png with inkscape and importing that, because importing that as pdf gave me some other issues. It's sharp now, even though I would have prefered latex to define the font etc.
    – Jannis
    Commented May 15, 2018 at 23:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .