Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
LaTeX: New year post card of the year 2020
\documentclass{article}
\usepackage[papersize={100mm,148mm},margin=0cm,
noheadfoot]{geometry}
\usepackage{luatexja-fontspec}
\usepackage{amsmath,tikz,graphicx,xcolor,xparse,tikzducks}
\usetikzlibrary{calc}
\newfontface{\fNotoSC}{NotoSansCherokee-Bold.ttf}
\newfontface{\fNotoS}{NotoSans-ExtraBoldItalic.ttf}
\newfontface{\fAdv}{texgyreadventor-regular.otf}
\newfontface{\fNishiki}{Nishiki-teki.ttf}
\newjfontface{\jNishiki}{Nishiki-teki.ttf}
\newfontface{\fAoyagi}{AoyagiKouzanFontT.ttf}
\newjfontface{\jAoyagi}{AoyagiKouzanFontT.ttf}
\newfontface{\fSHSans}[BoldFont=GenShinGothic-Bold.ttf]{GenShinGothic-Medium.ttf}
\newjfontface{\jSHSans}[BoldFont=GenShinGothic-Bold.ttf]{GenShinGothic-Medium.ttf}
\definecolor{mygray}{rgb}{0.3,0.3,0.3}
\definecolor{myred}{rgb}{1,0,0}
\definecolor{myblue}{rgb}{0,0.2,1}
\definecolor{mygreen}{rgb}{0,0.6,0.1}
\definecolor{mycgreen}{rgb}{0,0.45,0.05}
\NewDocumentCommand{\xZ}{}{\hspace*{0pt}}
\newcommand*{\?}[1]{%
{\fSHSans\hspace{.04em}\raisebox{.08ex}{#1}\hspace{.04em}}}
\NewDocumentEnvironment{xPar}{}{%
\par}{\par}
\NewDocumentCommand\xSize{O{0}m}{%
\fontsize{#2}{#1}\selectfont}
\begin{document}
%=================================================
\begin{xPar}\centering
\fNotoSC\xSize{30}\color{myred}
\raisebox{4pt}[18mm][0mm]{%
\scalebox{0.75}[1]{ᎤᎵᎮᎵᏍᏗ ᎢᏤ ᎠᏕᏘᏱᏍᎬ}}
\end{xPar}
%=================================================
\vspace{6mm}
%=================================================
\begin{xPar}\centering
%
\definecolor{cA}{rgb}{0.00,0.15,0.03}
\definecolor{cB}{rgb}{0.00,0.08,0.50}
\definecolor{cC}{rgb}{0.00,0.20,0.20}
\definecolor{cD}{rgb}{0.00,0.80,0.80}
\definecolor{cE}{rgb}{0.00,0.80,0.20}
\definecolor{cF}{rgb}{1.00,0.90,0.20}
\DeclareDocumentCommand\xRadi{mm}{%
\foreach \vX in {1,...,9} {%
\pgfmathsetmacro\vC{\vX*10}
\pgfmathsetmacro\vP{\vX-1.01}
\fill[fill=#1!\vC!#2](0,5)
--+(\vP*-10:8)--+(\vX*-10:8)--cycle;
}%
}
%
\begin{tikzpicture}[x=1cm,y=1cm,
scale=1.2963]
\fill[black,use as bounding box]
(-.2,-.2) rectangle (5.2,5.2);
%
%
\pgfmathsetmacro{\vR}{(sqrt(2)-1)/(sqrt(2))}
\fill[cA!90!cE]
(0,0) rectangle (5,5);
\shade[left color=cA!90!cE,right color=cB]
(2.5*\vR,0) rectangle (5,5);
%
\begin{scope}
\clip(2.5,2.5) circle[radius=2.5];
\xRadi{cC}{cD}
\end{scope}
\begin{scope}
\clip(0,0)--(0,5)--(5,5)--cycle;
\xRadi{cA}{cE}
\end{scope}
\fill[cF]
(5,1)--(3,1)--(2,1.2)--(5,1.2)--cycle;
\node[above left, text=white, font={\fAdv\xSize{36}}]
at (5,1.2) {2020};
%
%\node[transform shape] at (4.6,-.1)
% {\includegraphics[width=8.8mm]{yato.png}};
\end{tikzpicture}
\end{xPar}
%=================================================
\vspace{1mm}
\begin{xPar}\centering
\fAoyagi\jAoyagi\xSize[13]{12}%
\ltjsetparameter{kanjiskip=-.14\zw,xkanjiskip=-.08\zw}
皆様のご健康とご多幸を\\
お祈り申し上げます
\end{xPar}
\vspace{3mm}
\begin{xPar}\centering\begin{minipage}{90mm}
\begin{xPar}
\fNishiki\jNishiki\xSize{16}\color{myred}
New Year Puzzle%
\hfill
{\xSize{14}\color{myred}%
2020}%
{\xSize{9}\color{mygreen!75!black}%
\,年(令和\,}%
% digit '2'
\DeclareDocumentCommand{\ctB}{r()}{%
\fill[myred] (#1) rectangle +(0.85,0.85);
}%
\begin{tikzpicture}[x=1.8pt,y=1.8pt]
\ctB(0,5)\ctB(1,5)\ctB(2,5)
\ctB(3,4)
\ctB(2,3)
\ctB(1,2)
\ctB(0,1)
\ctB(0,0)\ctB(1,0)\ctB(2,0)\ctB(3,0)
\end{tikzpicture}%
%
{\xSize{9}\color{mygreen!75!black}%
\,年)}%
\end{xPar}
\begin{xPar}
\fNishiki\jNishiki\xSize{12}\color{myblue!75!black}%
~年賀パズル~
\end{xPar}
\par\vspace{-3.5mm}
\begin{minipage}[b]{40mm}
\setlength\leftmargini{16pt}
\setlength\leftmargin{16pt}
\fSHSans\jSHSans\xSize{9}
以下の条件に従って、乗算の虫食い算を解きなさい。
\begin{itemize}
\setlength{\itemsep}{0pt}
\item \textcolor{myred}{■}には
\textcolor{myred}{0}または\textcolor{myred}{2}が入る。
\item \textcolor{mycgreen}{□}には
\textcolor{myred}{0}と\textcolor{myred}{2}以外の数字が入る。
\end{itemize}
\par\vspace{2mm}
\end{minipage}%
\begin{minipage}[b]{50mm}\raggedleft
\DeclareDocumentCommand{\crB}{r()}{%
\node at (#1) {};
}
\DeclareDocumentCommand{\crX}{r()}{%
\node[crfill] at (#1) {};
}
%
\scalebox{0.42}{\begin{tikzpicture}[x=1mm,y=1mm,
crline/.style={draw=myblue, line width=1.8pt},
crfill/.style={draw=myred, fill=myred},
every node/.style={draw=mygreen, rectangle, line width=1.8pt,
minimum width=7.5mm, minimum height=7.5mm}]
\fill[myred!30] (45,-5) rectangle (85,5);
\crB(50,64)\crB(60,64)\crB(70,64)\crB(80,64)\crB(90,64)
\crX(50,54)\crX(60,54)\crX(70,54)\crB(80,54)\crB(90,54)
\crB(40,42)\crB(50,42)\crB(60,42)\crB(70,42)\crX(80,42)\crB(90,42)
\crB(30,32)\crB(40,32)\crB(50,32)\crB(60,32)\crX(70,32)\crB(80,32)
\crB(10,22)\crB(20,22)\crB(30,22)\crB(40,22)\crB(50,22)\crX(60,22)
\crB(00,12)\crB(10,12)\crB(20,12)\crB(30,12)\crB(40,12)\crX(50,12)
\crB(00,00)\crB(10,00)\crB(20,00)\crB(30,00)\crB(40,00)
\crX(50,00)\crX(60,00)\crX(70,00)\crX(80,00)\crB(90,00)
\draw[crline] (-7,48)--(97,48);
\draw[crline] (-7,6)--(97,6);
\draw[crline] (-2,56)--(2,52) (-2,52)--(2,56);
\end{tikzpicture}}%
\end{minipage}%
\par\vspace{-1mm}
\end{minipage}\end{xPar}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.