A beginner's workshop on LaTeX

download A beginner's workshop on LaTeX

of 69

Transcript of A beginner's workshop on LaTeX

  • 7/31/2019 A beginner's workshop on LaTeX

    1/69

    LATEX Workshop

    Tay Jun Jie Chang Hai Bin

    NUS Mathematics Society

    January 25, 2011

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 1 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    2/69

    Scope

    1 IntroductionName of the GameWhy LATEX?Installation

    2 Getting StartedYour first LATEX document

    Typing mathematics3 Typing the paper

    Structures in the input fileStructures in the document

    Special structures4 Support

    Log fileOnline resourcesFurther reading

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 2 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    3/69

    Name of the Game

    What is TEX?

    A computer program aimed at typesetting text and mathematicalformulae.

    Current version is 3.1415926.

    What is LATEX?

    A macro defined on TEX.

    To typeset and print an authors work at the highest typographicalquality, using a predefined, professional layout.

    Current version is LATEX 2.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 3 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    4/69

    LATEX versus Word

    Difference between LATEX and Microsoft Word?

    1 Word emphasizes visual design, LATEX emphasizes logical design.

    2 Professionally craft layouts e.g. lecture notes.3 Convenient to typeset mathematical formulae.

    4 Add-on packages to support different kinds of typographical tasks.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 4 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    5/69

    Installation

    Setting up LATE

    X.

    1 A LATEX distribution and a text editor.2 Recommended LATEX distribution:

    MiKTeX for Windows.MacTeX for Mac OS X.

    TeX Live for Linux.3 Recommended text editors:

    For Windows:

    1 TeXnicCenter

    2 WinEdt

    For Mac OS X:1 TeXShop

    For Linux:

    1 Kile

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 5 / 69

    http://miktex.org/http://www.tug.org/mactex/http://www.tug.org/texlive/http://www.texniccenter.org/http://www.winedt.com/http://www.uoregon.edu/~koch/texshop/http://kile.sourceforge.net/http://kile.sourceforge.net/http://www.uoregon.edu/~koch/texshop/http://www.winedt.com/http://www.texniccenter.org/http://www.tug.org/texlive/http://www.tug.org/mactex/http://miktex.org/
  • 7/31/2019 A beginner's workshop on LaTeX

    6/69

    Your first LATEX document

    1 Open TeXworks.

    2 Switch output profile to pdfLaTeX.

    3 Type the following:

    \documentclass{article}\begin{document}

    Hello world!

    \end{document}

    4 Create a new folder on the Desktop and save your file as myFile.tex.

    5 Compile.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 6 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    7/69

    Typing mathematics

    Type the following:\documentclass[12pt,a4paper]{article}

    \usepackage{amsmath,amsfonts}

    \begin{document}

    This is text style: $\lim_{n \to \infty}\sum_{k=1}^{n} \frac{1}{k^{2}} = \frac{\pi^{2}}{6}$.

    And this is display style:

    \begin{equation}

    \lim_{n \to \infty} \sum_{k=1}^{n} \frac{1}{k^{2}}

    = \frac{\pi^{2}}{6}\end{equation}

    \end{document}

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 7 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    8/69

    Typing mathematics

    This is text style: limnn

    k=11k2

    = 2

    6 . And this is display style:

    limn

    nk=1

    1

    k2 =2

    6 (1)

    If equation numbering is undesired, use \begin{equation*} and\end{equation*} instead.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 8 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    9/69

    Typing mathematics

    To type math, one have to enter math mode.

    $ ... $ is used for inline maths.

    \begin{equation} ... \end{equation} is one of the manydifferent environments used for displayed maths.

    \[...\] is similar to \begin{equation} ... \end{equation}

    For other math environments, refer to Short Math Guide.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 9 / 69

    ftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdfftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf
  • 7/31/2019 A beginner's workshop on LaTeX

    10/69

    Typing mathematics

    \documentclass{article}

    \usepackage{amsmath,amsfonts}

    \begin{document}

    \begin{align}\int x \cos(x) dx &= \int u dv

    \\ &= uv - \int v du

    \\ &= x \sin(x) - \int \sin(x) dx

    \\ &= x \sin(x) + \cos(x) + C

    \end{align}

    \end{document}

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 10 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    11/69

  • 7/31/2019 A beginner's workshop on LaTeX

    12/69

  • 7/31/2019 A beginner's workshop on LaTeX

    13/69

    Symbols

    Greek letters

    \alpha \theta o o \upsilon \beta \vartheta \pi \phi \gamma \iota \varpi \varphi \delta \kappa \rho \chi \epsilon \lambda \lambda \psi \varepsilon \mu \mu \omega \zeta \nu \varsigma

    \eta \xi \tau

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 13 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    14/69

    Symbols

    Binary Relations

    < < > > = = \leq or \le \geq or \ge \equiv \ll \gg

    .= \doteq

    \prec \succ \sim \preceq \succeq \simeq

    \subset \supset \approx \subseteq \supseteq = \cong \sqsubset \sqsupset \Join

    \sqsubseteq \sqsupseteq \bowtie \in \ni or \owns \propto \vdash \dashv |= \models| \mid \parallel \perp \smile \frown \asymp: : / \notin = \neq or \ne

    You can negate the following symbols by prefixing them with a \not command.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 14 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    15/69

    Symbols

    Binary Operators

    + + - \pm \pm \triangleleft \cdot \div \triangleright \times \ \setminus \star

    \cup \cap \ast \sqcup \sqcap \circ \vee or \lor \wedge or \land \bullet \oplus \ominus \diamond \odot \oslash \uplus \otimes \bigcirc \amalg \bigtriangleup \bigtriangledown \dagger \lhd \rhd \ddagger \unlhd \unrhd \wr

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 15 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    16/69

    Symbols

    BIG Operators

    \sum \bigcup \bigvee \bigoplus\prod

    \bigcap

    \bigwedge

    \bigotimes

    \coprod

    \bigsqcup

    \bigodot\int

    \oint

    \biguplus

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 16 / 69

    S b l

  • 7/31/2019 A beginner's workshop on LaTeX

    17/69

    Symbols

    Miscellaneous Symbols

    . . . \dots \cdots... \vdots

    . . . \ddots \hbar \imath \jmath \ell

    \Re

    \Im

    \aleph \wp

    \forall \exists \mho \partial \prime \emptyset \infty \nabla \triangle \Box \Diamond \bot \top \angle \surd \diamondsuit \heartsuit \clubsuit \spadesuit \neg or \lnot \flat \natural \sharp

    Refer to Short Math Guide or The Comprehensive LATEXSymbol List or DeTeXify

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 17 / 69

    F d Si

    ftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdfhttp://www.tex.ac.uk/tex-archive/info/symbols/comprehensive/symbols-a4.pdfhttp://www.tex.ac.uk/tex-archive/info/symbols/comprehensive/symbols-a4.pdfhttp://www.tex.ac.uk/tex-archive/info/symbols/comprehensive/symbols-a4.pdfhttp://www.tex.ac.uk/tex-archive/info/symbols/comprehensive/symbols-a4.pdfhttp://www.tex.ac.uk/tex-archive/info/symbols/comprehensive/symbols-a4.pdfhttp://detexify.kirelabs.org/classify.htmlhttp://detexify.kirelabs.org/classify.htmlhttp://www.tex.ac.uk/tex-archive/info/symbols/comprehensive/symbols-a4.pdfftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf
  • 7/31/2019 A beginner's workshop on LaTeX

    18/69

    Fonts and Size

    Some commonly used Fonts (when in Math Mode)$\mathnormal{x^2 -y^3}$

    x y

    $\mathbb{C,R,Q}$

    C,R,Q

    $\oint \mathbf{v} \cdot d\mathbf{r} =0$v dr = 0

    $\mathcal{H,O,C}$

    H, O, C

    etc.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 18 / 69

    F d Si (O i l)

  • 7/31/2019 A beginner's workshop on LaTeX

    19/69

    Fonts and Size (Optional)

    For Text Mode:

    Standard fonts: \textrm{This is a sentence}

    This is a sentence

    \texttt{...}: This is a sentence

    {\itshape ...}: This is a sentence

    etc.

    There are a whole range of fonts available for Text Mode.

    You may need to download add-ons or \usepackage{...} if you

    want to use some (fancy-looking) fonts.

    Look it up online if you are interested.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 19 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    20/69

    Th \t t d

  • 7/31/2019 A beginner's workshop on LaTeX

    21/69

    The \text command

    Often one is required to type text in math mode:

    a, b, c N such that a2 + b2 = c2

    The above is produced by

    $\exists a,b,c \in \mathbb{N} \quad

    \text{such that} \quad a^2+b^2=c^2$

    One can see that the text is produced by \text{}. However, what is\quad?

    The whitespace character do not create space in math mode.

    Special commands are needed.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 21 / 69

    Math spacing commands

  • 7/31/2019 A beginner's workshop on LaTeX

    22/69

    Math spacing commands

    Commands to dictate spacing in math mode.

    \, \: \; \quad \qquad \hspace{1.3cm}

    a, b, c N such that a2 + b2 = c2

    a, b, c N such that a2

    + b2

    = c2

    a, b, c N such that a2 + b2 = c2

    a, b, c N such that a2 + b2 = c2

    a, b, c N such that a2 + b2 = c2

    a, b, c N such that a2 + b2 = c2

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 22 / 69

    Matrices

  • 7/31/2019 A beginner's workshop on LaTeX

    23/69

    Matrices

    There are five environments for matrices:pmatrix bmatrix Bmatrix vmatrix Vmatrix

    a b

    c d

    a b

    c d

    a b

    c d

    a b

    c d

    a b

    c d

    For example,

    \begin{pmatrix}

    a & b\\

    c & d

    \end{pmatrix}

    a bc d

    \begin{bmatrix}

    a & b & c \ \

    d & e & f \ \h & i & j

    \end{bmatrix}

    a b cd e fh i j

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 23 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    24/69

    New commands

  • 7/31/2019 A beginner's workshop on LaTeX

    25/69

    New commands

    $( \dfrac{1}{2} )$ produces (1

    2)

    Use \left(...\right) to fit the brackets

    $\left( \dfrac{1}{2} \right)$ produces 12

    \newcommand(\abs)[1]{\left| #1 \right|}

    \abs{x} and \abs{\sum_{n=1}^\infty\limits \frac{1}{n}}

    will give |x| andn=1

    1

    n

    respectively.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 25 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    26/69

    Declare Math Operator (Optional)

  • 7/31/2019 A beginner's workshop on LaTeX

    27/69

    Declare Math Operator (Optional)

    $sin(x), \sin(x)$

    sin(x), sin(x)

    For pre-defined functions, no need to do this: \textrm{sin}

    Sometimes the desired function is not predefined, e.g. the function Span.

    \DeclareMathOperator{\Span}{Span}

    However, if you use \DeclareMathOperator*{\Span}{Span}

    \displaystyle \Span_{y \in V} now gives SpanyV

    i.e. similar effect to $\displaystyle \lim_{n \to \infty}$limn

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 27 / 69

    Typing Theorems (Optional)

  • 7/31/2019 A beginner's workshop on LaTeX

    28/69

    Typing Theorems (Optional)

    Often required to type theorems.

    Use the amsthm package.

    \begin{theorem} ... \end{theorem}.

    The theorems will be numbered automatically.

    Theorem-like environments can be created. e.g. Definitions,propositions and corollaries.

    Refer to the documentation of amsthm for more details.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 28 / 69

    Special Characters

    ftp://ftp.ams.org/pub/tex/doc/amscls/amsthdoc.pdfftp://ftp.ams.org/pub/tex/doc/amscls/amsthdoc.pdf
  • 7/31/2019 A beginner's workshop on LaTeX

    29/69

    Special Characters

    The characters

    # $ % & { } \

    are commands in LATEX. To specify them, use

    \# \$ \% \^ \& \_ \{ \} \~ $\backslash$

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 29 / 69

    Comments

  • 7/31/2019 A beginner's workshop on LaTeX

    30/69

    Comments

    Use % to make comments (the compiler will ignore anything after the %symbol)Useful when you face bugs/errors.

    this is a % hidden

    message

    this is a message

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 30 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    31/69

    The input file

  • 7/31/2019 A beginner's workshop on LaTeX

    32/69

    p

    Document classes

    article for articles in scientific journals, presentations, short reports,program documentation, invitations, . . .

    report for longer reports containing several chapters, small books,PhD theses, . . .

    book for real books.beamer for creating Presentation, like this one

    Options for document classes:

    10pt,11pt,12pt Sets the size of the main font in the document. If no

    option is specified, 10pt is assumed.a4paper,letterpaper,. . . Defines the paper size. The default is

    letterpaper. Besides that, a5paper, b5paper,executivepaper and legalpaper can be specifies.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 32 / 69

    The input file

  • 7/31/2019 A beginner's workshop on LaTeX

    33/69

    p

    Examples:

    \documentclass{article}

    \documentclass[11pt]{article}

    \documentclass[12pt,a4paper]{article}

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 33 / 69

    The input file

  • 7/31/2019 A beginner's workshop on LaTeX

    34/69

    p

    Packages

    amsmath provides various features to facilitate writing math formulasand to improve the typographical quality of their output.

    amsfonts a set of miscellaneous TEX fonts that augment the standardComputer Modern set normally distributed with TEX.

    amsthm facilitates the kind of theorem setup typically needed inAmerican Mathematical Society publications.

    graphicx support for graphics.

    geometry provides a flexible and easy interface to page dimensions.

    pstricks a set of macros that allow the inclusion of PostScriptdrawings directly inside LATEX code.

    TikZ producing vector graphics from a geometric/algebraicdescription

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 34 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    35/69

    The input file

  • 7/31/2019 A beginner's workshop on LaTeX

    36/69

    Example:

    \documentclass[a4paper,12pt]{article}

    \usepackage{amsmath,amsfonts,amsthm}

    \newcommand{\ve}{\varepsilon}

    \begin{document}...

    \end{document}

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 36 / 69

    Typing Text

  • 7/31/2019 A beginner's workshop on LaTeX

    37/69

    How to type text in LATE

    X?

    As per how it is done in Word.

    A new paragraph is specified by a blank line between the previous andcurrent paragraph.

    A new line is specified by \\.

    Vertical Spacing: \\[1.3cm]

    A new page by \newpage.

    Use two (grave accent) for opening quotation marks and two (vertical quote) for closing quotation marks. For single quotes, useone of each.

    . . . is specified by \ldots.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 37 / 69

    Titles

  • 7/31/2019 A beginner's workshop on LaTeX

    38/69

    Author information are specified by the following commands in the

    preamble:\title{}

    \author{}

    \date{}

    Example:

    \title{The Not So Short Introduction to \LaTeXe}

    \author{by Tobias Oetiker \and Hubert Partl \and

    Irene Hynaand \and Elisabeth Schlegl}

    \date{\today}

    Use \maketitle to insert the title. It is usually placed right after the\begin{document}.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 38 / 69

    Chapters, sections and subsections

    http://title.pdf/http://title.pdf/http://title.pdf/
  • 7/31/2019 A beginner's workshop on LaTeX

    39/69

    Different document classes support different levels of organization.article Sections, subsections, subsubsections.

    report Chapter and those of article.

    book Same as report.

    To declare them, use\chapter{}

    \section{}

    \subsection{}

    \subsubsection{}

    Note. There is no \subsubsubsection{}.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 39 / 69

    Chapters, sections and subsections

  • 7/31/2019 A beginner's workshop on LaTeX

    40/69

    Example:

    \chapter{Typesetting Text}

    \section{The Structure of Text and Language}\subsection{Justified Paragraphs}

    \subsection{Hyphenation}

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 40 / 69

    Table of Contents

    http://chapter.pdf/http://chapter.pdf/http://chapter.pdf/
  • 7/31/2019 A beginner's workshop on LaTeX

    41/69

    How to create a Table of Contents?

    Created by \tableofcontents.

    Usually inserted after \maketitle.

    Automatically retrieve the section names.

    Automatically retrieve the page numbers.

    Document have to be LATEXed twice.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 41 / 69

    http://toc.pdf/http://toc.pdf/
  • 7/31/2019 A beginner's workshop on LaTeX

    42/69

    Special Structures

  • 7/31/2019 A beginner's workshop on LaTeX

    43/69

    Very often, special structures are required:

    TablesGraphics

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 43 / 69

    Abstract

  • 7/31/2019 A beginner's workshop on LaTeX

    44/69

    How to type a abstract?

    \begin{abstract} ... \end{abstract}.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 44 / 69

    Lists

  • 7/31/2019 A beginner's workshop on LaTeX

    45/69

    Three type of list environments:itemize

    enumerate

    description

    Itemize and enumerate are specified in a similar manner.

    \begin{itemize}

    \item itemize

    \item enumerate

    \item description\end{itemize}

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 45 / 69

    Lists

  • 7/31/2019 A beginner's workshop on LaTeX

    46/69

    An example of description.\begin{description}

    \item[article] Sections, subsections, subsubsections.

    \item[report] Chapter and those of article.

    \item[book] Same as report.

    \end{description}

    It gives:

    article Sections, subsections, subsubsections.

    report Chapter and those of article.book Same as report.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 46 / 69

    Tables

  • 7/31/2019 A beginner's workshop on LaTeX

    47/69

    How to create tables?

    The tabular environment is used.

    LATEX determines the width of the columns automatically.

    Example:

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 47 / 69

    Tables

  • 7/31/2019 A beginner's workshop on LaTeX

    48/69

    The previous table is specified by:

    \begin{tabular}{|c|c|c|}

    \hline

    $\alpha$ & $\beta$ & $\gamma$\\\hline

    $\delta$ & $\epsilon$ & $\zeta$\\

    \hline

    \end{tabular}

    {|c|c|c|} is know as the tablespecifications.

    \hline generates a horizontalline.

    & skips to the next column.

    \\ starts a new row.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 48 / 69

    Tables(Optional)

  • 7/31/2019 A beginner's workshop on LaTeX

    49/69

    What are table specifications?

    The letters specify the alignment of text horizontally in the column.

    l for left-aligned text.c for centered text.

    r for right-aligned text.Sometimes control over column width is desired

    Use p{width}.

    | draws a vertical line.

    || draws a double line.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 49 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    50/69

    Tables

  • 7/31/2019 A beginner's workshop on LaTeX

    51/69

    You can use \array if your table includes many math symbols

    $\left(\begin{array}{ccc|c}

    1 & 2 & 3 & \ a l p h a

    \\ 4 & 5 & 6 & \beta

    \ \ 7 & 8 & 9 & \ g a m m a\end{array}

    \right)$

    1 2 3 4 5 6

    7 8 9

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 51 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    52/69

    Floats(Optional)

  • 7/31/2019 A beginner's workshop on LaTeX

    53/69

    How to create floats?

    \begin{figure}[placement specifier] ... \end{figure}

    \begin{table}[placement specifier] ... \end{table}

    Placement specifier tells LATEX where the float is allowed to be moved.

    h here, at the very place in the text where it occurred. This isuseful mainly for small floats.t at the top of a page.b at the bottom of a page.p on a special page containing only floats.

    ! without considering most of the internal parameters, whichcould stop this float from being placed.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 53 / 69

    Floats(Optional)

  • 7/31/2019 A beginner's workshop on LaTeX

    54/69

    Example:

    \begin{table}[!htbp]

    \begin{tabular}{|c|c|c|}

    \hline

    $\alpha$ & $\beta$ & $\gamma$\\

    \hline

    $\delta$ & $\epsilon$ & $\zeta$\\

    \hline

    \end{tabular}

    \caption{An example of floating tables}\end{table}

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 54 / 69

    Import Graphics

  • 7/31/2019 A beginner's workshop on LaTeX

    55/69

    Graphics support is not native to LATEX.Use the graphicx package.

    The command is \includegraphics{}.

    PDF can import JPEG, PNG, PDF and MetaPost graphic formats.

    The graphic file have to be in the same folder as the input file.

    Options to control the graphic.

    \usepackage{graphicx}...

    \includegraphics{Einstein}

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 55 / 69

    Import Graphics(Optional)

  • 7/31/2019 A beginner's workshop on LaTeX

    56/69

    The most commonly used options for \includegraphics{}.height The height of the graphics (in any of the accepted TEX units).width

    The width of the graphics (in any of the accepted TEX units).scale Scale factor for the graphic. Specifying scale=2 makes thegraphic twice as large as its natural size.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 56 / 69

    Import Graphics(Optional)

  • 7/31/2019 A beginner's workshop on LaTeX

    57/69

    Example:

    \begin{figure}[!htbp]

    \center

    \includegraphics[width=\textwidth]{Einstein}

    \caption{Example of including graphics}\end{figure}

    \includegraphics[width=\textwidth]{Einstein}

    \includegraphics[height=0.5\textheight]{Einstein}

    \includegraphics[scale=2]{Einstein}

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 57 / 69

    Creating Graphics(Optional)

    http://graphic.pdf/http://graphic.pdf/http://graphic.pdf/
  • 7/31/2019 A beginner's workshop on LaTeX

    58/69

    \usepackage[all]{xy}

    \begin{displaymath}

    \xymatrix{

    A \ar[r]^f \ar[d]_g & B \ar[d]^{g} \\

    D \ar[r]_{f} & C }

    \end{displaymath}

    Af

    //

    g

    B

    g

    Df

    // C

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 58 / 69

    Creating Graphics(Optional)

  • 7/31/2019 A beginner's workshop on LaTeX

    59/69

    r

    rrrr

    A

    B

    Ca

    b

    c

    F =

    s(s a)(s b)(s c)

    s :=a + b+ c

    2

    -

    6 = v/c = tanh

    Refer to WikiBooks for more tutorials/examples of creating graphics

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 59 / 69

    Bibliography

    http://en.wikibooks.org/wiki/LaTeX/Creating_Graphicshttp://en.wikibooks.org/wiki/LaTeX/Creating_Graphics
  • 7/31/2019 A beginner's workshop on LaTeX

    60/69

    LATEX have native support for simple bibliographies.

    \begin{thebibliography}{num} ... \end{thebibliography}.

    Each entry starts with \bibitem{marker}.

    The marker is used to cite the reference in the document.

    To cite, use \cite{marker}.

    The entries will be enumerated in automatically in the bibliography.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 60 / 69

    Bibliography

    Example:

  • 7/31/2019 A beginner's workshop on LaTeX

    61/69

    Example:

    \documentclass{article}...

    \begin{document}...

    An example of a citation~\cite{example1}....

    \begin{thebibliography}{99}

    \bibitem{example1} H.Partl: German TEX, TUGboat Volume~9

    \bibitem{example2} Jun Jie: LATEX Workshop

    \end{thebibliography}...

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 61 / 69

    Bibliography

  • 7/31/2019 A beginner's workshop on LaTeX

    62/69

    The above method is only recommended for simple bibliographies.

    For a more robust method, BibTeX is preferred.

    However, it is not recommended for absolute beginners to LATEX.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 62 / 69

    Beamer

  • 7/31/2019 A beginner's workshop on LaTeX

    63/69

    Copy-and-Paste, and compile the provided beamer file forpresentation-like output.Search online if you are interested to learn more.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 63 / 69

  • 7/31/2019 A beginner's workshop on LaTeX

    64/69

    Online resources

  • 7/31/2019 A beginner's workshop on LaTeX

    65/69

    LATEX have a wealth of online support.

    Each package comes with its on documentation.

    Numerous tutorials set up across the web.Google is your best friend.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 65 / 69

    Further reading

  • 7/31/2019 A beginner's workshop on LaTeX

    66/69

    Recommended readings:

    Short Math Guide.

    The Not So Short Introduction to LATE

    X 2

    .

    Using LATEX to Write a PhD Thesis.

    LATEX - Wikibooks.

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 66 / 69

    LATEX in the real world

    ftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdfhttp://tobi.oetiker.ch/lshort/lshort.pdfhttp://tobi.oetiker.ch/lshort/lshort.pdfhttp://tobi.oetiker.ch/lshort/lshort.pdfhttp://tobi.oetiker.ch/lshort/lshort.pdfhttp://tobi.oetiker.ch/lshort/lshort.pdfhttp://tobi.oetiker.ch/lshort/lshort.pdfhttp://theoval.cmp.uea.ac.uk/~nlct/latex/thesis/thesis_a4.pdfhttp://theoval.cmp.uea.ac.uk/~nlct/latex/thesis/thesis_a4.pdfhttp://theoval.cmp.uea.ac.uk/~nlct/latex/thesis/thesis_a4.pdfhttp://theoval.cmp.uea.ac.uk/~nlct/latex/thesis/thesis_a4.pdfhttp://theoval.cmp.uea.ac.uk/~nlct/latex/thesis/thesis_a4.pdfhttp://theoval.cmp.uea.ac.uk/~nlct/latex/thesis/thesis_a4.pdfhttp://en.wikibooks.org/wiki/LaTeXhttp://en.wikibooks.org/wiki/LaTeXhttp://en.wikibooks.org/wiki/LaTeXhttp://en.wikibooks.org/wiki/LaTeXhttp://en.wikibooks.org/wiki/LaTeXhttp://en.wikibooks.org/wiki/LaTeXhttp://en.wikibooks.org/wiki/LaTeXhttp://theoval.cmp.uea.ac.uk/~nlct/latex/thesis/thesis_a4.pdfhttp://tobi.oetiker.ch/lshort/lshort.pdfftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf
  • 7/31/2019 A beginner's workshop on LaTeX

    67/69

    Examples of latex being used to produce articles.

    U0402328 - Depth-First Search Algorithm

    U0402339 - Spanning Cycles in TournamentsU0502893 - Panoramic Image Mosaicing

    U0805124 - PC1325

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 67 / 69

    The end

    http://u0402328.pdf/http://u0402339.pdf/http://u0502893.pdf/http://pc1325%20-%20twoside.pdf/http://pc1325%20-%20twoside.pdf/http://u0502893.pdf/http://u0402339.pdf/http://u0402328.pdf/
  • 7/31/2019 A beginner's workshop on LaTeX

    68/69

    Q & A

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 68 / 69

    The end

  • 7/31/2019 A beginner's workshop on LaTeX

    69/69

    Thank You

    (NUS Mathematics Society) LATEX Workshop January 25, 2011 69 / 69