Some experiments in LaTeX that I mention in my zine, the codex.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.3 KiB

  1. \documentclass[]{article}
  2. \usepackage{tikz}
  3. \usetikzlibrary{calc}
  4. % From https://tex.stackexchange.com/questions/308849/draw-regular-pentagon-in-tikz
  5. \begin{document}
  6. \newcommand{\downpent}[2][blue!50!gray,draw=white,thick]% [options], list of direction steps e.g {10/2/1/1}
  7. {
  8. \coordinate (temp) at (0,0);
  9. \foreach \p in {#2}
  10. { \foreach \s in \p
  11. { \coordinate (temp) at ($(temp)+(\s*36-18:1)$);
  12. }
  13. \fill[#1] ($(temp)+(54:0.618)$) -- ($(temp)+(126:0.618)$) -- ($(temp)+(198:0.618)$) -- ($(temp)+(270:0.618)$) -- ($(temp)+(342:0.618)$) -- cycle;
  14. \coordinate (temp) at (0,0);
  15. }
  16. }
  17. \newcommand{\uppent}[2][blue!50!gray,draw=white,thick]% [options], list of coordinates e.g {1,2},{1,3},{4,2}
  18. {
  19. \coordinate (temp) at (0,0);
  20. \foreach \p in {#2}
  21. { \foreach \s in \p
  22. { \coordinate (temp) at ($(temp)+(\s*36-18:1)$);
  23. }
  24. \fill[#1] ($(temp)+(-54:0.618)$) -- ($(temp)+(-126:0.618)$) -- ($(temp)+(-198:0.618)$) -- ($(temp)+(-270:0.618)$) -- ($(temp)+(-342:0.618)$) -- cycle;
  25. \coordinate (temp) at (0,0);
  26. }
  27. }
  28. \begin{tikzpicture}
  29. \downpent[orange,draw=white,thick]{{2},{4},{6},{8},{10},{10,1,10}}
  30. \uppent[cyan!50!blue,draw=white,thick]{{},{10,1},{10,1,10,3},{10,1,10,1},{10,1,10,9},{10,1,10,7}}
  31. \foreach \a [count=\c] in {18,54,...,342} \draw[->,thick] (0,0) -- (\a:1cm) node[label=\a:\c] {};
  32. \end{tikzpicture}
  33. \end{document}