2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-26 06:48:04 +02:00
LaTeX-examples/tikz/singly-linked-list/singly-linked-list.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

44 lines
1.3 KiB
TeX

\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}
\usepackage{tikz}
\usetikzlibrary{calc,shapes.multipart,chains,arrows}
\tikzset{
squarecross/.style={
draw, rectangle,minimum size=18pt, fill=orange!80,
inner sep=0pt, text=black,
path picture = {
\draw[black]
(path picture bounding box.north west) --
(path picture bounding box.south east)
(path picture bounding box.south west) --
(path picture bounding box.north east);
}
}
}
\begin{document}
\begin{preview}
\begin{tikzpicture}[
list/.style={
very thick, rectangle split,
rectangle split parts=2, draw,
rectangle split horizontal, minimum size=18pt,
inner sep=4pt, text=black,
rectangle split part fill={red!20, blue!20}
},
->, start chain, very thick
]
\node[list,on chain] (A) {12};
\node[list,on chain] (B) {99};
\node[list,on chain] (C) {37};
\node[squarecross] (D) [right=of C] {};
\draw[*->] let \p1 = (A.two), \p2 = (A.center) in (\x1,\y2) -- (B);
\draw[*->] let \p1 = (B.two), \p2 = (B.center) in (\x1,\y2) -- (C);
\draw[*->] let \p1 = (C.two), \p2 = (C.center) in (\x1,\y2) -- (D);
\end{tikzpicture}
\end{preview}
\end{document}