Skip to content
Snippets Groups Projects
seasons.sty 3.6 KiB
Newer Older
  • Learn to ignore specific revisions
  • \newcounter{temperature}
    
    Malin Freeborn's avatar
    Malin Freeborn committed
    \newcounter{cycle}
    
    \setcounter{cycle}{\month}
      \roundUp{cycle}
    
    \newcounter{fenestraYear}
    \setcounter{fenestraYear}{\year}
    \multiply\value{fenestraYear}by 4
    
    Malin Freeborn's avatar
    Malin Freeborn committed
    \newcounter{fenestraDay}
    
    \newcommand\cycleDesc{}
    
    \newcommand\setCycle[2]{%
      \setcounter{cycle}{#1}% Month
    
    Malin Freeborn's avatar
    Malin Freeborn committed
      \ifnum\value{cycle}>6%
        \addtocounter{cycle}{-6}% October goes from '10' to '4'
      \fi%
      \ifnum\value{cycle}>3%
        \addtocounter{cycle}{-3}% '4' becomes 1.
      \fi%
      \multiply\value{cycle} by 2%
      \ifnum#2>15%
        \addtocounter{cycle}{-1}%
      \else%
        \addtocounter{cycle}{-2}%
      \fi%
      \setcounter{fenestraDay}{\day}%
      \ifnum\value{fenestraDay}>15%
        \addtocounter{fenestraDay}{-15}%
      \fi%
      \multiply\value{fenestraDay}by 4%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
      \addtocounter{fenestraDay}{-3}%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
      \setTemperature%
    
    }
    
    %%% State a Cycle's name.
    
    \newcommand\showCycle[1][\value{cycle}]{%
      \ifcase#1%
    
        \renewcommand\cycleDesc{\glsentrydesc{cOne}}%
      \or%
    
        \renewcommand\cycleDesc{\glsentrydesc{cTwo}}%
      \or%
    
        \renewcommand\cycleDesc{\glsentrydesc{cThree}}%
      \or%
    
        \renewcommand\cycleDesc{\glsentrydesc{cFour}}%
      \or%
    
        \renewcommand\cycleDesc{\glsentrydesc{cFive}}%
      \else
    
        \renewcommand\cycleDesc{\glsentrydesc{cSix}}%
      \fi%
    }
    
    
    \newcommand\setTemperature{
    
      \ifcase\value{cycle}%
    
        \setcounter{temperature}{1}%
      \or%
        \setcounter{temperature}{0}%
      \or%
        \setcounter{temperature}{1}%
      \or%
        \setcounter{temperature}{2}%
      \or%
    
        \setcounter{temperature}{3}%
      \else
    
        \setcounter{temperature}{2}%
    
      \fi%
    }
    
    \newcommand\showTemperature{%
      \ifcase\value{temperature}%
    
        frigid%
    
        warm%
    
      \else%
        scorching%
    
    \newcommand\showInterval[1]{%
      \ifcase#1%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
        \gls{morning}%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
        \gls{afternoon}%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
        \gls{evening}%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
        \gls{night}%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
    \newcommand\trackMonth[1][track]{%
      \ifcase\value{#1}\or%
        January\or February\or March\or April\or May\or June\or%
        July\or August\or September\or October\or November\else December\fi%
    }
    
    
    
    \newcounter{ainumarPosition}
    \newcounter{fenestraPosition}
    
    \newcommand\setPlanetPositions[2]{
      \setCycle{#1}{#2}
    
      \setcounter{ainumarPosition}{\value{cycle}}
      \addtocounter{ainumarPosition}{-1}
      \multiply\value{ainumarPosition}by 60
      \setcounter{diceNo}{#2}% get day offset
      \ifnum\value{diceNo}>15%
        \addtocounter{diceNo}{-15}%
      \fi%
      \multiply\value{diceNo}by 2%
      \addtocounter{ainumarPosition}{\value{diceNo}}
    
      \setcounter{fenestraPosition}{\value{ainumarPosition}}
      \setcounter{enc}{\value{cycle}}
      \addtocounter{enc}{-1}
      \multiply\value{enc}by 60
    
      \addtocounter{enc}{-15}% Allow room for day to move things a bit.
    
      \addtocounter{fenestraPosition}{\value{enc}}
    
      \addtocounter{fenestraPosition}{\value{diceNo}}
    
    }
    
    \newcommand\orrery[1][\month/\day]{
      \begin{tikzpicture}
        \coordinate (S) at (0,0);
        \draw[\pageSideColor] (S) circle (3.1);% Orbit
    
        \draw[\pageSideColor] (S) circle (1.1);% Orbit
    
        \foreach \m/\d in {#1}{
          \setPlanetPositions{\m}{\d}
          \coordinate (A) at (\arabic{ainumarPosition}:3);
    
          \path (A) +(\arabic{fenestraPosition}:1.2) coordinate (F);
    
          \draw[\pageSideColor] (S) -- (A) -- (F);
    
          \draw[\pageSideColor] (A) circle (1.2);% Suborbit
          \fill[\pageSideColor] (A.center)  circle (6pt);
          \fill[black] (F.north) circle (2.5pt);
          \setcounter{encnum}{\value{cycle}}
          \stepcounter{encnum}
          \coordinate [label={{\outline{\Roman{encnum} \Large\scshape\showCycle}}}] (FN) at (A);
    
        \fill[\pageSideColor] (S)  circle (25pt);
    
    Malin Freeborn's avatar
    Malin Freeborn committed
    \setCycle{\month}{\day}