Skip to content

Instantly share code, notes, and snippets.

@sn1p3r46
Last active June 12, 2017 20:14
Show Gist options
  • Save sn1p3r46/76f88945d5b6c3a67a61641f51840c93 to your computer and use it in GitHub Desktop.
Save sn1p3r46/76f88945d5b6c3a67a61641f51840c93 to your computer and use it in GitHub Desktop.
Array with overlapping windows
% https://www.overleaf.com/9963466dzbgyfnsjpmx#/36591581/
\documentclass{article}
\usepackage{tikz}
%%%<
\usepackage{verbatim}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength{\PreviewBorder}{10pt}%
\usetikzlibrary{patterns,decorations.pathreplacing}
\usetikzlibrary{snakes}
\begin{document}
\begin{tikzpicture}[set style={{help lines}+=[dashed]}]
%\draw[style=help lines] (0,0) grid +(12,12);
\draw (1,10) grid +(1,1);
\draw (2,10) grid +(1,1);
\draw (3,10) grid +(1,1);
\draw (4,10) grid +(1,1);
\draw (5,10) grid +(1,1);
\draw (6,10) grid +(1,1);
\draw (7,10) grid +(1,1);
\draw (8,10) grid +(1,1);
\draw (9,10) grid +(1,1);
\draw (10,10) grid +(1,1);
\node at (0.5,10.5) {$W_{i}$};
\node at (1.5,10.5) {$w_{1}$};
\node at (2.5,10.5) {$w_{2}$};
\node at (3.5,10.5) {$w_{3}$};
\node at (4.5,10.5) {$w_{4}$};
\node at (7.5,10.5) {...};
\node at (10.5,10.5) {$w_{N}$};
\node at (2,11.6) {$O_{(1,W_{i})}$};
\draw [
snake=brace,
segment amplitude=5pt,
segment length=5pt
] (1,11.1) -- (3,11.1);
\node at (3,9.4) {$O_{(2,W_{i})}$};
\draw [
snake=brace,
segment amplitude=5pt,
segment length=5pt
] (4,9.9) -- (2,9.9);
\node at (10,11.6) {$O_{(N,W_{i})}$};
\draw [
snake=brace,
segment amplitude=5pt,
segment length=5pt
] (9,11.1) -- (11,11.1);
\draw (1,6) grid +(1,1);
\draw (2,6) grid +(1,1);
\draw (3,6) grid +(1,1);
\draw (4,6) grid +(1,1);
\draw (5,6) grid +(1,1);
\draw (6,6) grid +(1,1);
\draw (7,6) grid +(1,1);
\draw (8,6) grid +(1,1);
\draw (9,6) grid +(1,1);
\draw (10,6) grid +(1,1);
\node at (0.5,6.5) {$W_{i-1}$};
\node at (1.5,6.5) {$w_{1}$};
\node at (2.5,6.5) {$w_{2}$};
\node at (3.5,6.5) {$w_{3}$};
\node at (4.5,6.5) {$w_{4}$};
\node at (7.5,6.5) {...};
\node at (10.5,6.5) {$w_{N}$};
\node at (2,7.6) {$O_{(1,W_{i-1})}$};
\draw [
snake=brace,
segment amplitude=5pt,
segment length=5pt
] (1,7.1) -- (3,7.1);
\node at (3,5.4) {$O_{(2,W_{i-1})}$};
\draw [
snake=brace,
segment amplitude=5pt,
segment length=5pt
] (1,3.1) -- (3,3.1);
\node at (10,7.6) {$O_{(N,W_{i-1})}$};
\draw [
snake=brace,
segment amplitude=5pt,
segment length=5pt
] (9,7.1) -- (11,7.1);
\draw (1,2) grid +(1,1);
\draw (2,2) grid +(1,1);
\draw (3,2) grid +(1,1);
\draw (4,2) grid +(1,1);
\draw (5,2) grid +(1,1);
\draw (6,2) grid +(1,1);
\draw (7,2) grid +(1,1);
\draw (8,2) grid +(1,1);
\draw (9,2) grid +(1,1);
\draw (10,2) grid +(1,1);
\node at (0.5,2.5) {$W_{i-2}$};
\node at (1.5,2.5) {$w_{1}$};
\node at (2.5,2.5) {$w_{2}$};
\node at (3.5,2.5) {$w_{3}$};
\node at (4.5,2.5) {$w_{4}$};
\node at (7.5,2.5) {...};
\node at (10.5,2.5) {$w_{N}$};
\node at (2,3.6) {$O_{(1,W_{i-2})}$};
\draw [
snake=brace,
segment amplitude=5pt,
segment length=5pt
] (4,5.9) -- (2,5.9);
\node at (3,1.4) {$O_{(2,W_{i-2})}$};
\draw [
snake=brace,
segment amplitude=5pt,
segment length=5pt
] (4,1.9) -- (2,1.9);
\node at (10,3.6) {$O_{(N,W_{i-2})}$};
\draw [
snake=brace,
segment amplitude=5pt,
segment length=5pt
] (9,3.1) -- (11,3.1);
\end{tikzpicture}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment