Monday, June 21, 2010

Notes for Using Imported Graphics in Latex

1. Some tools to generate the eps files.
a. ImageMagick and GraphicsMagick
The ImageMagick, program convert can convert a BMP, CGM, FIG, FITS, GIF, JPG, PBM, PDF, PGM, PNG, PNM, PPM, PS, RGB, TIF, XBM or XPM file to EPS format.
b. jpeg2eps

Wide figures in two column documents
If you are writing a document using two columns (i.e. you started your document with something like \documentclass[twocolumn]{article}), you might have noticed that you can't use floating elements that are wider than the width of a column (using a LaTeX notation, wider than 0.5\textwidth), otherwise you will see the image overlapping with text. If you really have to use such wide elements, the only solution is to use the "starred" variants of the floating environments, that are {figure*} and {table*}. Those "starred" versions work exactly like the standard ones, but they will be as wide as the page, so you will get no overlapping.

A bad point of those environments is that they can be placed only at the top of the page or on their own page. If you try to specify their position using modifiers like b or h they will be ignored. Add \usepackage{stfloats} to the preamble in order to alleviate this problem with regard to placing these floats at the bottom of a page, using the optional specifier [b]. Default is [tbp]. However, h still does not work.

To prevent the figures from being placed out-of-order with respect to their "non-starred" counterparts, the package fixltx2e [2] should be used (e.g. \usepackage{fixltx2e}).

\wide?
using figure* environment.

c. inserting subfigs
Subfloats
A useful extension is the subfig package [3], which uses subfloats within a single float. This gives the author the ability to have subfigures within figures, or subtables within table floats. Subfloats have their own caption, and an optional global caption. An example will best illustrate the usage of this package:

\usepackage{subfig}

\begin{figure}
\centering
\subfloat[A gull]{\label{fig:gull}\includegraphics[width=0.3\textwidth]{gull}}
\subfloat[A tiger]{\label{fig:tiger}\includegraphics[width=0.3\textwidth]{tiger}}
\subfloat[A mouse]{\label{fig:mouse}\includegraphics[width=0.3\textwidth]{mouse}}
\caption{Pictures of animals}
\label{fig:animals}
\end{figure}

d. The dia is a good tool to generate the vector-based figs.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.