Zumbs' Blog

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

Archive for the ‘Latex’ Category

Another good reason to get Foxit Reader

Posted by Zumbs on November 18, 2009

Like most other people, I have been using Adobe Reader as my prefered pdf reader for a long, long time. Some time back, I installed Foxit Reader to try it out, but it never, really caught on.

Recently, however, I discovered that the default setting for pdflatex (or maybe it’s just the default for the pdf format?) were to disallow comments, as can be seen on the screenshot below.

In the end, I opened the document in Foxit reader, and it had no problem adding comments. It did, however, have the annoying “feature” that it used the username of the logged on user as the name for the commenter. And I were unable to set a global name for it to use, so I had to edit every, single comment.

And it didn’t look as well as it should in Adobe Reader. Go figure.

Posted in Adobe Reader, Foxit Reader, pdflatex | Leave a Comment »

Two columns, subfigure and figure*

Posted by Zumbs on October 4, 2009

I used a few hours earlier this week trying to get my two column latex document to compile using the figure* environment. At the \end{figure*} line pdflatex complained that it did not have enough endpoints:

! Extra }, or forgotten \endgroup.
\@endfloatbox ...pagefalse \outer@nobreak \egroup 
                                                  \color@endbox 
l.239 \end{figure*}

The error were in the lines:

\begin{figure*}
\includegraphics{somefig.png}
\end{figure*}

After seriously reducing the size of my latex document, I discovered that removing the subfigure package would remove the problem. However, this were not a solution, as I had some pagesized figures, consisting of smaller figures. I searched googled the problem, and eventually found this thread.

As noted by localghost, the subfigure package is depricated, and using the subfig package instead solved the problem. Using the subfig package instead of the subfigure package is, fortunately, rather simple – it pretty much consists of replacing \subfigure with \subfloat.

On a side note, it seems that the problem were not caused by the subfigure package by itself, but by interaction between the subfigure package and another package, as this code does compile:

\documentclass[twoside,twocolumn]{article}
\usepackage{graphicx}
\usepackage{subfigure}
\begin{document}
\begin{figure*}
\includegraphics{somefig.png}
\end{figure*}
\end{document}

Posted in Latex, pdflatex | 1 Comment »

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 »