Aligning LaTeX images
eharetea

This bash script helps to align images, or define boundaries for external postscript files within a tex file that uses pstricks.

Align images and figures in LaTeX and pstricks.

Date Created:Sunday February 22nd, 2009 05:22 PM
Date Modified:Sunday February 22nd, 2009 05:36 PM

First try compiling your LaTeX using makeps.sh

makeps myfile.tex

This should create a file myfile.ps. Then use boundingbox.sh to create a new tex file that draws a bounding box around the image:
boundingbox myfile.ps

Then use makeps.sh to generate a pdf for viewing the bounding box version:
makeps ghostbox.tex

Edit the ghostbox.ps file directly. Change the bounding box values, which are represented as x1 y1 x2 y2:
%%BoundingBox: 120 460 420 760

where (x1,y1) represents the lower left corner, and (x2,y2) represents the upper right corner. Continually repeat the last two steps until you are satisfied with the bounding size. Then you can include your graphics like this:
\begin{figure}[htp]
\centering
\includegraphics{images/Filename.ps}
\caption{ Caption goes here... }
\label{ fig:Filename }
\end{figure}

Enjoy!