Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
LATEX CourseMake Reports and Articles Using LATEX
Lars Chr. Hausmann and Henrik Uhrenfeldt
[email protected] and [email protected]
Department of Communication Technology, Aalborg University
LATEX Course – p.1/40
Agenda
- Overview of LATEX
- LATEX- TeX systems- teTeX systems
- Formatting with LATEX- Commands- Environments
- Examples and Demonstration
LATEX Course – p.2/40
Overview of LATEX
- What is LATEX
- What can it be used for?
- Why should we use it?
LATEX Course – p.3/40
What is LATEX
- latex: look in the dictionary for clothes madeof rubber
- LATEX: (pronounced latek or latech) softwarefor text formatting and type setting. It is notan editor
LATEX Course – p.4/40
What can it be used for?
LATEX is very versatile and can be used for anumber of things including:
- Large reports for your projects
- Worksheets with lots of formulas, tables andfigures
- Scientific articles with a predefined layout
- Presentations (like this)
- Letters to family, friends and others (“I needmore money!”)
LATEX Course – p.5/40
Why should we use it?
- LATEX is well tested and bug-free software fortype-setting of any kinds of documents
- Table of contents, List of figures, List oftables, references and bibliography madeeasy
- LATEX is widely used (here and abroad)
LATEX Course – p.6/40
Agenda
- Overview of LATEX
- LATEX- TeX systems- teTeX systems
- Formatting with LATEX- Commands- Environments
- Examples and Demonstration
LATEX Course – p.7/40
LATEX
- TeX system:- The history behind the TeX and LATEX- Overview and structure for LATEX- teTeX and miktex packages
LATEX Course – p.8/40
The history behind TeX and LATEX
- Donald E. Knuth’s big bibles- TeX and the basic utility programs for font
generation and more
- Leslie Lamport- LATEX: a general macro package for plain
TeX
- Others:- other more or less specialized macro
packages for plain TeX
LATEX Course – p.9/40
Overview and structure for LATEX
The structure for LATEX can be seen as this:
input
device independence
monitor paper
LATEX Course – p.10/40
Overview and structure for LATEX
The structure for LATEX can be seen as this:GNU/Emacs
latex
xdvi dvips
input
device independence
monitor paper
LATEX Course – p.11/40
Overview and structure for LATEX
The structure for LATEX can be seen as this:
working filesaux
idxtoc
lof
lot
user input (tex)
bbl,ind
TeX output (dvi)
postscript screen printer text file
Format (fmt)Class (cls,sty)Font Metrics (tfm)Font Defs (fd)
lis,log,blg
latex
LATEX Course – p.12/40
Overview and structure for LATEX
Important things to remember from the previousslide:
- The four programs: GNU/Emacs, latex, xdvi,dvips
- Log files contains important information
- aux files is included in the next latexexecution therefore can be a source forerrors
LATEX Course – p.13/40
teTeX Distribution
- Thomas Esser TeX distribution- Approximately 350 MB source code
- Available on all UNIX platforms
- What’s in the teTeX distribution:- Everything needed regarding TeX- Except editor, spell checker etc.
LATEX Course – p.14/40
MikTeX Distribution
- “teTeX” for the Windows platform. Nearlyidentical but beware!
- GNU/Emacs is also available for Windows
- http://miktex.sunsite.dk orwww.miktex.org
LATEX Course – p.15/40
TeX Software
- emacs test.tex&
- latex test.tex
- xdvi test.dvi&
- dvips -o test.ps test.dvi
LATEX Course – p.16/40
Software Overview
The following software is normally used:
Editor: GNU/Emacs
Graphics: xfig,dia,MetaPost,xv,gnuplot,matlab
PDF: ps2pdf,pdflatex,distill
Bibliography: bibtex
Utilities: makeindex,CVS,RCS,make
DVI: xdvi,dvips,dvitty
LATEX Course – p.17/40
Just to Summarize
- What files are used to make a document
- What programs are used to make adocument
LATEX Course – p.18/40
Agenda
- Overview of LATEX
- LATEX- TeX systems- teTeX systems
- Formatting with LATEX- Commands- Environments
- Examples and Demonstration
LATEX Course – p.19/40
General Command Format
- Two formats of general commands
\commandname{}\commandname
- Emphasized text
a small example \emph{example}
gives: “a small example example”
- The logo \LaTeX gives LATEX
LATEX Course – p.20/40
General Environment Format
- A general environment is formatted like
\begin{environmentname}...
\end{environmentname}
An example would be
\begin{center}text
\end{center}
LATEX Course – p.21/40
Structure of a Document
- Document Class
- Preamble
- Begin Document- Chapters, sections, body of text
- End Document
LATEX Course – p.22/40
Structure of a Document
A simple “Hello World” example:\documentclass{report}\begin{document}Hello World\end{document}
LATEX Course – p.23/40
Structure of a Document
A simple Danish “Hello World” example:\documentclass[danish]{report}\usepackage{ae,babel}\begin{document}Hello World with æøå\end{document}
LATEX Course – p.24/40
Options
- Command format once more:
\commandname[opt1,...]{arg}
- Environment format once more:
\begin{environment}[opt1,...]...
\end{environment}
LATEX Course – p.25/40
Specific Commands and Environments
The most nescesary commands andenvironments explained
- Formatting of raw text
- Lists of text
- Advanced equations
- Figures and tables
LATEX Course – p.26/40
Specific Commands and Environments
- Formatting of raw text
\textbf{bold text}\textit{italics text}\emph{emphasized text}\textsl{slanted text}\textsc{smallcaps text}
LATEX Course – p.27/40
Specific Commands and Environments
- Lists with text
\begin{itemize}\item First item\item Second item\end{itemize}\begin{enumerate}
...\end{enumerate}\begin{description}
...\end{description}
LATEX Course – p.28/40
Specific Commands and Environments
- Advanced Equations
\begin{equation}...
\end{equation}\begin{displaymath}
...\end{displaymath}
LATEX Course – p.29/40
Specific Commands and Environments
- High control over form and content enablecryptic commands and environments
\begin{equation}\[y^{2x} =\frac{x^0 - x^2 + \ldots}%{x^1 - x^3 + \ldots}\]
\end{equation}
y2x
=x
0− x
2+ . . .
x1− x3 + . . .
LATEX Course – p.30/40
Specific Commands and Environments
- Insert a floating figure
\begin{figure}[htbp]\centering\includegraphics{test.eps}\caption{Figure text example}\label{fig:test-reference}
\end{figure}
LATEX Course – p.31/40
Specific Commands and Environments
- Insert a floating table
\begin{table}[htbp]\centering\begin{tabular}{ll}x & y \\1 & 2 \\
\end{tabular}\caption{Table text example}\label{tab:test}
\end{table}
LATEX Course – p.32/40
Seeking Knowledge
- LATEX: A Document Preparation System - useit to get going
- The LATEX Companion - use it for reference
- Guides(http://kom.auc.dk/net/guides/)
- Links seehttp://kom.auc.dk/net/courses/latex/
LATEX Course – p.33/40
Agenda
- Overview of LATEX
- LATEX- TeX systems- teTeX systems
- Formatting with LATEX- Commands- Environments
- Examples and Demonstration
LATEX Course – p.34/40
Examples and Demonstration
Purpose: Give you a jump-start into theEmacs/LATEX world by example
- Borrowing from other reports
- Creating your report environment
- Utilizing the Emacs/LATEX combination- Syntax highlighting- Master system- Reftex system
- Daily report writing
LATEX Course – p.35/40
Borrowing from other reports
- Example report by Flemming Kjær Jensen
- Get it at http://kom.auc.dk/net/courses/latex
- Thing to note- Iesreport.cls: Defines layout, supplies iesreport
class
- Preamble: User-defined commands and options
- Frontmatter: All items up to the actual chapters
- The master file is the “parent” file
- Chapters are seperate files included
LATEX Course – p.36/40
Creating your report environment
- Create a latex directory
- Create a subdir for figures
- Copy master.tex, master.bib, iesreport.cls,bibliography.tex and preamble.tex to yourlatex directory
- Edit the files to suit your needs - commentout most stuff in the master
- Create a chapter file and include it in themaster
LATEX Course – p.37/40
Utlizing the Emacs/LATEX combination
- Syntax highlighting
- Keyboard shortcuts for compiling
- Master system for compiling chapters
- Reftex system for managing references
- Master and reftex is set up in your .emacs file- Additions to your .emacs file at
http://kom.auc.dk/net/courses/latex
- Get a reference card with the shortcuts
LATEX Course – p.38/40
Daily report writing
- Do make an effort to use all the helpingfeatures in your emacs - they are priceless.
- Need a new function (figure, table, etc.)- See how Flemming did it :-)
- Consult the LATEX Companion (the dog book)
- Still can’t figure it out?- Ask your fellow students on the ies.edb
- Read the LATEX guide on the KOM net pages
- Search the web - lots of smart people use LATEX
LATEX Course – p.39/40