Created
January 18, 2022 07:43
-
-
Save zr-tex8r/b5cc0e8c3c14f7ab752b340ae47247dd to your computer and use it in GitHub Desktop.
LaTeX: Happy World Day of Snowman!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% tcspingif -e pdflatex -t 256 -i 20 --alternate | |
\documentclass{standalone} | |
\usepackage[T1]{fontenc} | |
\usepackage{lmodern} | |
\newcommand*{\cLobs}[1]{% | |
\fontfamily{Lbstr-LF}\fontsize{#1}{0}\selectfont} | |
\usepackage{xcolor} | |
\usepackage{tikz,pgfmath,scsnowman} | |
\colorlet{mybase}{green!70!blue} | |
\colorlet{mytext}{mybase!60!black} | |
\definecolor{myred}{rgb}{1.0,0.0,0.0} | |
\definecolor{myblue}{rgb}{0.0,0.0,1.0} | |
\definecolor{mybutton}{rgb}{0.1,0.6,0.2} | |
\definecolor{myarm}{rgb}{0.4,0.1,0.0} | |
\definecolor{mybroom}{rgb}{0.7,0.5,0.0} | |
\pagecolor{mybase!10} | |
\newcommand*{\cLet}{\pgfmathsetmacro} | |
\cLet{\vT}{\number\faStopTicks/\number\faAllTicks} | |
\cLet{\vSS}{11} | |
\newcommand*{\cSnowman}[1]{\makebox[0pt][l]{\scsnowman[scale=\vSS, | |
body=white, mouth=false]}% | |
\scsnowman[scale=\vSS, buttons=mybutton, arms=myarm, broom=mybroom, | |
hat=#1!75!black, muffler=#1]} | |
\begin{document} | |
\begin{tikzpicture}[x=1bp,y=1bp] | |
\useasboundingbox (-240,-135) rectangle (240,135); | |
\draw[mybase!50, line width=20bp] | |
(-240,-135) rectangle (240,135); | |
\draw[mybase!50, line width=20bp, rounded corners=36bp] | |
(-240,-135) rectangle (240,135); | |
\node[text=mytext, font={\cLobs{28}}] | |
at (0,72) {Happy World Day of Snowman!}; | |
\node[text=mytext, font={\cLobs{18}}] | |
at (0,44) {January 18th}; | |
% | |
\foreach \vN in {0,1,...,4} {% | |
\cLet{\vU}{(\vT-(0.2+0.15*\vN))/0.15} | |
\cLet{\vU}{(\vU<-1) ? (-1) : ((\vU>1) ? 1 : \vU)} | |
\cLet{\yA}{1-\vU*\vU} | |
\cLet{\vA}{(\vU<0) ? (-\vU) : \vU}\cLet{\vA}{pow(\vA,0.5)} | |
\cLet{\vA}{((\vU<0) ? (-\vA) : (\vA))*1} | |
% | |
\cLet{\xS}{80*(\vN-2)}\cLet{\yS}{-60+120*\yA} | |
\cLet{\vC}{100/4*\vN}\cLet{\vAA}{-360*mod(\vA,1)} | |
\node[rotate=\vAA] at (\xS,\yS) {\cSnowman{myblue!\vC!myred}}; | |
} | |
\end{tikzpicture} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Generate an animated GIF using tcspingif.
Result (on Twitter)