Loading presentation...

Present Remotely

Send the link below via email or IM


Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.


Introduction to LateX

No description

Philipp Schlegel

on 3 June 2012

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Introduction to LateX

Introduction to 1. What is LaTeX?
2. How to install LaTeX
3. Your first LaTeX document
4. Step-by-step:
Most important features Table of contents What is LaTeX? Microsoft Word is WYSIWYG ! INPUT OUTPUT = LaTeX is NOT WYSIWYG! INPUT OUTPUT = * * What You See Is What You Get What does this mean? Text is written as source code
Format is predefined or encoded Example: compile ADVANTAGES/DISADVANTAGES PRO CONTRA free to use, runs on any platform
professional predefined layouts
handles huge documents
easy generation of various "structures"

perfect for organization of bibliographies
expandable by packages no WYSIWYG

not easy to adopt with

finding the right command can be frustrating

some features of LaTeX also implemented in the newest Microsoft Word (e.g. mathematic formulas, footnotes, table of contents, list of figures, etc.) needs some rethinking Word has its flaws too very well documented (e.g. Wikibooks) How to install LaTeX Using LaTeX requires: LaTeX compiler LaTeX editor PDF viewer 1. 2. produces ("compiles") a PDF file from the source code MiKTeX (for windows only)
Tex Live (for Unix / Linux / Windows / Mac) basically a text editor
normally part of a distribution
hands source code to the LaTeX distribution TeXnicCenter (for windows only)
TeXworks (for all platforms, included in MacTex)
TeXShop (Mac only, included in MacTeX) Your first LaTeX document General structure:
defines the "style" of the document

loads "packages" to add features
definition of documentclass
e.g. http://latex.sehnot.de/
encapsulated by: \begin{document} and \end{document}
contains text, tables, figures, etc. Basic commands I. The standard command format: II. The basic formatting commands 1. Open new document 2. Copy the code 3. Save the document use "LaTex workshop" folder! 4. 5. Compile TeXnicCenter: Ctrl + F7
TeXshop: Ctrl + T 7. View output TeXnicCenter: F5
TeXshop: automatic Result LaTeX sets text according to predefined settings
no matter how you write the plain text
use formatting commands to change style normally starts with a "\"
"\" is followed by the command
content is encapsulated by { }
case-sensitive: \large = \Large
some characters (e.g. \ % $) have special meanings Examples: \textbf{text} \small - makes text in { } bold - following text will have font size "small"
- no {} necessary The task: Need-to-know: \textbf{}
\\ -> bold
-> italic
-> changes font size
-> forces line break Environments I. Environments: used as logical structures
document, tabular, figure, enumerate
may need to state additional options
e.g. \begin{tabular}{options} The task: Hint: \begin{enumerate}
\item text
\end{enumerate} -> starts enumeration
-> starts a new number
-> ends enumeration Adding images The task: Need-to-know: \usepackage{graphicx}
\includegraphics[width = ?]{example-image.jpg} -> enables usage of images, in preamble
-> adds imagefile 2. Adding images: \includegraphics[options]{path/filename}
options may contain: width, height, angle
e.g. [width = 5cm, angle = 10]
needs loading of the package "graphicx"
Note: LaTeX doesn't like spaces in paths I. "Floating" figures: \begin{figure}[position]
possible positions -> order gives priority
h = here, t = next page,
b = page bottom, p = single page
LaTeX normally places figures where it "thinks" they fit the best
enables captions and labels 1. Packages:
add new features to LaTeX
(e.g. images, special headers, german umlauts)
defined in the preamble:
\usepackage[options]{package-name} Scientific figures \begin{figure}[htbp]
\end{figure} -> adds caption to the figure -> centers the following text
(beware the placement!) Labels: \label{label-name} Cross-referencing -> labels passages in text, figures,
tables, etc. \ref{label-name} -> returns the section/figure in
which the label is situated \pageref{label-name} -> returns the pagenumber in
which the label is situated Important note:
You may need to compile several times
before a label is "updated"!!! Tables: Formulas Providing structure I. LaTeX allows logical organization: \section{titel}
other documentclasses (e.g. books) -> additional commands: \part{}, etc. The task: reverts to normal
font size Hint: don't forget to revert to normal
font size by using \normalsize -> whatever else you want in the figure notice: image centered caption add a label to the figure use \ref and \pageref
to refer to the figure's label 6. Errors? Warnings? No? Good! \begin{tabular}{columns}
cell1 & cell2 & ... \\
\end{tabular} "&" separates columns "\\" indicates
end of the row l = left-aligned
r = right-aligned
c = centered Example: 3 columns (left aligned), 2 rows \begin{tabular}{l l l}
Column 1 & Column 2 & Column 3 \\
Column 1 & Column 2 & Column 3 \\
\end{tabular} Most of the basic commands are also
available via icons/shortcuts Looks kind of crappy! Polishing your tables:
-> \toprule
-> \midrule
-> \bottomrule
\multicolumn{number of columns}{orientation}{text} l = left-aligned
r = right-aligned
c = centered (e.g. font, font size, margins, header, etc.) Tables creates mathematical and chemical formulas

encapsulated by $

Equation editor:
MacOS: LaTeXiT
TeXniCcenter: most math commands are provided Mac version: MacTeX LaTeX
Editor LaTeX
compiler PDF LaTeX addons 3. further functions may be added: "packages"
"To every problem there is a solution" LaTeX distribution e.g. Adobe Acrobat Reader Examples easy structuring of the whole document
automatically generated table of contents customizable header and footer Figures automatic consecutive numbering compound figures automatic placement professional tables List of figures List of Abbreviations Automatically generated bibliography cite in the text
-> LaTeX adds publication
to the bibliography

different citation styles eligible

perfectly integrates with Mendeley Error Citing in LaTeX What's That? _{text} -> subscript
^{text} -> superscript Keep your code clean! Both codes produce the same results -> LaTeX doesn't care about line breaks in the code Mendeley What's ? 1 free-to-use: www.mendeley.com
all platforms 2 newly added documents are scanned -> information (author, journal, title, ...) is automatically retrieved 3 Backup of bibliography to Mendeley servers:
-> access from every computer
share papers with other Mendeley users 4 organize your library
annotations, highlights 5! 1. Right click paper
2. "Copy LaTeX Citation"
3. Paste into LaTeX document Best way: used to create citations and bibliography in LaTeX documents
part of LaTeX distributions Advantages: once setup: citations and bibliography
are automatically generated
simply insert citation key:
different citation styles available Example for a BibTeX library italic large bold underlined Preamble: Body: on Mac keyboard:
"\" shift + alt + 7
"[" alt + 5
"]" alt + 6 Citing in LaTeX \cite{citationkey} adds citation + bibliography \nocite{citationkey} adds only to bibliography \bibliographystyle{style} defines style: e.g. plain, ieee, ... Google \bibliography{database} generates bibliography Activating BibTeX TeXnicCenter \cite{Rulifson2002} \nocite{Berger2009} \bibliographystyle{plain}
\bibliography{library} TexShop 1. Typeset in "LaTeX" 2. Typeset in "BibTeX" 3. Typeset in "LaTeX" again 1. "Project" 2. "Properties" 3. Use "BibTeX" & "MakeIndex" 4. Compile 3-4x More scientifc citation style: \usepackage{natbib} new cite commands customizable cite commands (author, year, w/o braces, etc.) new bibliographystyles: plainnat
unsrtnat Polishing simple title page & table of contents right before
\begin{document} right after
\begin{document} Adding "references" to the table to contents where to add what to add see also: \addlistoffigures and \listoftables compile Note: PDF is created in the same
directory as the LaTeX file TeXnicCenter: don't use backslash
-> use slash 1. Add label to figure
2. Refer to the label Citing Creating
bibliography First things first 1. Get the USB stick
2. Copy folder "LaTeX workshop"
3. Use this folder for your
LaTeX file Thanks for your attention Further information: http://tobi.oetiker.ch/lshort/lshort.pdf
-> extensive introduction to LaTeX

-> english wikibook for LaTeX Online table-generator:
http://truben.no/latex/table/ by Philipp Schlegel TeXnicCenter: Select "LaTeX => PDF" as output TeXshop: Select "LaTeX" as output \normalsize - returns font to normal size \usepackage{apalike} new bibliographystyle:
Full transcript