Skip to content

Instantly share code, notes, and snippets.

@zr-tex8r
Created August 8, 2021 04:54
Show Gist options
  • Save zr-tex8r/6762ce992ddbd5a257e5555df437468c to your computer and use it in GitHub Desktop.
Save zr-tex8r/6762ce992ddbd5a257e5555df437468c to your computer and use it in GitHub Desktop.
Happy Snowman’s Day 2021
% tcspingif -e pdflatex -d 72 -t 96 -i 40
\documentclass[margin=0pt]{standalone}
\usepackage{xcolor,graphicx,tikz,pgfmath,scsnowman}
\usepackage[T1]{fontenc}
\usepackage{lmodern,pifont}
\newcommand*{\fMsg}{\fontfamily{iwonac}\bfseries\itshape}
\newcommand*{\fYear}{\fontfamily{iwonac}\bfseries\scshape}
\newcommand*{\cSize}[1]{\fontsize{#1}{0}\selectfont}
\newcommand*{\cZ}{\hspace{1em}}
\newcommand*{\cLet}{\pgfmathsetmacro}
\cLet{\vT}{\number\faStopTicks/\number\faAllTicks}
\cLet{\vPhase}{floor(\vT*2)}\cLet{\vPT}{frac(\vT*2)}
\cLet{\vA}{((\vPhase==0) ? -360 : 360) * frac(\vPT*2)}
\cLet{\vX}{(\vPhase==0) ? (\vPT*2-1) : (1-2*\vPT)}
\cLet{\vZ}{4*\vPT*(1-\vPT)}
\cLet{\wyS}{-1}\cLet{\wzC}{-4}
\colorlet{mygreen}{green!50!black}
\newcommand*{\vToCanvas}{%
\cLet{\vCS}{-\wzC/(\wzS-\wzC)}%
\cLet{\cxS}{\wxS*\vCS}\cLet{\cyS}{\wyS*\vCS}}
\newcommand*{\cPutSnowman}[4]{%
\cLet{\wxS}{#2}\cLet{\wzS}{#3}\vToCanvas
\cLet{\vSS}{32*\vCS}%
\typeout{\cxS/\cyS}%
\node[rotate=#1] at (\cxS*200+300,\cyS*200+500) {\scsnowman
[scale=\vSS,body=white,snow=white,mouth=false]};
\node[rotate=#1] at (\cxS*200+300,\cyS*200+500) {\scsnowman
[scale=\vSS,#4]};}
\colorlet{bgcolor}{blue!30!green!6}
\colorlet{bgcolorx}{blue!30!green!70}
\colorlet{myblue}{blue!80!green!75!black}
\colorlet{mygreen}{blue!50!green}
\colorlet{mysnow}{blue!80!green!40}
\pagecolor{bgcolor}
\begin{document}
\begin{tikzpicture}[x=1bp,y=1bp]
\useasboundingbox (0,0) rectangle (600,600);
\draw[mysnow, line width=30] (0,0) rectangle (600,600);
\node[text=mysnow, font={\cSize{56}}]
at (300,340) {\ding{100}};
\node[text=myblue, font={\fMsg\cSize{56}}]
at (300,500) {Happy Snowman's Day};
\node[text=mygreen, font={\fYear\cSize{80}}]
at (300,135) {2\cZ0\cZ2\cZ1};
\cPutSnowman{\vA}{0.8*\vX}{1-2*\vZ}{%
hat=myblue, muffler=mygreen,
arms=green!30!black!50, snow=mysnow}
\cPutSnowman{-\vA}{-0.8*\vX}{1-2.5*\vZ}{%
hat=mygreen, muffler=myblue,
arms=green!30!black!50, snow=mysnow}
\end{tikzpicture}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment