introduction to latex networkshop by daniel göhl

21
Introduction to LaTeX NetWorkShop by Daniel Göhl

Upload: douglas-harmon

Post on 26-Dec-2015

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to LaTeX NetWorkShop by Daniel Göhl

Introduction to LaTeX

NetWorkShop byDaniel Göhl

Page 2: Introduction to LaTeX NetWorkShop by Daniel 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}

Page 3: Introduction to LaTeX NetWorkShop by Daniel Göhl

Compile using TeXnicCenter

Push here to compile the documentPush here to compile the document

Choose LaTeX => PDFChoose LaTeX => PDF

Page 4: Introduction to LaTeX NetWorkShop by Daniel Göhl

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

Page 5: Introduction to LaTeX NetWorkShop by Daniel Göhl

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}

Page 6: Introduction to LaTeX NetWorkShop by Daniel Göhl

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

Page 7: Introduction to LaTeX NetWorkShop by Daniel Göhl

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

Page 8: Introduction to LaTeX NetWorkShop by Daniel Göhl

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}

Page 9: Introduction to LaTeX NetWorkShop by Daniel Göhl

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.

Page 10: Introduction to LaTeX NetWorkShop by Daniel Göhl

References math - output

Page 11: Introduction to LaTeX NetWorkShop by Daniel Göhl

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}}

Page 12: Introduction to LaTeX NetWorkShop by Daniel Göhl

JabRef – create new DB

Page 13: Introduction to LaTeX NetWorkShop by Daniel Göhl

JabRef – add Article

Page 14: Introduction to LaTeX NetWorkShop by Daniel Göhl

JabRef

Page 15: Introduction to LaTeX NetWorkShop by Daniel Göhl

JabRef – include Bibtex

Page 16: Introduction to LaTeX NetWorkShop by Daniel Göhl

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}

Page 17: Introduction to LaTeX NetWorkShop by Daniel Göhl

References author - output\citet\citet

\citep\citep

Page 18: Introduction to LaTeX NetWorkShop by Daniel Göhl

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}

Page 19: Introduction to LaTeX NetWorkShop by Daniel Göhl

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”

Page 20: Introduction to LaTeX NetWorkShop by Daniel Göhl

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

Page 21: Introduction to LaTeX NetWorkShop by Daniel Göhl

Thank you for your attention!

Visit www.ies-net.org