Introduction to LaTeX NetWorkShop by Daniel Göhl.

Post on 26-Dec-2015

235 views 0 download

Transcript of Introduction to LaTeX NetWorkShop by Daniel Göhl.

Introduction to LaTeX

NetWorkShop byDaniel Göhl

Basics

• Required components

• \documentclass – tells LaTeX type of document• \begin{document} \end{document} – in between this lines the

text is written• {} – required information

article – document type• [] – optional information

12pt – text size, a4paper – paper format

\documentclass[12pt,a4paper]{article}\begin{document}

Hello World\end{document}

Compile using TeXnicCenter

Push here to compile the documentPush here to compile the document

Choose LaTeX => PDFChoose LaTeX => PDF

What happens?

• A program called pdflatex takes the document, interprets the source code and generates a PDF file.

• If references are used then pdflatex creates files to resolves these references

Packages

• Deliver more functions

• Packages– apacite – references in APA style – amsmath – Mathematical package– German

• german – old orthography rules• ngerman – new orthography rules

– Dutch• dutch – dutch language support

\usepackage{package}

Common commands• \tableofcontents – creates the table of contents

(TOC)• \section and \subsection– Creates sections and subsections – for Index– Using a * behind section disables numbering for this

section and section will not be shown in TOC– {} – Section heading– [] – Section heading in TOC

• \textbf{...} – bold text• \textsl{...} - italics

Math (amsmath package)Environments

\begin{equation}a = b

\end{equation}

\begin{equation}a = b

\end{equation}

\begin{equation*}a = b

\end{equation*}

\begin{equation*}a = b

\end{equation*}

\begin{align}a &= b \\b &= c \\c &= d \notag

\end{align}

\begin{align}a &= b \\b &= c \\c &= d \notag

\end{align}

The factor $ \rho $ describes the discount rate

The factor $ \rho $ describes the discount rate

Math (amsmath package)Operators

&2^{2} = 4 \\

&2_{a} \\

&\sum_{i=0}^{n} i \\

&\int_{0}^{\infty} a + 10 \\

&\lim_{n \rightarrow \infty} \frac{1}{x}

&2^{2} = 4 \\

&2_{a} \\

&\sum_{i=0}^{n} i \\

&\int_{0}^{\infty} a + 10 \\

&\lim_{n \rightarrow \infty} \frac{1}{x}

References math - inputTaken from last years Productivity assignment.In this task the following equation,\begin{equation}

U = \int^{\infty}_0 U(t)e^{-\rho t} \,dt\label{u}

\end{equation}was given. It models the lifetime utility $U$. From this utility function one can see that inhabitants of our model economy prefer current consumption over future consumption. The factor $\rho$ describes the discount rate which describes people's time preference. For large values of $\rho$ the term $e^{-\rho t}$ approaches zero, thus the lifetime utility will become also zero. For this reason people prefer to consume now in order to maximze their utility. \\

In equation \ref{u} it is assumed that the lifetime is infinit. This assumption is sounds rather exceptional, but by taking a close look at equation \ref{u} one can see its point.

Taken from last years Productivity assignment.In this task the following equation,\begin{equation}

U = \int^{\infty}_0 U(t)e^{-\rho t} \,dt\label{u}

\end{equation}was given. It models the lifetime utility $U$. From this utility function one can see that inhabitants of our model economy prefer current consumption over future consumption. The factor $\rho$ describes the discount rate which describes people's time preference. For large values of $\rho$ the term $e^{-\rho t}$ approaches zero, thus the lifetime utility will become also zero. For this reason people prefer to consume now in order to maximze their utility. \\

In equation \ref{u} it is assumed that the lifetime is infinit. This assumption is sounds rather exceptional, but by taking a close look at equation \ref{u} one can see its point.

References math - output

Getting references

• Use EBSCO & co to download BibTex references

• Import to JabRef@ARTICLE{Carr, author = {Carr, Peter and Linetsky, Vadim}, title = {A Jump to Default Extended CEV Model: An Application of Bessel Processes}, journal = {Finance and Stochastics}, year = {2006}, volume = {10}, pages = {p303 - 330}, number = {3}, issn = {09492984}, keywords = {Asset Pricing; Trading volume; Bond Interest Rates G120}, url = {http://dx.doi.org/10.1007/s00780-006-0012-6}}

@ARTICLE{Carr, author = {Carr, Peter and Linetsky, Vadim}, title = {A Jump to Default Extended CEV Model: An Application of Bessel Processes}, journal = {Finance and Stochastics}, year = {2006}, volume = {10}, pages = {p303 - 330}, number = {3}, issn = {09492984}, keywords = {Asset Pricing; Trading volume; Bond Interest Rates G120}, url = {http://dx.doi.org/10.1007/s00780-006-0012-6}}

JabRef – create new DB

JabRef – add Article

JabRef

JabRef – include Bibtex

References author - input

• Use JabRef to define your reference DB, be sure to have the file in the same directory as your source.

\usepackage[longnamesfirst]{natbib} \bibliographystyle{apalike}\begin{document}Bibliography Example \\Lorem ipsum dolor sit \citet{Carr} amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna \citep{Carr} aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea \bibliography{example}

\usepackage[longnamesfirst]{natbib} \bibliographystyle{apalike}\begin{document}Bibliography Example \\Lorem ipsum dolor sit \citet{Carr} amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna \citep{Carr} aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea \bibliography{example}

References author - output\citet\citet

\citep\citep

Tips and tricks

• \\ - linebreak• \pagebreak – self explaining• Include pictures– Create pngs

• Separate the file– \input{filename} – includes filename.tex

\begin{figure}\centering

\includegraphics[scale=0.5]{I:/path/to/pic/p.png}\label{fig:consumption}

\end{figure}

\begin{figure}\centering

\includegraphics[scale=0.5]{I:/path/to/pic/p.png}\label{fig:consumption}

\end{figure}

Recreate these math formulaswith references to the authors

Romer 1990 “Endogenous Technological change”Romer 1990 “Endogenous Technological change”

Mankiw, Romer, Weil 1992 “A Contribution to the Empirics of Economic Growth”Mankiw, Romer, Weil 1992 “A Contribution to the Empirics of Economic Growth”

Documentation

• Amsmath– ftp://ftp.ams.org/pub/tex/doc/amsmath/amsldoc.pdf

• LaTeX English– http://frodo.elon.edu/tutorial/tutorial.pdf

• LaTeX Deutsch – ftp://ftp.fernuni-hagen.de/pub/pdf/urz-

broschueren/broschueren/a026.pdf– ftp://ftp.fernuni-hagen.de/pub/pdf/urz-

broschueren/broschueren/a0279510.pdf

Thank you for your attention!

Visit www.ies-net.org