Tikz

Tikz is a language for creating vector graphics. It can be used in LaTeX by including the package tikz

\usepackage{tikz}

Tikz is a german recursive acronym "TikZ ist kein Zeichenprogramm" ("TikZ is not a drawing program"). The following file is a minimal example of tikz.

\documentclass{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}

\draw (0,0) --(0,10);

\end{tikzpicture}

\end{document}

It will give output as

When coordinates are changed the output coordinates are adjusted

\documentclass{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}

\draw (0,0) --(8,10);

\end{tikzpicture}

\end{document}

Custom shapes are also possible like

\documentclass{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}

\draw [fill = violet,text = white] (-2,0) rectangle (1,1) node[pos=.5] {{\tiny Text 1}};

\draw [fill = violet,text = white] (3,0) rectangle (5.5,1) node[pos=.5] {{\tiny Text 2}};

\draw [->,line width=0.4mm] (1,.5) -- (3,0.5);

\end{tikzpicture}

\end{document}

This will give output as

Being a programming language, it has got facilities for looping. Below given program draws line with angle increasing

\documentclass{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}

\foreach \i in {0,5,...,360}

{

\draw (0,0) --(\i:3cm);

}

\end{tikzpicture}

\end{document}

Removing steps we get

\documentclass{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}

\foreach \i in {0,...,360}

{

\draw (0,0) --(\i:3cm);

}

\end{tikzpicture}

\end{document}