| PHYS408W : LATEX Guide |
In order to include graphics in a document, you need the
graphics package.
In the preamble of your .tex file (after the
\documentclass statement and before the \begin{document}
statement), include the following line.
\usepackage{graphics}
Note: the graphics package will only work with TeXnicCenter as described here if you have selected LaTeX => DVI under Build -> Select Output Profile ...
The graphics package enables you to import graphics files in
the Encapsulated Postscript (eps) format with the
\includegraphics command.
LATEX replaces the \includegraphics statement with the
graphics file specified in its argument. For example, to place the
contents of the file file.eps in the document, the syntax is
\includegraphics{file.eps}
Note : the file must be located in the same directory as your
.tex file.
You can scale the size of the graphics file with the \scalebox
command. To scale the file by 75%, the syntax is
\scalebox{0.75}{
\includegraphics{file.eps}
}
It is often useful in a document to place graphics in a figure with a descriptive caption and a number to reference in the text. These tasks are handled with the LATEX figure environment.
\begin{figure}
\centering
\includegraphics{file.eps}
\caption{A brief description of the figure goes here.}
\label{myfigure}
\end{figure}
TeXnicCenter provides a figure shortcut button
(
Once you have defined a figure and given it a label, you can refer to
it using its label with the \ref command.
For example, here is some text in which I refer to Figure \ref{myfigure}.
LATEX will automatically number the figures in your document and
replace the \ref{myfigure} statement with the appropriate
figure number in the typeset document.
\ref command in some
text. Experiment with the \scalebox command.
Next: 8 Bibliographic Citations/References
Up: PHYS408W : LATEX Guide
Previous: 6 Typesetting Mathematics
| Copyright © 2006-2009, Lewis A. Riley | Updated Wed Jan 14 22:58:50 2009 |