TikZ package: Difference between revisions

From Micro and Nano Mechanics Group
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 24: Line 24:
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.
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 those we are used to draw interactively. In practice we have to edit a LaTeX file, compile and view many times to see whether the image we are programming is the one we want.
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 [http://www.hackenberger.at/blog/ktikz-editor-for-the-tikz-language KTikZ] that allows us to see side by side the code and the resulting image without needing to manually compile and view.
There is a small program called [http://www.hackenberger.at/blog/ktikz-editor-for-the-tikz-language 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.
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).


[[Image:ktikz_screenshot.png]]
[[Image:ktikz_screenshot.png]]

= Plots =

PGFplots is a tikz library to to draw plots and display tables directly in TeX. It can be installed in different ways, including as https://launchpad.net/~johannes-reinhardt/+archive/ppa/+files/pgfplots_1.3.0-0ubuntu1_all.deb.

Latest revision as of 00:01, 1 June 2010

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

Nodes and Paths

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

Plots

PGFplots is a tikz library to to draw plots and display tables directly in TeX. It can be installed in different ways, including as https://launchpad.net/~johannes-reinhardt/+archive/ppa/+files/pgfplots_1.3.0-0ubuntu1_all.deb.