Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{beamer}
- setbeamertemplate{navigation symbols}{}% to suppresses (hide) navigation symbols bar
- usepackage{tikz}
- usepackage{verbatim}
- % Three counters
- newcounter{x}
- newcounter{y}
- newcounter{z}
- % The angles of x,y,z-axes
- newcommandxaxis{210}
- newcommandyaxis{-30}
- newcommandzaxis{90}
- % The top side of a cube
- newcommandtopside[3]{
- fill[fill=yellow, draw=black,shift={(xaxis:#1)},shift={(yaxis:#2)},
- shift={(zaxis:#3)}] (0,0) -- (30:1) -- (0,1) --(150:1)--(0,0);
- }
- % The left side of a cube
- newcommandleftside[3]{
- fill[fill=green, draw=black,shift={(xaxis:#1)},shift={(yaxis:#2)},
- shift={(zaxis:#3)}] (0,0) -- (0,-1) -- (210:1) --(150:1)--(0,0);
- }
- % The right side of a cube
- newcommandrightside[3]{
- fill[fill=blue, draw=black,shift={(xaxis:#1)},shift={(yaxis:#2)},
- shift={(zaxis:#3)}] (0,0) -- (30:1) -- (-30:1) --(0,-1)--(0,0);
- }
- % The cube
- newcommandcube[3]{
- topside{#1}{#2}{#3} leftside{#1}{#2}{#3} rightside{#1}{#2}{#3}
- }
- % Definition of planepartition
- % To draw the following plane partition, just write planepartition{ {a, b, c}, {d,e} }.
- % a b c
- % d e
- newcommandplanepartition[1]{
- setcounter{x}{-1}
- foreach a in {#1} {
- addtocounter{x}{1}
- setcounter{y}{-1}
- foreach b in a {
- addtocounter{y}{1}
- setcounter{z}{-1}
- foreach c in {1,...,b} {
- addtocounter{z}{1}
- cube{value{x}}{value{y}}{value{z}}
- }
- }
- }
- }
- begin{document}
- begin{tikzpicture}
- planepartition{{2,1,2,1,2,1,2},{1,1,1,1,1,1,1},{1,1,1,1,1,1,1},{1,1,1,1,1,1,1},{2,1,2,1,2,1,2}}%1st column from back to front{row1,... from left to right}%0 is the same as 2% it does not allow void for 0
- end{tikzpicture}
- end{document}
Add Comment
Please, Sign In to add comment