tikz tutorial

Upload: mitooquerer7260

Post on 18-Oct-2015

264 views

Category:

Documents


5 download

DESCRIPTION

A sample of drawings made with Tikz (LaTeX) that includes polygons, function plots, 3D graphs, etc.The source file contains the actual LaTeX commands: check "tikz-tutorial-tex-source.pdf"

TRANSCRIPT

  • TikZ /PGF and other LATEX Tricks

    Erica Shannon

    Contents

    1 Resources 1

    2 Polygons 2

    3 Subgroup Lattices 3

    4 Coxeter graphs and Dynkin diagrams 4

    5 Tableau(x) 5

    6 Graphs of Functions 6

    7 Vector Diagrams / Root Systems 11

    8 Adding extra space in tables 14

    TikZ stands for TikZ ist kein Zeichenprogramm; PGF stands for Portable Graphics Format.

    1 Resources

    Comprehensive TikZ Manual:http://ftp.math.purdue.edu/mirrors/ctan.org/graphics/pgf/base/doc/generic/pgf/pgfmanual.

    pdf

    pgfplots Manual:http://www.bakoma-tex.com/doc/latex/pgfplots/pgfplots.pdf

    A nice tutorial for basic drawing using TikZ :http://www.math.uni-leipzig.de/~hellmund/LaTeX/pgf-tut.pdf

    List of colors available from the dvipsnames package:http://en.wikibooks.org/wiki/LaTeX/Colors

    1

  • 2 Polygons

    Here are some triangles with labels.

    pi/3

    pi/6

    11

    2

    3

    2

    pi/4

    pi/4

    1

    2

    2

    2

    2

    Here are some regular polygons, drawn using the foreach command for loops.

    n = 3 n = 4 n = 5

    n = 6 n = 7 n = 8

    The TikZ manual has examples of how to draw pretty much any type of shape or diagramyou might come up with. In particular, theres a list of cool available node shapes startingon p.435. (Forbidden sign, clouds, magnifying glass, starburst, etc.)

    2

  • 3 Subgroup Lattices

    There is supposed to be a TikZ library (graphs) for typesetting graphs. However, I found itextremely difficult to get this library to work correctly (or at all!). As a result, the exampleshere are made using the standard TikZ nodes and lines.

    S3

    (123)

    (13)(23)(13)

    {e}

    Heres a more complicated one:

    D8 = r, s

    r

    r2

    {e}

    s, r2 sr, r2

    sr2 s sr3 sr

    3

  • 4 Coxeter graphs and Dynkin diagrams

    Finite Coxeter groups can be classified by their Coxeter graphs.

    An

    4Bn

    4Cn

    Dn

    E6

    E7

    E8

    4F4

    5H3

    5H4

    mI2(m)

    If is an irreducible root system of rank `, its Dynkin diagram is one of the following (`vertices in each case):

    A`

    B`

    C`

    D`

    E6

    E7

    E8

    F4

    G2

    4

  • 5 Tableau(x)

    Heres a standard Young tableau.

    1 4 5 10 11

    2 6 8

    3 9 12

    7

    Heres a domino tableau.

    1

    2

    3

    4

    5

    6

    Both of these images use macros from Tyson Gern youll need to copy these from theheader section.

    5

  • 6 Graphs of Functions

    Heres a simple graph of the function f(x) = x x22

    + 1.

    2 1 1 2

    3

    2

    1

    1

    2

    3

    Heres a graph of a piecewise linear function, with background grid.

    2 1 1 2 3

    3

    2

    1

    1

    2

    6

  • Heres a graph of f(x) = sin(x) cos(x), with a shaded region.

    pi4

    pi2

    3pi4

    pi 5pi4

    3pi2

    1

    1f(x) = sin(x) cos(x)

    x

    y

    Heres another graph, this time with an annoyingly starred region. See p.393 of the TikZmanual for a list of patterns.

    1 2 3 4

    2

    4

    6

    8

    10

    f(x) = 6 4 sin(x)

    x

    y

    Heres a function and its tangent line. This graph has a legend.

    1 2

    ln(2)

    1

    x

    y

    f(x) = ln(x)y = x 1

    7

  • Here are some various blank axes for a student to draw a graph on.

    6 5 4 3 2 1 1 2 3 4 5 6

    4

    3

    2

    1

    1

    2

    3

    4

    x

    y

    5 4 3 2 1 1 2 3 4 5

    3

    2

    1

    1

    2

    3

    x

    y

    8

  • Here are some 3d graphs.

    2 4 6 8

    5

    0.5

    0.5

    2

    22

    2

    10

    9

  • Here is a 3d plot of a parameterized curve:

    1

    11

    1

    2

    And a parameterized torus:

    10

  • 7 Vector Diagrams / Root Systems

    Here are some 2d root systems.

    x

    y

    1 = 1 2

    2 = 2 = 1 + 2

    Type B2

    x

    y

    1 = 1 2

    2 = 22

    = 21Type C2

    x

    y

    1 =(12,32

    )=

    (sin

    (pi6

    ), cos (pi

    6

    ))

    2 =(

    0,32

    )=

    (0, cos

    (pi6

    ))

    Type I2(6)

    11

  • Here are some root systems in 3d, using tikz-3dplot.

    x

    y

    z

    1 = 1 2

    2 = 2 3 = 1 3

    s12

    Type A2

    x

    y

    z

    1 = 1 2

    2 = 2 3

    3 = 2 + 3

    = 1 + 2

    Type D3

    12

  • xy

    z

    1 = 1 2

    2 = 2 3

    3 = 3

    = 1 + 2

    Type B3

    x

    y

    z

    1 = 1 2

    2 = 2 3

    3 = 23

    = 21

    Type C3

    13

  • 8 Adding extra space in tables

    Heres a table with a little extra height added to the columns and extra padding added inthe cells:

    x 0 pi/4 pi/2 3pi/4 pi

    cos(x) 1

    2/2 0 2/2 1

    sin(x) 0

    2/2 1

    2/2 0

    14

    ResourcesPolygonsSubgroup LatticesCoxeter graphs and Dynkin diagramsTableau(x)Graphs of FunctionsVector Diagrams / Root SystemsAdding extra space in tables