2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-19 11:38:05 +02:00
LaTeX-examples/tikz/array/array.tex
Martin Thoma 7740f0147f Remove trailing spaces
The commands

find . -type f -name '*.md' -exec sed --in-place 's/[[:space:]]\+$//' {} \+

and

find . -type f -name '*.tex' -exec sed --in-place 's/[[:space:]]\+$//' {} \+

were used to do so.
2015-10-14 14:25:34 +02:00

25 lines
833 B
TeX

\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart, calc}
\begin{document}
\begin{preview}
\begin{tikzpicture}[array/.style={rectangle split,rectangle split horizontal, rectangle split parts=#1,draw, anchor=center, fill=white}]
\node[array=5] (a) {
\nodepart{one}d
\nodepart{two}
\nodepart{three}c
\nodepart{four}c
\nodepart{five}b
};
\node[color=gray, anchor=north, yshift=-0.5] at (a.one) {\tiny $0$};
\node[color=gray, anchor=north, yshift=-2] at (a.two) {\tiny $1$};
\node[color=gray, anchor=north, yshift=-2] at (a.three) {\tiny $2$};
\node[color=gray, anchor=north, yshift=-2] at (a.four) {\tiny $3$};
\node[color=gray, anchor=north, yshift=-0.5] at (a.five) {\tiny $4$};
\end{tikzpicture}
\end{preview}
\end{document}