Upload
berenice-day
View
217
Download
0
Tags:
Embed Size (px)
Citation preview
1
LaTeX For Dummies
Mulugeta GebregziabherDivision of Biostatistics and Epidemiology
MUSC
April 4, 2011
2
What is LaTeX
• Pronounced as Lay-tek
• A typesetting program, NOT a word-processor
• Designed by Lamport based on TeX (Knuth)
• Current version LaTeX2 (LaTeX3 coming..)
• Designed for producing books, thesis,articles...
• De facto standard for writing academic papers
3
Why LaTeX?• Our profession requires it• Platform, version independent (Unix, Windows…)• Pre-set standard formats (for paper, thesis…)• Bibliography management • Fast, professional math equations typesetting• Free available• The commands are easy to learn• Never crash, never lose your file • Can compile very big books (unless your
document is more than 70,000 pages! –verify?)
4
Disadvantages
• You need other softwares for processing figures (eg. Eps, jpeg, ps, pdf)
• Spelling/grammar checking is not as convenient as those in MS Word
• Requires remembering some commands• Not straightforward for creating complex tables• Not integrated with other MS Office products
(Now, Mathtype is integrated with LaTeX in MS Word 2007)
5
Where to get LaTeX?
• Windows– MikTeX http://www.miktex.de/
– WinEdit, LaTeX editor available at DBE
– WinShell, a free LaTeX editor
• Where to get help? newsgroup comp.text.tex
• http://www-cs-faculty.stanford.edu/~uno/abcde.html#texbk
– Introduction and tips for LaTeX
6
Host sites 4 LaTeX related stuff?
• LaTeX/MiKTeX are available free of charge• The best source for these packages is the
Comprehensive TeX Archive Network (CTAN) • three host sites (and many mirrors):
1. http://ctan.tug.org/ in Boston, MA, USA,
2. http://www.tex.ac.uk/ in Cambridge, UK, and
3. http://www.dante.de/ in Mainz, Germany (in German).
7
How To Run LaTeX
• Compile latex myfile
F5 (WinShell)• View the dvi file yap myfile (Windows)
F7 (WinShell) • Dvi --> PostScript dvips myfile
F8 (WinShell)• View PostScript Use gsview (Windows)
F9 (WinShell)
8
LaTeX Skeleton
9
Example: LaTeX Skeleton% my first LaTeX file
\documentclass{article}
% preamble
\usepackage{graphicx}
\begin{document}
\section{This is a section}
\subsection{This is a subsection}
First paragraph is here.
Second paragraph is here.
\end{document}
10
Preamble Options• Intrinsic document styles: article, book, letter, report, and slides.
• Most publishers have their own style, which they provide for you to download.
• Examples of styles– AMS (amsmath) – Elsevier journals(elsarticle).
• We focus on the article style.
• Other options: font size &other preamble specifications are covered in examples
11
Now let’s learn by trying some ExampleHands on!
12
Text
13
Environment
14
Fonts
15
Lists: description,bullet,number
16
Lists: number
17
Making Simpler Tables
18
Making Multi-columnTables
19
Special Characters
20
Mathematical Operations
21
Mathematical Operations
22
Mathematical Equations
23
Math: text vs. display mode
24
Math: equation arrays
25
Math: equation arrays
26
Math: equation arrays aligned
27
Math: equation arrays aligned
28
Math: means and predicted values
29
Graphs and Pictures: scale
30
Graphs and Pictures: dimensions
31
Front Matter: Cover Page & Abstract
32
Other Front Matters
33
BibTeX--Bibliography Management• Bibliography database file mybib.bib
• Command \cite{biblabel}
• How to compile– latex myfile– bibtex myfile– latex myfile (may need to run twice)
• At the end of the document• \bibliographystyle{plain}
• \bibliography{mybib}
• You could also make your own bibliography
34
BibTek examples
35
Your own bibliography
36
How to run LaTeX (from Wang)
latex myfile
xdvi myfile (UNIX)
Edit myfile
Resolve cross-
reference
Resolve compile error
yap myfile (Windows)
myfile.tex
myfile.dvi
dvips myfile myfile.ps
37
Thank you!Happy LaTeXing
References
1. Greenberg HJ (2006). A simplified introduction to LaTex
2. Lamport L (1994). LaTeX: a document preparation system
3. LaTeX2e for Authors. CTAN 1995-99.
4. Wang’s Intro to LaTeX