[Univ of Cambridge] [Dept of Engineering]
next up previous contents
Next: GIF and jpeg files Up: Graphics Previous: Postscript from PCs/Macs

Scaling, rotation, clipping, wrap-around and shadows

To scale, use some optional arguments

   \includegraphics[width=5cm,height=10cm]{yourfile.ps}
would rescale the postscript so that it was 5cm wide and 10cm high. To make the picture 5cm wide and scale the height in proportion use
   \includegraphics[width=5cm]{yourfile.ps}

To rotate anticlockwise by the specified number of degrees, use

   \includegraphics[angle=150]{yourfile.ps}

The following examples demonstrate how to combine these features and how to use the subfigure package to have more than one graphic in a figure.


 
Figure 2: Tigers
\includegraphics[height=40mm]{/export/ghostfonts/tiger.eps} \includegraphics[angle=120, height=20mm]{/export/ghostfonts/tiger.eps}

\begin{figure}[hbtp]
  \includegraphics[height=40mm]{/export/ghostfonts/tiger.eps} 
  \includegraphics[angle=120, height=20mm]{/export/ghostfonts/tiger.eps} 
\caption{Tigers}
\end{figure}

% remember to do \usepackage{subfigure} at the top of the document! 
\begin{figure}[hbtp]
\begin{center}
% an mbox for alignment
\mbox{\subfigure[Small]
{\includegraphics[height=30mm]{/export/ghostfonts/crest.eps}}\quad
\subfigure[Medium]
{\includegraphics[height=40mm]{/opt/latex/ps/color_CU_arms.ps}}\quad
\subfigure[Large]
{\includegraphics[height=50mm]{/export/ghostfonts/crest.eps}} 
}% end of mbox
\caption{3 crests}
\end{center}
\end{figure}


 
Figure 3: 3 crests
[Small] \includegraphics[height=30mm]{/export/ghostfonts/crest.eps}     [Medium] \includegraphics[height=40mm]{/opt/latex/ps/color_CU_arms.ps}     [Large] \includegraphics[height=50mm]{/export/ghostfonts/crest.eps}

To clip the postscript image use the viewpoint argument. The following fragment would display only part of the image. The viewport coordinates are in the same units as the bounding box.

\begin{figure}[htbp]
\includegraphics[viewport=200 400 400 600,width=5cm,clip]%
{/opt/latex/ps/color_CU_arms.ps}
\end{figure}

% Use the floatflt package
\begin{floatingfigure}[l]{4cm}
\includegraphics[width=2cm]{/export/ghostfonts/crest.eps}  
\caption{Using floatingfigure}
\end{floatingfigure}


 
Figure 4: Using floatingfigure
4cm \includegraphics[width=2cm]{/export/ghostfonts/crest.eps}

The floatflt package lets you insert a graphic and have the text wrap around it. You can provide 2 arguments to the floatingfigure command: the first (l or r) selects whether you want the graphic to be on the left or right of the page. The 2nd argument gives the width of the graphic. Not all text will flow perfectly around (for example, verbatim text fails) so check the final output carefully.

Using the fancybox package gives you access to \shadowbox, \ovalbox, \Ovalbox and \doublebox commands, which can be used with text or with graphics. For example, \shadowbox{shadow package} produces shadow package and

\ovalbox{\includegraphics[height=10mm]{/opt/latex/ps/color_CU_arms.ps}}
produces \includegraphics[height=10mm]{/opt/latex/ps/color_CU_arms.ps}. Unfortunately, the fancybox package as supplied suppresses the table of contents. The locally produced contentsfancybox solves this, but may introduce graphics problems.


next up previous contents
Next: GIF and jpeg files Up: Graphics Previous: Postscript from PCs/Macs
Tim Love
1999-08-05