Guest User

Untitled

a guest
Jan 18th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. documentclass{beamer}
  2. setbeamertemplate{navigation symbols}{}% to suppresses (hide) navigation symbols bar
  3. usepackage{tikz}
  4. usepackage{verbatim}
  5. % Three counters
  6. newcounter{x}
  7. newcounter{y}
  8. newcounter{z}
  9. % The angles of x,y,z-axes
  10. newcommandxaxis{210}
  11. newcommandyaxis{-30}
  12. newcommandzaxis{90}
  13. % The top side of a cube
  14. newcommandtopside[3]{
  15. fill[fill=yellow, draw=black,shift={(xaxis:#1)},shift={(yaxis:#2)},
  16. shift={(zaxis:#3)}] (0,0) -- (30:1) -- (0,1) --(150:1)--(0,0);
  17. }
  18. % The left side of a cube
  19. newcommandleftside[3]{
  20. fill[fill=green, draw=black,shift={(xaxis:#1)},shift={(yaxis:#2)},
  21. shift={(zaxis:#3)}] (0,0) -- (0,-1) -- (210:1) --(150:1)--(0,0);
  22. }
  23. % The right side of a cube
  24. newcommandrightside[3]{
  25. fill[fill=blue, draw=black,shift={(xaxis:#1)},shift={(yaxis:#2)},
  26. shift={(zaxis:#3)}] (0,0) -- (30:1) -- (-30:1) --(0,-1)--(0,0);
  27. }
  28. % The cube
  29. newcommandcube[3]{
  30. topside{#1}{#2}{#3} leftside{#1}{#2}{#3} rightside{#1}{#2}{#3}
  31. }
  32. % Definition of planepartition
  33. % To draw the following plane partition, just write planepartition{ {a, b, c}, {d,e} }.
  34. % a b c
  35. % d e
  36. newcommandplanepartition[1]{
  37. setcounter{x}{-1}
  38. foreach a in {#1} {
  39. addtocounter{x}{1}
  40. setcounter{y}{-1}
  41. foreach b in a {
  42. addtocounter{y}{1}
  43. setcounter{z}{-1}
  44. foreach c in {1,...,b} {
  45. addtocounter{z}{1}
  46. cube{value{x}}{value{y}}{value{z}}
  47. }
  48. }
  49. }
  50. }
  51. begin{document}
  52. begin{tikzpicture}
  53. 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
  54. end{tikzpicture}
  55. end{document}
Add Comment
Please, Sign In to add comment