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:

   \put(-0.05241193,0.78432034){\makebox(0,0)[lb]{\smash{Cladding (air)}}}%

and so on. Same for pdf+latex.

Original LibreOffice (version file and exported SVG: ODG SVG

I can't attach the files created by Inkscape (version, 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:

(source: x-linux.de)

Processed using latex:

(source: x-linux.de)

  • 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

| 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... – MrD 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. – MrD Mar 31 '13 at 17:19

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






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

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

| 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. – MrD Mar 30 '13 at 16:03

When exporting from LibreOffice, the SVG XML gets exported as:


The problem is that PDF Export only look coordinate in to text mark. I just copied the x,y coordinate do text markup.

I made a quick fix using python and I am sharing at gitgub:


The result is exactly what I was looking for:

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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