Zumbs' Blog

The truth may be out there, but lies are inside your head

Archive for the ‘OpenOffice’ Category

Figures for Latex with OpenOffice Draw

Posted by Zumbs on October 4, 2009

There are numerous options for making figures to use with Latex. I usually use pdflatex, and, thus, prefer using figures in pdf format. This gives a few problems. Many programs either do not come with the ability to export to pdf, and even if they do, they export the entire page, and not a cropped figure. Another option is to take a screenshot of your figure, but that often looks ugly and does not scale very well.

OpenOffice comes with a pdf exporter, but it does not automatically crop the page to only contain the figure. It is, however, easy to rectify, as it is easy to change the size of the paper to whatever dimensions you want.

This is handled through the Page Setup dialog, which can be opened by Format->Page, as shown below:

OpenOfficeDrawPage

This brings up the Page Setup dialog, where you can edit the width and height of the drawing. When you are done, press ok and investigate if the figure is cropped to your liking.

OpenOfficeDrawPageSetup

After having cropped the drawing to your liking, it can be exported to pdf by using File->Export as PDF… and clicking Export in the dialogue. Your new pdf figure can be imported into your Latex document using this small bit of code:

\begin{figure}
\centering
\includegraphics[width=0.9\textwidth]{pdffigure.pdf}
\caption{This is my new pdf figure.} \label{fig:pdffigure}
\end{figure}

Usage of \includegraphics requires that you add \usepackage{graphicx} to the header of your latex document. The described procedure works with LibreOffice as well.

Posted in Latex, LibreOffice, OpenOffice, pdflatex | Tagged: , , , , | 2 Comments »