[PDF] Graphics in LATEX using TikZ - Zofia Walczak





Previous PDF Next PDF



A short manual for TEXworks

TEXworks is a project to create a text editor for use with the TEX In this manual the authors tried to give an overview over TEXworks and a.



LATEX Tutorials

Online versions of this tutorials are available at: The TUGIndia Tutorial Team ... We refer to a manual˜cite{Dynatext} and a technical.



TeXworks manual

10-Aug-2009 TEXworks currently runs on Linux Mac OS X and Windows. ... manual. 2 Installation. TEXworks is only a text editor; to be able to create ...



A short manual for TEXworks

TEXworks is a project to create a text editor for use with the TEX In this manual the authors tried to give an overview over TEXworks and a.



Graphics in LATEX using TikZ - Zofia Walczak

Manual for ver. 1.09 http://sourceforge. net/projects/pgf. TUGboat



Frcatel

TEXworks can be compiled from source. A short bibliography and an index conclude this manual. 1.1 Icons and style. Because a picture is often worth a 



Tables in LaTeX: packages and methods

20-Feb-2007 package manual2 but analyzes the main options and suggests their use. This text is focused on the preparation of tables and does not ...



Tutorials

Tutorials. Using EPS Graphics in LATEX 2? Documents. Part 1: The graphics and graphicx packages. Keith Reckdahl. Abstract. This is the first of two papers 



Writing a thesis with LaTeX

Should all these tricks not be enough the user can make some manual adjust- LATEX for Everyone: A Reference Guide and Tutorial for Typeset-.



Introduzione a TEXworks

20-Mar-2011 Esistono parecchi editor multipiattaforma per L TEX ognuno con i suoi pregi e i suoi difetti. Un'ottima soluzione è il programma TEXworks

Graphics in L

ATEX using TikZ

Zoa Walczak

Faculty of Mathematics and Computer Science, University of Lodz zofiawal (at) math dot uni dot lodz dot pl

Abstract

In this paper we explain some of the basic and also more advanced features of thePGFsystem, just enough for beginners. To make our drawing easier, we use

TikZ, which is a frontend layer forPGF.

1 Introduction

In this paper we explain some of the basic and also more advanced features of thePGFsystem, just enough for beginners. To make our drawing easier, we use TikZ, which is a frontend layer forPGF. The commands and syntax of TikZ were in uenced by such sources asMETAFONT,PSTricks, and others.

For specifying points and coordinates TikZ pro-

vides a special syntax. The simplest way is to use two T

EX dimensions separated by commas in round

brackets, for example (3pt,10pt). If the unit is not specied, the default values ofPGF'sxy-coordinate system are used. This means that the unitx-vector goes 1cm to the right and the unity-vector goes

1cm upward. We can also specify a point in the po-

lar coordinate system like this: (30:1cm); this means \go 1cm in the direction of 30 degrees".

To create a picture means to draw a series of

straight or curved lines. Using TikZ we can specify paths with syntax taken from MetaPost.

2 Getting started

First we have to set up our environment. To begin

with, we set up our le as follows: \documentclass{article} \usepackage{tikz} \begin{document}

Document itself

\end{document} Then we start to create pictures. The basic build- ing block of all the pictures in TikZ is the path.

You start a path by specifying the coordinates of

the start point, as in (0;0), and then add a \path extension operation". The simplest one is just--. The operation is then followed by the next coordi- nate. Every path must end with a semicolon. For drawing the path, we use\drawcommand which is an abbreviation for\path[draw]. The\filldraw command is an abbreviation for\path[fill,draw].The rule is that all TikZ graphic drawing com- mands must occur as an argument of the\tikzcom- mand or inside a{tikzpicture}environment. The L

ATEX version of the{tikzpicture}environment is:

\begin{tikzpicture}[] \end{tikzpicture}

All options given inside the environment will

apply to the whole picture.

For example, to draw the triangle between the

points (0;0);(0;2);(2;0) we can write: \tikz\draw (0,0)--(0,2) -- (2,0)-- (0,0); or \begin{tikzpicture} \draw (0,0) -- (0,2) -- (2,0)-- (0,0); \end{tikzpicture} which produce:We can change the thickness of the line with the optionline width=, as in:\tikz\draw[line width=2mm] (0,0) -- (0,4);

For drawing circles and ellipses we can use the

circleandellipsepath construction operations.

Thecircleoperation is followed by a radius in

round brackets while theellipseoperation is fol- lowed by two, one for thex-direction and one for the y-direction, separated byandand placed in round brackets. We can also add an optionrotateor scalefor rotating or scaling ellipse. Some exam-

ples followed by the corresponding code:176TUGboat, Volume 29, No. 1|XVII European TEX Conference, 2007

Graphics in L

ATEX using TikZ

\tikz\draw[line width=2mm] (0,0) circle (4ex); \tikz\draw (0,0) ellipse (20pt and 28pt); \tikz\draw (0,0) ellipse (28pt and 20pt);\tikz\draw[rotate=45] (0,0) ellipse (16pt and 20pt); \tikz\draw[scale=1.5,rotate=75] (0,0) ellipse (10pt and 16pt);

We also have therectanglepath construction op-

eration for drawing rectangles andgrid,parabola, sin,cosandarcas well. Below are examples of using these constructions.\begin{tikzpicture} \draw[step=.25cm,gray,thick] (-1,-1) grid (1,1); \end{tikzpicture}\begin{tikzpicture} \draw (-1.5,0) -- (1.5,0); \draw (0,-1.5) -- (0,1.5); \draw (0,0) circle (.8cm); \draw (-1,-1) rectangle (1,1); \draw[gray] (-.5,-.5) parabola (1,1); \end{tikzpicture}

Thearcpath construction operation is useful

for drawing the arc for an angle. It draws the part of a circle of the given radius between the given angles. This operation must be followed by a triple in round brackets. The components are separated by colons.

The rst and second are degrees on the circle and

the third is its radius. For example, (20 : 45 : 2cm) means that it will be an arc from 20 to 45 degrees on a circle of radius 2cm.\begin{tikzpicture} \draw (-.5,0)--(1.5,0); \draw (0,-.5)--(0,1.5); \draw (1,0) arc (-25:70:1cm); \end{tikzpicture}\tikz\draw (0,0) arc (0:180:1cm); \tikz \draw[fill=gray!50] (4,0)-- +(30:1cm) arc (30:60:1cm) -- cycle; \tikz \draw[fill=gray!50] (4,0)-- +(30:2cm) arc (30:60:1cm) -- cycle;

There is a very useful command\tikzstyle

which can be used inside or outside the picture en- vironment. With it we can set up options, which will be helpful in drawing pictures. The syntax of this command is \tikzstyle