Web Historical Disclaimer:

This is a historical page and is no longer maintained. Read our Web history statement for more information.

                                                       

  " "
   | UT Home | Graduate School Home |
" "

" "
 

LaTeX: from quick and dirty to style and finesse

Figures, tables and seminars
by Tony Roberts

Contents of this section

Tables

Tables and figures are examples of entities that "float". They generally form too large an entity to be conveniently placed just anywhere on a page. Instead LaTeX waits so that it can put them in a convenient place: the top of a page, the bottom of a page, or on a page by itself.

To request LaTeX to include a table use the table environment:

\begin{table}
...
instructions for typesetting the table
(usually tabular within a center environment)
...
\caption{...}
\label{...}
\end{table}

See the table of fractal dimensions at the end of fractals31.tex. In the first run through, LaTeX cannot find room on page 5 for the table, and so places it on page 6 by itself. In the second run, the Table of Contents has pushed more material into the document, and now the table is placed at the top of the page.

One may include a List of Tables in the document with the command \listoftables.

Figures

The usual way to include a figure in LaTeX is as follows.

  • Create a postscript file of the drawing from whatever application is being used to generate the figure. For example, cantor.m and koch.m are Matlab programs that create graphs which have postscript in files cantor.eps and koch.eps
  • Then place in the preamble the commands
  • \usepackage{graphicx}
  • Somewhere near where you want the figure, include the figure environment
    \begin{figure}
    \centerline{\includegraphics{...}}
    \caption{...}
    \label{...}
    \end{figure}
    where the argument of the \includegraphics command is the full filename.
  • Or use this to scale the picture up/down to the width of the page
    \begin{figure}
    \includegraphics[width=\textwidth]{...}
    \caption{...}
    \label{...}
    \end{figure}

See the two figures in fractals32.tex

The width=0.9\textwidth scales the figure to 90% of the width of the typeset text: change it if desired; leave if out in order to reproduce the figures unscaled; set height=0.8\textheight if instead the vertical height is the constraint.

One may include a List of Figures in the document with the command \listoffigures.

Attached files

Note the use of the filecontents environments in fractals32.tex. These appear at the front of the LaTeX file, and allows supplementary files, such as the postscript pictures, to be carried around with, or attached to, the LaTeX source file. The format is

\begin{filecontents}{filename1}
...
\end{filecontents}
\begin{filecontents}{filename2}
...
\end{filecontents}
...repeated for each needed file ...
\documentclass{article}
...
\end{document}

What happens is that when LaTeX analyses such a .tex file, LaTeX checks to see if the named files exist, if not they are created with the contents specified, if so then nothing changes. LaTeX then proceeds to analyse the document proper.

Seminar style

There is a nifty documentclass for preparing overhead transparencies, the seminar class. Within this class, you use all the normal typesetting facilities offered by LaTeX.

An example framework is as follows:

\documentclass[a4]{seminar}
...

\begin{document}
\begin{slide}
...
\newslide
...
\newslide
...
\end{slide}
\end{document}

Note the use of slide environment within the document, and the use of the \newslide command to strongly control page breaks as it is important to control the specific material on each page.

Such a document is to be viewed and printed in landscape mode, see fractals33.tex.

It is good practise to:

  • have less information per page, the rule is no more than 6 lines of 6 words per line, in which case I suggest including the 12pt option in the documentclass;
  • typeset slides in a sans serif font, here done by including the semhelv option in the documentclass;

as in

\documentclass[a4,12pt,semhelv]{seminar}


3 August 1998

Professor A J Roberts
Dept Mathematics & Computing
University of Southern Queensland
Toowoomba 4350, Australia
E-mail: aroberts@usq.edu.au
 
" "
Graduate School, Main Building 101, Austin, TX 78712
(512) 471-4511, FAX: (512) 471-7620
Privacy statement