Professional Documents
Culture Documents
StefanWender
Room303S.376(3rd floorComputerSciencebuilding)
Email:s.wender@cs.auckland.ac.nz
Opendoorpolicy
COMPSCI111/111G
Lectures1115
LaTeX today(14.08.)andtomorrow(15.08.)
PowerPoint(19.08.)andPresentationDesign(21.08.)
TestRevision(22.08.)
NoLectures/Labs25th
Anintroductiontopracticalcomputing
29th
August
August
TestonFriday,29th August6:30pm 7:30pm
LATEX
1
LaTeX
Why?
Adocumentpreparationsystem
WhyuseLaTeX whenwehavewordprocessors?
Usedtotypesetadocument
Resultscanlookbetter
Focusonstructurehelpsdocumentdevelopment
Besttoolavailableformathematicallayout
Workswellforlargedocuments
Automaticallygenerates:
Tableofcontents
Listsoffigures
Listsoftables
Index
Glossaries
Bibliography
Freeandrunsonmanyplatforms
LaTeX
Compiler
http://en.wikipedia.org/wiki/LaTeX
14/08/2014
14/08/2014
Development
AsimpleLaTeXdocument
DonaldKnuth
\documentclass
StanfordUniversity
TheArtofComputerProgramming
CreatedTeXandMETAFONT
1978 1989DevelopmentofTeX
Definesthetypeofdocument
Book
Report
Article
Letter
LeslieLamport
\documentclass[a4paper]{article}
LaTeX1984
ExtensionstoTeX
EasierthanTeX
Focusonthestructureofthedocument
StandardwaytouseTeX
14/08/2014
\begin{document}
...
\end{document}
14/08/2014
Addingatitle
Exercise
Requirefourcommandstocreateatitle
WhatistheoutputofthefollowingLATEXcode?
\documentclass[a4paper]{article}
\begin{document}
\title{Exercise question}
\author{your name here}
\maketitle
A quick exercise
\end{document}
Oncetheinformationhasbeendefined,insertthetitle
\maketitle
...
\begin{document}
\title{Just a short document}
\author{Stefan Wender}
\date{2014}
\maketitle
This is the document.
\end{document}
14/08/2014
14/08/2014
Exercise
Comments
Usedtoannotatethedocument
Ignoredbythecompiler
Aimedatotherhumans
14/08/2014
14/08/2014
Commands
10
Environments
UsedtotellLaTeXhowtotypesetsomething
Applyachangetothetextwithintheenvironment
Commandsarecasesensitive
Optionalpartsareinsquarebrackets
Compulsorypartsareincurlybraces
Newenvironmentsstartnewparagraphs
\begin{environmentname}
\commandname[options]{argument}
...
\end{environmentname}
14/08/2014
11
14/08/2014
12
Specialcharacters
Structuringadocument
Charactersthatareusedinthesyntaxofthelanguage
\part{partnamegoeshere}
Can'ttypethesecharactersdirectly
Needaspecialwaytoprintthem
10characters
\chapter{chapternamegoeshere}
\ $ % ^ & _ ~ # { }
\section{sectionnamegoeshere}
\subsection{subsectionnamegoeshere}
\\doesnotprint\
$\backslash$doesprint\
\backslashbyitselfisanerr
\subsubsection{subsubsectionnamegoeshere}
specialescapecharactersforcurlybracestoo
\{for{and\}for}
\paragraph{paragraphnamegoeshere}
14/08/2014
13
14/08/2014
Tableofcontents
14
Exercise
Tableofcontentsisautomaticallygenerated
ThefollowingLATEXcodecanbeusedtogenerateatableofcontents.
Showwhatthetableofcontentswilllooklike.
Parts
Chapters
Sections
Subsections
\tableofcontents
\section[Short intro]{A short introduction to typesetting in \LaTeX}
\section[Getting started]{Writing your very first document}
\subsection[TeXnicCenter]{Starting the TeXnicCenter application}
Eachcommandhasantableofcontentsoption
Displaysadifferentnameinthetableofcontents
\section[Introduction]{An introduction
to typesetting using the LaTeX language}
14/08/2014
15
14/08/2014
16
Exercise
Footnotes
Footnotesarecreatedinthetextasyoutypethem
\footnote{ footnote text goes here }
\documentclass[a4paper]{report}
\begin{document}
\title{A very short report}
\author{Stefan Wender}
\date{2014}
\maketitle
This is the document\footnote{Note that the
document is a report} that I am using as an
example.
\end{document}
14/08/2014
17
14/08/2014
Whitespace
18
Paragraphsandlinebreaks
Whitespacecharacters
LaTeXwillremoveexcesswhitespace
Spacebar
Tab
Linebreak
Needtoexplicitlyincludeparagraphsandlinebreaks
Paragraph
Leaveablanklineintheinput
Twoormoreconsecutivewhitespacecharacters
Linebreak
Reducedtoasinglespace
Usethecommand\\
A
B
D
C
F
A short paragraph.
Another short paragraph.
And\\
some lines\\
that appear sequentially.
A B C D E F
14/08/2014
19
14/08/2014
20
Quotemarks
Ellipsis
Unidirectionalquotes(")areinadequate
Threedotsinasequence
Usethesymbols`and'forsinglequotes
Usethesymbols``and''fordoublequotes
Usedtoindicatetextthat...hasbeenremoved
Oranunfinished...
Can'tjustusethreefullstopsinarow
LaTeXwilluseincorrectspacing
Usethe\ldots command
\ldots or so he said.
He said, As they say, you win some, you lose some .
or so he said
14/08/2014
21
14/08/2014
Dashes
22
Exercise
Hyphen()
Shortdashtojoindifferentwordstogether
merrygoround
\documentclass[a4paper]{article}
\begin{document}
Endash()
Longerdashusedtoindicatearangeofvalues
pages4550
Em dash()
Verylongdashbetweenwordsorphrases
Therearemanycommandssomemorecomplexthanotherthatareusedin
LaTeX.
\end{document}
14/08/2014
23
14/08/2014
24
Exercise
Spaces
\documentclass[a4paper]{article}
\begin{document}
\title{Some short quotes}
\author{Goucho Marx}
\date{1890-1977}
\maketitle
\section{Principles}
Those are my principles, and if you don't like them\ldots
well, I have others.
Lineshavetobebrokentowraptext
Trytobreakataspace
Trytobreakatasyllable
Somespaceswedon'twanttobebroken
E.g.betweeninitialsandsurnames
Bad layout
\section{Instructions}
Quote me as saying I was mis-quoted.
Useatilde~tosignifyaspacethatwecan'tbreak
\section{Complaints}
I didn't like the play, but then I saw it under adverse
conditions --- the curtain was up.
\end{document}
14/08/2014
25
14/08/2014
Emphasis
26
References
Emphasis
TherearemanyLaTeX tutorialsontheInternet
http://www.tug.org/interest.html
http://www.latexproject.org/
http://www.ctan.org
It is \emph{very} important to
practice the typesetting commands
so that you don't \emph{forget} them.
Websitethatallowsyoutotryitout
http://sciencesoft.at/latex/?lang=en
Tutorialdocuments
The(notso)shortguidetoLaTeX
HelpwithintheTeXnicCenter application
LaTeX manual
14/08/2014
27
14/08/2014
28