Skip to content

Instantly share code, notes, and snippets.

@zr-tex8r
Created December 27, 2022 15:28
Show Gist options
  • Select an option

  • Save zr-tex8r/0a12f6b97d8fa6f357bd508adc1e35e6 to your computer and use it in GitHub Desktop.

Select an option

Save zr-tex8r/0a12f6b97d8fa6f357bd508adc1e35e6 to your computer and use it in GitHub Desktop.
LaTeX: New year post card of the year 2023
%#!lualatex
\documentclass{article}
\usepackage[papersize={100mm,148mm},margin=0cm,
noheadfoot]{geometry}
\usepackage{luatexja-fontspec}
\usepackage{amsmath,tikz,graphicx,xcolor,xparse,pgfmath}
\ltjsetparameter{jacharrange={-2}}
\usetikzlibrary{calc,positioning}
\colorlet{k}{black}
\newcommand{\cLet}{\pgfmathsetmacro}
\newfontface{\fPlay}{Play-Bold.ttf}
\newfontface{\fMedu}{MedulaOne-Regular.ttf}
\newfontface{\fNishiki}{Nishiki-teki.ttf}
\newjfontface{\jNishiki}{Nishiki-teki.ttf}
\newfontface{\fYuji}{YujiSyuku-Regular.ttf}
\newjfontface{\jYuji}{YujiSyuku-Regular.ttf}
\newfontface{\fVLG}{VL-Gothic-Regular.ttf}
\newfontfamily{\fSHSans}{HaranoAjiGothic-Medium.otf}[
BoldFont=HaranoAjiGothic-Heavy.otf]
\newjfontfamily{\jSHSans}{HaranoAjiGothic-Medium.otf}[
BoldFont=HaranoAjiGothic-Bold.otf]
\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
\fPlay\xSize{30}\color{myred}
\raisebox{0pt}[18mm][0mm]{%
З НОВИМ РОКОМ!}
\end{xPar}
%=================================================
\vspace{6mm}
%=================================================
\begin{xPar}\centering
%
\newlength{\lU}\setlength{\lU}{0.01cm}
\cLet{\vS}{1.620375}
\definecolor{dblue} {rgb}{0.00, 0.00, 0.98}
\definecolor{dgreen}{rgb}{0.00, 0.50, 0.00}
\definecolor{lblue} {rgb}{0.00, 0.60, 0.95}
\definecolor{lgreen}{rgb}{0.00, 0.85, 0.60}
\definecolor{mred1} {rgb}{0.90, 0.00, 0.00}
\definecolor{mred3} {rgb}{1.00, 0.80, 0.00}
\colorlet{mred2}{mred1!90!mred3}
\colorlet{bblue}{dblue!60!k}
\colorlet{bgreen}{dgreen!90!k}
\colorlet{kblue}{bblue!90!k}
\definecolor{kgreen}{rgb}{0.00, 0.80, 0.00}
\cLet{\xX}{0}\cLet{\yX}{200}\cLet{\vXR}{160.08}
\cLet{\xY}{200}\cLet{\yY}{200}\cLet{\vYR}{\vXR}
\cLet{\xZ}{400}\cLet{\yZ}{200}\cLet{\vZR}{\vXR}
\cLet{\yP}{361}\cLet{\yQ}{343}\cLet{\yR}{325}
\cLet{\yS}{200}\cLet{\yT}{75}\cLet{\yU}{39}
\newcommand*{\cFill}[3]{%
\fill[#3] (0,#1) rectangle (400,#2);}
\newcommand*{\cShad}[4]{%
\shade[top color=#3, bottom color=#4] (0,#1) rectangle (400,#2);}
%
\begin{tikzpicture}[x=\lU,y=\lU,scale=\vS]
\fill[black, use as bounding box] (-16,-16) rectangle (416,416);
\node[transform shape] at (368,-8)
{\includegraphics[width=7.04mm]{yato.png}};
%
\clip (0,0) rectangle (400,400);
\cFill{400}{\yS}{bblue}
\cFill{\yS}{0} {bgreen}
%
\begin{scope}
\clip (\xY,\yY) circle [radius=\vYR];
\cShad{\yP}{\yQ}{bblue}{bblue!50!dblue}
\cShad{\yQ}{\yR}{bblue!50!dblue}{dblue}
\cShad{\yR}{\yS}{dblue}{dblue!50!dgreen}
\cShad{\yS}{\yT}{dblue!50!dgreen}{dgreen}
\cShad{\yT}{\yU}{dgreen}{bgreen}
\end{scope}
%
\begin{scope}
\clip (\xX,\yX) circle [radius=\vXR];
\cShad{\yP}{\yR}{kblue!99!kgreen}{kblue!80!kgreen}
\cShad{\yR}{\yS}{kblue!80!kgreen}{kblue!50!kgreen}
\cShad{\yS}{\yU}{kblue!50!kgreen}{kblue! 0!kgreen}
%
\clip (\xY,\yY) circle [radius=\vYR];
\cShad{\yR}{\yT}{lblue}{lgreen}
\end{scope}
%
\begin{scope}
\clip (\xZ,\yZ) circle [radius=\vZR];
\cShad{\yP}{\yR}{kblue!99!kgreen}{kblue!80!kgreen}
\cShad{\yR}{\yS}{kblue!80!kgreen}{kblue!50!kgreen}
\cShad{\yS}{\yU}{kblue!50!kgreen}{kblue! 0!kgreen}
%
\clip (\xY,\yY) circle [radius=\vYR];
\cShad{\yR}{\yS}{mred1}{mred2}
\cShad{\yS}{\yT}{mred2}{mred3}
\end{scope}
%
\node[scale=3, text=white, font={\fMedu}]
at (200,200) {2023};
\end{tikzpicture}
\end{xPar}
%=================================================
\vspace{1mm}
\begin{xPar}\centering
\fYuji\jYuji\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}%
2023}%
{\xSize{9}\color{mygreen!75!black}%
\,年(令和\,}%
{\xSize{14}\color{myred}%
5}%
{\xSize{9}\color{mygreen!75!black}%
\,年)}%
\end{xPar}
\begin{xPar}
\fNishiki\jNishiki\xSize{12}\color{myblue!75!black}%
~年賀パズル~
\end{xPar}
\par\vspace{-2mm}
\hspace*{1mm}%
{\fSHSans\jSHSans\xSize{7}
\begin{minipage}[b]{12\zw}
\setlength\leftmargini{2\zw}
\setlength\leftmargin{2\zw}
次の条件に従って掛け算の虫食い算を解きなさい。
\par\vspace{-1mm}
\begin{itemize}
\setlength{\itemsep}{-3pt}
\item 出現する数字は全部で
\textcolor{myred}{\bfseries 5}種類に限られる。
\item \textcolor{myred}{赤いマス}には
\textcolor{myred}{\bfseries 0}・
\textcolor{myred}{\bfseries 2}・
\textcolor{myred}{\bfseries 3}の何れかが入る。
\end{itemize}
\par\vspace*{1mm}
\end{minipage}}%
\begin{minipage}[b]{61mm}\raggedleft
\DeclareDocumentCommand{\crB}{r()}{%
\node[crbox] at (#1) {};
}
\DeclareDocumentCommand{\crR}{r()}{%
\node[crrex] at (#1) {};
}
%
\scalebox{0.40}{\begin{tikzpicture}[x=1mm,y=1mm,
crline/.style={draw=myblue, line width=1.8pt},
crrex/.style={draw=myred},
crbox/.style={draw=mygreen},
every node/.style={rectangle, line width=2.4pt,
minimum width=7.5mm, minimum height=7.5mm}]
%\fill[myred!20] (95,-5) rectangle (135,5);
\crB(60,64)\crB(70,64)\crB(80,64)\crB(90,64)\crR(100,64)\crB(110,64)\crB(120,64)\crB(130,64)
\crB(90,54)\crB(100,54)\crB(110,54)\crB(120,54)\crR(130,54)
\crB(50,42)\crR(60,42)\crB(70,42)\crB(80,42)\crB(90,42)\crB(100,42)\crB(110,42)\crB(120,42)\crB(130,42)
\crB(50,32)\crB(60,32)\crR(70,32)\crB(80,32)\crB(90,32)\crB(100,32)\crB(110,32)\crB(120,32)
\crB(20,22)\crB(30,22)\crB(40,22)\crR(50,22)\crB(60,22)\crB(70,22)\crB(80,22)\crB(90,22)\crB(100,22)
\crB(20,12)\crB(30,12)\crB(40,12)\crR(50,12)\crB(60,12)\crB(70,12)\crB(80,12)\crB(90,12)
\crB(10,00)\crB(20,00)\crB(30,00)\crB(40,00)\crB(50,00)\crB(60,00)\crR(70,00)\crB(80,00)
\crB(90,00)\crR(100,00)\crR(110,00)\crR(120,00)\crR(130,00)
\draw[crline] (-7,48)--(137,48);
\draw[crline] (-7,6)--(137,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