%---------------------------------------------------------------------- % % 2005_03_07_LaTeX.tex % %---------------------------------------------------------------------- % $Id: 2005_03_07_LaTeX.tex,v 1.1 2005/03/06 22:28:00 cmb Exp $ %---------------------------------------------------------------------- \documentclass[12pt]{article} %\pagestyle{empty} \usepackage{cmb2} % Hgt Off Wid Off \MarginsExact{0pt}{0pt}{0pt}{0pt} %\Afive %\BlackWhiteOffset \Helvetica \begin{document} \Toptitle{}{Introducting \LaTeX}{7/3/2005} \Pic{\textwidth}{latex_diag1.ps} \begin{verbatim} %------------------------------------------------------------ % Comments start with a % sign % % The first bit of a document sets up the % style for the rest of it... %------------------------------------------------------------ \documentclass[12pt]{article} % 12pt, article style \pagestyle{empty} % Don't put page numbers in \newcommand{\BigBold}[1]{{\large \bf #1}} %------------------------------------------------------------ \begin{document} This is where the actual text of the document goes. \BigBold{Commands} are introduced with a backslash, and curly braces for bracketing. \end{document} \end{verbatim} Key thought: worry about content over appearance! \LaTeX\ is not a word processor! Instead, \LaTeX\ encourages authors not to worry too much about the appearance of their documents, but to concentrate on getting the right content. So its a mark-up language akin, in some ways, to HTML. %---------------------------------------------------------------------- \subsection*{Document Structure} \begin{sloppypar} At the top level, documents are structured into chapters and sections (\verb+\section{Section title}+). \LaTeX will take care of numbering these if you want it to --- and you can cross-reference to section names, so adding or removing something doesn't muck up the references to section or page numbers! (This text is on page \label{this-page} \pageref{this-page}) \end{sloppypar} Things like enumerated or itemized lists, tables, diagrams, etc are usually ``bracketed'' inside an {\em environment}. For example: \begin{minipage}{0.52\textwidth} \begin{verbatim} \begin{itemize} \item {\large First} item \item This is item has some sub-parts \begin{enumerate} \item sub-part 1 \item {\bf bold} sub-part 2 \end{enumerate} \end{itemize} \end{verbatim} \end{minipage} \hfill \begin{minipage}{0.46\textwidth} \begin{itemize} \item {\large First} item \item This is item has some sub-parts \begin{enumerate} \item sub-part 1 \item {\bf bold} sub-part 2 \end{enumerate} \end{itemize} \end{minipage} %---------------------------------------------------------------------- \subsection*{Advantages} \begin{itemize} \item Source file format is text-based, so you can edit it with any editor; \item Following on from the text file format, one important implication is that you gain access to powerful version control (RCS/CVS/subversion/etc) \item Large documents are trivial --- you can sub-divide the document into multiple files, and then just \verb+\include{file.tex}+, the sub-parts. This also allows common text to be re-used. \item Style changes can affect the whole document in one go \item Since it is ``compiled'', you get easy repeatability \item With the {\tt dvi} to {\tt ps} to {\tt pdf} chain you get PDF document portability \item Nothing else will do complicated maths like it (I've never used it for this, though!) \end{itemize} %---------------------------------------------------------------------- \subsection*{Disadvantages} \begin{itemize} \item Precise page-layout is tricky \item Can't get text to flow round an image or table! \item Error handling is less than perfect!! \end{itemize} %---------------------------------------------------------------------- \subsection*{Resources} \verb+http://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/+ \verb+http://www.cs.cornell.edu/Info/Misc/LaTeX-Tutorial/LaTeX-Home.html+ \verb+http://www.latex-project.org/+ and \verb+http://www.tug.org/+ \verb+http://it.metr.ou.edu/latex/+ (See especially the ``Bundled LaTeX examples'' section) \end{document}