|
|
|||
![]() |
Department of Engineering |
| University of Cambridge > Engineering Department > computing help |
\reflectbox{Reflect} produces
and \resizebox{3cm}{0.2cm}{Stretched}
produces
.
To scale imported graphics, use some optional arguments
\includegraphics[width=5cm,height=10cm]{yourfile.jpg}
would rescale the JPEG file 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.png}
To rotate anticlockwise by the specified number of degrees, use
\includegraphics[angle=150]{yourfile.eps}
These options can be combined, though note that order matters - rotating then changing the width might have a different result to changing the width then rotating. The following examples demonstrate how to combine these features and how to use the subfig package to have more than one graphic in a figure.
\centering
\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{subfig} at the top of the document!
\begin{figure}[hbtp]
\centering
\subfloat[Small]% \quad on the next line adds spacing
{\includegraphics[height=30mm]{/export/ghostfonts/crest.eps}}\quad
\subfloat[Medium]
{\includegraphics[width=40mm]{CUni3.eps}}\quad
\subfloat[Large]
{\includegraphics[height=50mm]{/export/ghostfonts/crest.eps}}
\caption{3 crests}
\end{figure}
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]%
{CUniv3.eps}
\end{figure}
% Use the floatflt package
\begin{floatingfigure}[l]{4cm}
\includegraphics[width=2cm]{/export/ghostfonts/crest.eps}
\caption{Using floatingfigure}
\end{floatingfigure}
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, as illustrated below) 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
and
\ovalbox{\includegraphics[height=10mm]{CUni3.eps}}
produces
.
Unfortunately, the fancybox package as supplied suppresses the
table of contents. The locally produced contentsfancybox solves
this, but may introduce graphics problems.
| | computing help | |