I am making a work and need some graphs from Open Office. I have read that you can import them with \includegraphics{image.format}

The question is: Any of the exporting formats is better for the resolution of the graphs?

One extra question: Is there any tool to convert graphs' data tables into latex format?

  • The Latex command is \includegraphics, not \includegraphic. The best way to export from OpenOffice depends on what format the graphs are in now. How did you get these graphs into OpenOffice in the first place? Were they imported as bitmaps, or did you create them as charts with Calc or something similar? In the latter case, exporting to PDF would be the most straightforward. That would also work with bitmaps, but in that case, it may be best to simply retrieve the bitmaps from an unzipped version of the document. – Michael Palmer Aug 25 '17 at 18:37
  • 2
    @MichaelPalmer From a previous question by the user I assume the graphs were generated within openoffice. – samcarter_is_at_topanswers.xyz Aug 25 '17 at 18:44
  • @MichaelPalmer they were generated in openoffice Calc! – user134500 Aug 26 '17 at 2:03

If you don't want to deal with a suitable resolution, I suggest using a vector graphic format to export your graphs.

I don't use open office, but in its sibling, LibreOffice, the following export options are available:

enter image description here

While I don't know all of these formats, I can say that eps and svg are vector based. Please see the following two questions about how to use these formats in latex:

How to include SVG diagrams in LaTeX?

eps figures with pdflatex

(and whatever you decide to use, don't use jpeg for graphs)

| improve this answer | |
  • 1
    Upvote justified by last remark alone. Never, ever use jpeg for anything but photographs. – Michael Palmer Aug 25 '17 at 18:40
  • I'm sure libreoffice can export graphs as pdf. I think the option is a separate one on the file menu – Chris H Aug 25 '17 at 19:25
  • @ChrisH Correct, however the few trials I did all exported the whole page to pdf (even if only exporting the selection was specified) and then the pdf would have to be cropped. – samcarter_is_at_topanswers.xyz Aug 25 '17 at 19:46
  • @samcarter with just the graph selected and "selection" set you get something that looks like a print, complete with page number. So it does need cropping. IMO that's no more hassle than using SVG (even if you've got inkscape install to use the svg package) or EPS; none of the other options are any use as they're either raster or broken. – Chris H Aug 25 '17 at 20:36
  • @ChrisH Would you like to add an answer about exporting to pdf? – samcarter_is_at_topanswers.xyz Aug 25 '17 at 21:09

Libre/Open Office has a pdf export option. This is good for use with pdflatex, but the export looks rather like a printout (complete with page numbering) even if just the graph is selected. Thus it will need postprocessing.

It's easy to crop the pdf using inkscape (also free/opensource, and a very useful tool to have). With inkscape installed you have another option tool: svg export and the svg package.

Alternatively you can crop the pdf using the \includegraphics[trim] command -- if you have a few graphs you can use the same settings for all of them, both for export and for includegraphics so you only have to figure it out once.

| improve this answer | |

Your Answer

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