http://www.comp.leeds.ac.

uk/andyr
Learning Latex
before it´s too late!
Session 2
Andrew Roberts
andy¡0comp.]eeds.ac.uk
http://www.comp.leeds.ac.uk/andyr
Overview
1 Formatting document
2 Document structure
2 Titles
2 Lists, etc.
1 Bibliographies
2 Bibtex tool
2 Bibtex databases
2 Bibliography styles
http://www.comp.leeds.ac.uk/andyr
Formatting by example
1. Take a sample document in raw text
2. Latex-ify the basic document
3. Narkup the front matter
+. Narkup sections
5. Format lists
6. Emphasizing words
7. Footnotes
http://www.comp.leeds.ac.uk/andyr
Recap - Titles
1 \f1f]e|øø¿umøn! !¡!Iø}
1 \aufho¡|au!nør(s!}
(Use newlines (\\) to add address and email)
1 \dafe
2 \dafe|} - no date
2 \dafe|\foday} - today's date
2 \dafe|15th October 2003}
1 \makef1f]e
http://www.comp.leeds.ac.uk/andyr
Recap - Sectioning
1 Abstract environment
1 Section commands:
+
\pa¡ag¡aph|.}
5
\subpa¡ag¡aph|.}
3
\subsubsec11on|.}
2
\subsec11on|.}
1
\sec11on|.}
0
\chap1e¡|.}
-1
\pa¡1|.}
12324 567789
http://www.comp.leeds.ac.uk/andyr
Recap - Lists
1 List environments:
2 1fem1ze
2 enume¡afe
2 desc¡1pf1on
1 \1fem starts new list item
1 Can embed lists within lists.
http://www.comp.leeds.ac.uk/andyr
Recap - Others
1 \emph{.} to add emphasis to a word
or phrase.
1 \footnote{.} to add a footnote.
1 Use 123 package to give the 4123567
command.
http://www.comp.leeds.ac.uk/andyr
Bibliography Nanagement
1 Core Latex package provides bibitems.
2 Added at the end of the file.
2 Cross-referenced in document.
2 Numbering done automatically.
1 However
2 Need to be manually formatted.
2 References not portable.
http://www.comp.leeds.ac.uk/andyr
Bibtex
1 Additional component that functions
along side Latex.
1 Requires structured bibliography
database. Leads to write once, use
many approach.
1 Generates a bibliography according to
a specified 12345.
http://www.comp.leeds.ac.uk/andyr
Bibtex database format
@ref_type{uniq_key,
f1e]d1 = ¨.¨,
f1e]d2 = ¨.¨,
.
}
1 Types include: a¡f1c]e, book,
1np¡oceed1ngs, phdfhes1s, etc.
1 Fields include: aufho¡, f1f]e, yea¡,
pub]1she¡ etc. Some are required, others
are optional.
http://www.comp.leeds.ac.uk/andyr
Bibtex database format example
@article{greenwade93,
author = "George D. Greenwade",
title = "The {C}omprehensive {T}ex
{A}rchive {N}etwork ({CTAN})",
year = "1993",
]ournal = "TUGBoat",
volume = "1+",
number = "3",
pages = "3+2--351"
}
http://www.comp.leeds.ac.uk/andyr
Another Bibtex database format
example
@book{goossens93,
author = "Nichel Goossens and Frank
Nittlebach and Alexander Samarin",
title = "The Latex Companion",
year = "1993",
publisher = "Addison-Wesley",
address = "Reading, Nassachusetts"
}
NB Order of fields is not important.
http://www.comp.leeds.ac.uk/andyr
Specifying bib and style files
1 To tell Bibtex which .bib file to retrieve
\b1b]1og¡aphy{1213245}
(don´t include the file extension)
1 Select style (.bst):
\b1b]1og¡aphysfy]e{67845}
(standard ones include: p]a1n, a]pha,
abb¡v and unso¡f. Publishers often
supply their own style file.)
http://www.comp.leeds.ac.uk/andyr
Citing references
1 \cite{rey_key1, ref_key2,.} at the point you
wish the citation to appear.
http://www.comp.leeds.ac.uk/andyr
Producing output
Final run needed to resolve
forward references
Allows latex to look up the .bbl
file.
Looks up .aux file for citations,
and generates .bbl according to
style.
Produces .aux file that lists all
citations made within the
document
123456789
123456789
345 789
123456789
http://www.comp.leeds.ac.uk/andyr
Natbib
1 Numeric references are de facto standard in
Latex.
1 The Natbib package (and associated style files)
allow for named references, e.g., (Pinker,
2000).
1 Nust change the style to 12345536.
1 Author-year by default, but can add `numbers´
option to get numeric style.
http://www.comp.leeds.ac.uk/andyr
Natbib - citation commands
(Coossens, Nittlebach, and
Samarin, 1993)
\c1fep"{goossehs93}
Coossens, Nittlebach, and
Samarin (1993)
\c1fef"{goossehs93}
(Coossens et al., 1993) \c1fep{goossehs93}
Coossens et al. (1993) \c1fef{goossehs93}
Natbib output Citation command
http://www.comp.leeds.ac.uk/andyr
Naking your own styles
1 Styles definitions are quite complex for a novice.
1 Therefore, use 1234567 to generate one for
you.
1 It asks questions about your preferences.
1 Answer accordingly
1 Outputs .bst file for you to use.
1 At command-line:
827491234567

Sign up to vote on this title
UsefulNot useful