TikZ package

From Micro and Nano Mechanics Group
Jump to navigation Jump to search

PGF/Tikz is a (La)TeX macro package for generating graphics. It comes with a user-friedly syntax layer called TikZ.

Nodes and Paths

File:Ddd

Tikz node example.png

 \begin{tikzpicture}[node distance=2cm]
   \node (3) [draw,circle, fill=yellow] {};
   \node (0) at (0.2,-2) [draw,circle,fill=blue]{}; 
   \node (4) at (0,-1.8) [draw,circle,fill=red,semitransparent]{};
   \node (2) [draw,circle,fill=magenta, right of=3]{};
   \node (1) [draw,circle,fill=green, below of=2]{};
   \path[->] (0) edge (1);
   \path[->] (1) edge (2);
   \path[->] (2) edge (3);
   \path[->] (3) edge (4);
   \node (flux) at (1,-1) [] {$\Phi$};
 \end{tikzpicture}

source

Quick previews (KTikZ)

TikZ stands for "TikZ ist kein Zeichenprogramm", which literally means "TikZ is not an interactive program". That means that the TikZ is at most a programming language and not an editor or any other kind of interactive program.

That can be a serious drawback for us who are used to draw interactively. In practice we have to edit a LaTeX/TikZ file, compile and view many times to see whether the image we are programming is the one we want.

There is a small program called KTikZ that allows us to see side by side the code and the resulting image without needing to manually compile and view.

To install in Ubuntu, just click here http://www.hackenberger.at/ktikz/debian_lenny/ktikz_0.8-1_i386.deb. The program naturally requires LaTeX, TikZ to work (which are part of most Linux distributions now).

Ktikz screenshot.png