Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to import a graphic created in LibreOffice Draw in a LaTeX document.

So far I've tried the Way:

  1. Export Document to SVG file.
  2. Open with Inkscape and Export using eps+latex
  3. Including resulting xxx.eps_tex in latex

Although the SVG seems to be just fine (also in Inkscape), the exported positions of the text are bad:

\begin{picture}(1,0.73115748)%
   \put(0,0){\includegraphics[width=\unitlength]{ModeDispersion.eps}}%
   \put(-0.05241193,0.78432034){\makebox(0,0)[lb]{\smash{Cladding (air)}}}%
   \put(-0.05241193,0.78432034){\makebox(0,0)[lb]{\smash{Substrate}}}%
   \put(-0.05241193,0.78432034){\makebox(0,0)[lb]{\smash{In}}}%
   \put(-0.05472789,0.25830639){\makebox(0,0)[lb]{\smash{Out}}}%
   \put(-0.05472789,0.25830639){\makebox(0,0)[lb]{\smash{Single-mode}}}%
\end{picture}%

and so on. Same for pdf+latex.

Original LibreOffice (version 4.0.1.2) file and exported SVG: ODG SVG

I can't attach the files created by Inkscape (version 0.48.3.1), as stackoverflow told me that I would need at least ten reputations to do so...

Does anyone know how to solve this problem?

edit: Shown in inkscpae:

Inkscape

Processed using latex:

LaTeX

share|improve this question

migrated from stackoverflow.com Mar 30 '13 at 13:32

This question came from our site for professional and enthusiast programmers.

1  
Welcome to TeX.sx! Your post was migrated here from another Stack Exchange site. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. As new user without image posting privileges simply include the image as normal and remove the ! in front of it to turn it into a link. A moderator or another user with edit privileges can then reinsert the ! to turn it into an image again. –  hpesoj626 Mar 30 '13 at 13:34
add comment

2 Answers 2

  • The graphics figure Work flow adopted by you .odg-->.svg--> eps+tex/pdf+tex is not optimal due to conversion inefficiency of respective editor.

  • The recommended choice of figure format is .pdf always except for screenshots (.png) and photos (.jpg) assuming pdflatex engine.

  • Adopt a 'single' conversion step to generate figure.pdf. Either .svg to .pdf or .odg to .pdf not combine them.

  • Inkscape exports to .pdf with latex fonts(latin modern) or close enough, similarly LibreOffice. I have successfully changed the fonts and exported your drawing using Libreoffice to .pdf. You can even draw in Inkscape and export to pdf also.

enter image description here

share|improve this answer
    
Ok, it seems that I have no choice but to dig into drawing diagramms directly with LaTeX (what is surely not the worst). I was just curious to know who is guiltily in case of the text items. Is LibreOffice that bad guy who messes around with the svg-standard? I don't think so, because Inkscpae can actually show me the correct image, but export of all texts written in Office is wrong. On the other hand it has really surprised me that text that has been later added directly in inkscpae performs well... –  DL6ER Mar 31 '13 at 10:48
    
Who is guilty ? 'Ourselves' for using wrong tools in wrong combination for wrong purpose, when they are best tools in latex graphic packages –  texenthusiast Mar 31 '13 at 15:11
    
Ok...I will be looking into pstricks. Thanks. Was just wondering if the svg is wrong or if it is exported badly. –  DL6ER Mar 31 '13 at 17:19
add comment

Why don't you export your drawing as .png and the incorporate it like this?

\documentclass{article}

\usepackage{pgf}

\begin{document}

\begin{center}
  \pgfimage[width=0.6\textwidth]{myshapes.png}
\end{center}

\end{document}

You will need to use pdflatex to compile your .tex file.

You can get the whole bunch of files for the above solution here.

share|improve this answer
    
There are several disadvatages using a PNG-image, as I want everything to be included as vectro graphics. Also Text should be treated by latex itselt, so it will get the same text shape as the rest of the document. Also I mentioned that the filesize is about to explode if I would only use images, as I will need many of them. –  DL6ER Mar 30 '13 at 16:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.