\documentclass{article} \usepackage{a4} \title{A simple LaTeX example} \author{Andrew C.R.\ Martin} \date{28th November, 1996} \begin{document} \maketitle \begin{abstract} This is the abstract. It will be set in a smaller font and centered. \end{abstract} \section{Introduction} This is the beginning of the first section which I have called the Introduction. \subsection{How to so a subsection} This is a subsection of the Introduction which I have called \emph{How to so a subsection}. Notice that that last bit was emphasised in italics. I could also have made it {\bfseries bold}. If you want you can do sub-subsections as well. \section{Tables} This is how you do tables. First of all you define a table `environment' (note the opening inverted comma!). This is known as a `float' since it can float around the page to find the best place to fit. There are floats for both tables and figures. Within the table environment, you create a tabular environment (which you probably want to be centered) in which you enter your data: That created Table~\ref{tab:example}. There were three columns (defined by the ``lll'' part --- note how I got double inverted commas there and also how I made the long dash). The hline commands were used to create horizontal lines. The columns were separated by ampersand characters and each line was ended with a double backslash. I also have the table a caption and put a label inside that caption. This lets me refer to that table anywhere in the text without having to remember the table number. If I add an extra table before this one, the number will be corrected automatically. \section{Running LaTeX} This is how you convert this into a PostScript file: \begin{enumerate} \item Call the file sample.tex \item latex sample \item latex sample (\emph{Do it again to sort out references from one place to another in the text}) \item dvips -o sample.ps sample \end{enumerate} You now have a PostScript file you can print! If you are using the BibTeX package for looking after your bibliography, you run {\tt bibtex sample} (note that was in typewriter font) after the first run of LaTeX and you need to run LaTeX an extra time before {\tt dvips}. \begin{table} \begin{center} \begin{tabular}{lll} \hline Column1 & Column2 & Column3 \\ \hline data & junk & rubbish \\ arghh & splat & bump \\ \hline \end{tabular} \end{center} \caption{\label{tab:example}This is my first table} \end{table} \section{Figures} For figures, you create a figure environment just like the table environment. To import a PostScript (EPSF) figure, you must \begin{verbatim} \usepackage{epsfig} \end{verbatim} up at the top with the other usepackage commands (note how I used the verbatim environment so LaTeX wouldn't try to interpret the use package as a command) and then use the psfig command to import a postscript file. Since I don't have a PostScipt example for you, I've shown an example within a verbatim environment so LaTeX won't actually run this, but you can run it by removing the verbatim environment: \begin{verbatim} \begin{figure} \centerline{\psfig{file=example.ps,width=10cm}} \caption{\label{fig:example} This is my example figure} \end{figure} \end{verbatim} You an import other types of images in a similar way. \vspace{1in} {\LARGE Have fun!!!} \end{document}