\documentclass{pracjourn}
%%% Revision control and journal issue
\TPJrevision{2008}{1}{3}
\TPJissue{2007}{4}
%%%
\begin{document}
\title{Teaching \LaTeX: Why and How?}
\author{Paul A. Blaga}
\address{``Babe\c{s}-Bolyai'' University of Cluj Napoca,\\
Faculty of Mathematics and Computer Science\\ 1, Kog\u{a}lniceanu Street, \\
400609 Cluj Napoca,\\ Romania}

\abstract{We discuss some of the problems related to the process of learning of
\LaTeX\ and the opportunity of a \LaTeX\ course. We also propose a syllabus for
such a course and briefly mention some of the \LaTeX\ books which, in our
opinion, are suitable to be adopted as course material.} \maketitle
\section{Is teaching \LaTeX\ really necessary?}
Let's face it: \LaTeX\ courses are very rare. Only now and then one can find a
university offering an introduction to the basics. Some probable reasons
for the scarcity of organized \LaTeX\ learning are, in the opinion of many \LaTeX\
users:
\begin{itemize}
\item \LaTeX\ is very easy to learn, after all;
%
\item there are plenty of excellent (and free) introductions on the internet.
\end{itemize}
In spite of the validity of these claims, from our experience as editors of this journal and in
discussions with colleagues, it seems to us that:
\begin{itemize}
\item Many users of \LaTeX\ learned the basic elements of writing a
document only and stopped there, having yet to explore \LaTeX's richer features.
%
\item Many mathematical users don't employ equation-like or
theorem-like environments. Other users don't use some of the \emph{real} advantages of \LaTeX,
such as automatic numbering, reference citations, figure references, etc.  Often an article document appears
without the title, author, sectioning, and other usual commands, thereby missing most of the fun.
%
\item The great majority of users rarely use fonts other than the default Computer
Modern Fonts.
%
\item Very few people use the many customization options available in \LaTeX.
As a consequence, even users with a fair knowledge of \LaTeX\ produce
documents which all look alike. As a result we are left to read a huge number of
journals and books (some of them produced by well-known international
publishers) which all look the same. It is no longer possible to
tell, looking at a document's typography, who produced it.
%
\item It is sad to see at many mathematics conferences, for instance, how
few presentations use (in a proper way) the capabilities of
\LaTeX. Actually, most of the presentations are either just pages from an
article, or they are prepared using Power Point (which is a shame for a
mathematician).
\end{itemize}
We are of the opinion that if the \LaTeX\ community doesn't get more
involved in making \LaTeX\ more accessible to a wider audience, for instance through teaching, the best
part of it will remain only an esoteric game for the few initiated. An additional barrier to more widespread use
is that although there are plenty of books on \LaTeX\ only a few can
effectively be used as textbooks in a teaching environment.
\section{The goals of a \LaTeX\ course}
In our opinion, after taking a \LaTeX\ course, the student (a mathematician or
computer scientist, for instance) should be able to do at least the
following:
\begin{itemize}
\item format an article or book in a correct and structured manner, and using
fonts other than the default ones;
%
\item be familiar with the tools for producing bibliography and indexes (such as
Bib\TeX\ or Makeindex);
%
\item include graphics files in the document; and
%
\item use \LaTeX\ to produce professional-looking PDF documents.
\end{itemize}
In addition, mathematicians should be able to
\begin{itemize}
\item build complex mathematical structures;
%
 \item produce
specialized graphical material such as commutative diagrams and graphs.
%
\end{itemize}
Computer science students and others who have technical skills should be able to format specialized figures and diagrams, such as the description of an algorithms or
the production of simple drawings using \LaTeX\ tools.
\section{A \LaTeX\ course outline}
Creating a course syllabus is not an easy job. This is true for any
course, and especially for a \LaTeX\ course where there are few existing course outlines to draw from. There are many things to
consider: you have to take into account the background of the
students, the goals of the course, the
teaching facilities available, and so on. We provide here one example of
such a syllabus, for teaching students in mathematics or
computer science.  The amount of material that can be covered depends, of course, on the time available
and the level of the students' interest. This course outline can be adapted for
students in other disciplines as well.
\subsection{Introductory notions. Handling errors.}
Years ago, before the era of the personal computers and notebooks, \TeX\
distributions were usually installed by the system engineers and were
available for everyone. Nowadays, however, each user would like to have \TeX\
installed on his own computer.  Since there are many different personal computer versions available, some of them command-line and some graphical interface, one of the first problems a course designer faces is which one or ones to use for the course.  % Therefore, probably, a \LaTeX\ course should
% start with  the description of one or more distributions and at least a summary
% discussion of the installation process. Fortunately, there are not so many
% distributions and, usually, most of the students, if not all, will use the same
% operating system, therefore it will be enough to discuss a single distribution
%(for instance, one or two of the popular Windows and Macintosh versions). As the
%installations kits are rather large and it takes a lot of time to download them
%from the internet, it would be nice if the instructor could provide them.

As we all know, the \LaTeX\ source files are plain text files, therefore any
text editor is sufficient enough to prepare them. It is, however, wise to
choose an integrated editor, specialized for \LaTeX, and give students some
basic ideas on its use. It is always a good idea to choose a free editor, if
available (such as \TeX nic Center under Windows, or Kile under Linux), but
this is not necessarily the rule, especially if the students are willing to
make a small investment in a better editor.

With the system installed and with some familiarity of the basic use of the \LaTeX\ system, the students are now prepared to begin learning the basics of \LaTeX. Clearly, we should start
with the simplest \LaTeX\ files, including only the basic commands.  Later, additional commands and structures can be introduced. %then show
%students how to use additional packages and discuss the different kind of files
%obtained by running \TeX.

It is also useful to describe the main types of errors that can occur.  When using \LaTeX\ for the first several times the student is likely to make more errors than anything else.
It is a good idea to get the students used to reading the LOG file.
It is fairly common for \LaTeX\ users to ignore the log file.  However, it contains a lot of useful information and can point out why the output you get is not exactly what you
expected it to be.

We might also introduce here the sectioning
commands for articles and books, as well as the bibliography
environment. By doing so the student is equipped to
format a simple article. Later, the student can
return and add richer commands to the basic set.  It is probably best to avoid a teaching method that tries to present too much detail at once.
%The point is that the information
%should not be structured as in an encyclopedia.
%

\subsection{Formatting text and mathematics}
In this part of the course the goal is to learn the basic
formatting methods for both text and mathematics. We should describe first the
``modes'' of \LaTeX: paragraph mode, left-to-right (LR) mode, and math mode, and explain
how \LaTeX\ behaves in each mode. At this stage we can describe
the basic commands for formatting text, such as special characters, using
fonts, and a description of ways to change their characteristics, such as spacing
and justifying text.  For formatting mathematics, describe how to enter
and leave math mode, for both inline math, display math, and the use of math symbols in text.
%  the text and outside it (display mathematics), mathematical alphabets a.o.

Also, it is a good idea to introduce the \texttt{babel} package,
enabling the use of text in other languages.

\subsection{Often-used \LaTeX\ environments}
In this part of the course, the intention is to familiarize the student with the
most often used environments:
\begin{itemize}
\item  theorem-like environments (with the extensions provided by the packages
\texttt{amsthm} and \texttt{theorem} from the \texttt{tools} group);
%
\item environments of equation type (for the moment, only \texttt{equation} and
the starred version, provided by \texttt{amsmath}). We shall avoid the (by now
obsolete) \texttt{eqnarray}).
%
\item environments for producing tabular material (including the packages
\texttt{tabularx} and \texttt{longtable}). If the course is addressed to
computer scientists, then it is a good idea to mention, also, the
\texttt{tabbing} environments, on which the packages for typesetting algorithms
are usually based.
%
\item text environments, like \texttt{quote}, \texttt{quotation},
\texttt{verse}, more useful to non-mathe\-ma\-ti\-cians, but, also, the
\texttt{minipage} environment.
\end{itemize}
\subsection{Mathematical formulae}
This is a part of the course devote, almost entirely, to mathematicians (and,
maybe, physicists). The intention is to speak about more complex formulae,
including, for instance, systems of equations, matrices, large operators with
indices and so on. Essential here is the \texttt{amsmath} package, providing a
wealth of commands and environments for typesetting complex mathematics, as
well as the font package \texttt{amsfonts}, containing a lot of symbols which
are not available in standard \LaTeX.  While teaching the basics of math typesetting it is an appropriate time to give the
students the list of symbols provided by standard \LaTeX, as well as various
symbols provided by other packages the students might be using.

\subsection{\LaTeX\ programming}
This is something for more advanced users,  but is, nevertheless, important.
The students will be taught how to define new commands, new environments,
lists, counters, length, boxes, and other techniques.
\subsection{Bibliographies and indices}
First, we shall review the basic commands for producing bibliographies, and then
show how two use several programs  for handling bibliography databases
(Bib\TeX), and indexes (Makeindex and, possibly, xindy).
\subsection{Producing and including graphics in a \LaTeX \ file}
We shall describe here several packages and programs for producing graphical
material. There are many programs that produce graphics, of course, and almost
any ot them can be used. Our intention, however, is to focus on programs providing
(among others) \LaTeX \ output. The intention is to familiarize the students
with the basics of PSTricks (for general graphics) and Xy-Pic (for commutative
diagrams) and to initiate them in the use of programs  such as \LaTeX Draw,
JsDraw or Xfig.

For the inclusion of graphics, of course, the natural choice is the package
\texttt{graphicx} and its relatives from the \texttt{graphics} bundle (for
instance, \texttt{color} for producing colored text or background).
\subsection{Floating bodies}
Floating bodies are, essentially, figures and tables. We shall describe
both their basic function and the packages which allow better handling of
(\texttt{subfigure, float, rotating}, \ldots).
\subsection{Producing slides with \LaTeX}
There are several packages and classes for producing slides with
\LaTeX. Our first choice is \texttt{beamer} which is
surprisingly easy to use and the results are spectacular.  \texttt{beamer} has a wide assortment of frame styles, and can produce many special effects.
\subsection{Postscript fonts}
Postscript fonts are indispensable for producing professional-looking
documents. We recommend some free (and some non-free) Postscript fonts which
are available, both for text and mathematics. We also explain how to
replace the default Computer Modern fonts with other fonts, by
using the Postscript New Fonts Selection Scheme (PSNFSS).
\subsection{\LaTeX\ and other markup languages}
The intention is to describe the package \texttt{hyperref} for producing PDF
files, as well as the connections between \LaTeX \ and MathML.
\section{How to teach \LaTeX?}
There are few reports on \LaTeX\ teaching available (see, for instance, the
paper of Nicola Talbot, in this issue of the journal for some very useful
tips) because, apart from very short introductions, \LaTeX\ courses are
rather rare.

The  author is currently giving a course for undergraduate students in
mathematics and computer science. Here are some of outcomes to date:
\begin{itemize}
\item As the main operating system in use in the university (and, more
generally, in Romania) is Windows, the natural choice for the \TeX\
distribution to use was Mik\TeX. The computer experts of the university were
kind enough to install it on all the computers we used in the classroom.
%
\item As someone pointed out, ``\LaTeX\ is not a spectator sport.''  It is
crucial for the students to use it on their own
personal computers. Therefore, we chose Pro\TeX t as the most complete and
easy to install version. Because the installation kit is rather large, we
provided CD versions for all the students.
%
\item There are, basically, two excellent \LaTeX-adapted editors for Windows:
\TeX nic Center and Winedt. We decided to use \TeX nicCenter because because it
is completely free and is included with Pro\TeX t, whereas Winedt is shareware.
We would like to mention, nevertheless, that some of the commercial
implementations of \TeX\ also have free editors which are useful. An example is
the ``PC\TeX{} Reader'', which comes with the shareware version of PCTeX (and
can be downloaded from the web page
\href{http://www.pctex.com}{http://www.pctex.com}). The free Reader version can
edit and view \TeX\ files, but you must have a licensed version in order to
typeset files and perform other functions.
%
\item We decided to use an interactive teaching method, where the students
follow along with the instructor and immediately try all new material.
%
\item As a teaching tool, we provided the PDF
version of a document and the students attempted to ``recreate'' the
\LaTeX\ source.
%
\item Besides the basic material, the rest of the subjects were strictly related
to the students' interests, as the main aim of the course is to help students
prepare their diploma theses with \LaTeX. We discussed, therefore, some
non-standard subjects such as algorithms.
%
\item Obviously, there is not enough time in the classroom to discuss everything in detail.
Therefore, detailed lecture notes were prepared and
made available, along with many examples, on a web page.  This might be expanded to provide  advanced \LaTeX\ courses as well if needed.
%
\item The outline we have been discussing is meant for a course devoted to
computer science and mathematics students. While some of the subjects,
algorithms and MathML, for instance, are specialized, a large part of the course
is general and can be taught to students of any discipline.  The syllabus
can be adapted for other course subjects as well, for instance, for physics we could include the package for drawing Feynman
diagrams, or, for chemistry packages that format chemical formulae. A
significant part of the course can be taught, as well, to students in
literature, concentrating on formatting text, poetry, plays and the like; or even to musicians, because \LaTeX\ has musical typography capabilities (see the Distractions column in
this issue).
\end{itemize}
\section{Documentation}
In spite of the wealth of \LaTeX\ books, there are few that are suitable for use
as textbooks in a classroom setting. In our opinion, aside from classical book by Leslie Lamport
(see~\cite{lamport}), the books most useful for teaching are those by George Gr\"{a}tzer
(\cite{gratzer1,gratzer2}). Among the free resources available over the
Internet, the closest to our idea of teaching \LaTeX\ is, no doubt, the book by
Peter Flynn, \textit{Beginner's \LaTeX}, available at many internet sites. This book, however, doesn't treat the ``mathematical'' part of
\LaTeX.
\section{Acknowledgments} The author would like to thank Lance Carnes for his
interests in this article and his pertinent remarks.
\begin{thebibliography}{9}
\bibitem{gratzer1}Gr\"{a}tzer, G. -- \emph{First Steps in \LaTeX},
Birkh\"{a}user, 1999
\bibitem{gratzer2}Gr\"{a}tzer, G. -- \emph{More Math into \LaTeX}, Springer,
2007
\bibitem{lamport}Lamport, L. -- \emph{\LaTeX: A Document Preparation System},
second edition, Addison-Wesley, 1994
\bibitem{talbot}Talbot, N. -- \emph{Teaching LaTeX for a staff development
course}, this issue of the Prac\TeX\ Journal
\end{thebibliography}
\end{document}
