Created
December 31, 2015 17:26
-
-
Save zr-tex8r/556d973c0f54565004f8 to your computer and use it in GitHub Desktop.
LaTeX: 2016 New Year's Card
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
\documentclass{article} | |
\usepackage[papersize={100mm,148mm},margin=0cm, | |
noheadfoot]{geometry} | |
\usepackage{luatexja-fontspec} | |
\newfontface{\fNishiki}{Nishiki-teki.ttf} | |
\newjfontface{\jNishiki}{Nishiki-teki.ttf} | |
\newfontface{\fAoyagi}{AoyagiKouzanFontT.ttf} | |
\newjfontface{\jAoyagi}{AoyagiKouzanFontT.ttf} | |
\newfontface{\fIpagoth}{ipaexg.ttf} | |
\newfontface{\fIpapgoth}{ipagp.ttf} | |
\newjfontface{\jIpagoth}{ipaexg.ttf} | |
\newfontface{\fAdventorB}{texgyreadventor-bold.otf} | |
\usepackage{tikz} | |
\definecolor{myblue}{rgb}{0.4,0.4,1} | |
\definecolor{mygreen}{rgb}{0,0.9,0.3} | |
\definecolor{mygray}{rgb}{0.3,0.3,0.3} | |
\definecolor{myred}{rgb}{1,0,0} | |
\definecolor{mydblue}{rgb}{0,0,1} | |
\definecolor{mydgreen}{rgb}{0,0.6,0.3} | |
\definecolor{mylcyan}{rgb}{0.8,1,1} | |
\newenvironment{mycenter}% | |
{\par\centering}{\par} | |
\newenvironment{myleft}% | |
{\par\raggedright}{\par} | |
\newcommand*{\xSizeL}[2]{\fontsize{#1}{#2}\selectfont} | |
\newcommand*{\xSize}[1]{\fontsize{#1}{#1}\selectfont} | |
\newcommand*{\xJa}[1]{\ltjalchar`#1} | |
\newsavebox{\Design} | |
\begin{document} | |
%================================================= | |
\begin{mycenter} | |
\fNishiki\xSize{32}\color{myred} | |
\raisebox{0pt}[15mm][0mm]{% | |
\scalebox{0.84}[1]{Hauʻoli Makahiki Hou}} | |
\end{mycenter} | |
\vspace{6mm} | |
%================================================= | |
\begin{lrbox}{\Design}% | |
\begin{tikzpicture}[x=1pt,y=1pt] | |
% 色 | |
\definecolor{mytop1}{rgb}{1.0,0.4,0.0} | |
\definecolor{mybot1}{rgb}{0.0,0.4,1.0} | |
\definecolor{mytop2}{rgb}{1.0,0.6,0.0} | |
\definecolor{mybot2}{rgb}{0.0,0.6,1.0} | |
% 長さ | |
\pgfmathsetmacro{\ph}{(sqrt(5)+1)/2} | |
\pgfmathsetmacro{\ep}{0.05} | |
\pgfmathsetmacro{\ee}{0.01} | |
\pgfmathsetmacro{\cw}{100} | |
\pgfmathsetmacro{\cf}{\cw/(2*\ph+1)} | |
\pgfmathsetmacro{\oa}{1*\cf} | |
\pgfmathsetmacro{\ob}{\ph*\cf} | |
\pgfmathsetmacro{\ia}{(2-\ph)*\cf} | |
\pgfmathsetmacro{\ib}{(\ph-1)*\cf} | |
\pgfmathsetmacro{\ch}{2*\ob+3*\ia+2*\ib} | |
\pgfmathsetmacro{\iw}{2*\ib+\ia} | |
\pgfmathsetmacro{\ih}{2*\ib+\oa} | |
% 数字 | |
\newcommand{\DScope}[2]{\begin{scope}[#2]\begin{scope}% | |
[fill=black, even odd rule, x=0.1pt, y=0.1pt] | |
\clip(\ee,\ee) rectangle (10-\ee,10-\ee); | |
#1\end{scope}\end{scope}} | |
\newcommand{\Two}{\DScope{% | |
\fill( 0, 0) rectangle (10,10) | |
( 0, 6) rectangle ( 2, 7) | |
( 6, 3) rectangle (10, 4);}} | |
\newcommand{\Zero}{\DScope{% | |
\fill( 0, 0) rectangle (10,10) | |
( 5, 3) rectangle (6,7);}} | |
\newcommand{\One}{\DScope{% | |
\fill( 0, 0) rectangle (10,10) | |
( 0, 3) rectangle ( 1, 7) | |
( 9, 3) rectangle (10,10);}} | |
\newcommand{\Six}{\DScope{% | |
\fill( 0, 0) rectangle (10,10) | |
( 8, 6) rectangle (10, 7) | |
( 2, 3) rectangle ( 6, 4);}} | |
% 外枠 | |
\fill[black] | |
(-5,-5) rectangle (\cw+5,\ch+5); | |
% 外領域 | |
\shade[clip,top color=mytop1, bottom color=mybot1] | |
(\ep,\ep) rectangle (\cw-\ep,\ch-\ep); | |
\Two{shift={(0,\ch-\ob)},scale=\ob} | |
\Zero{shift={(\cw-\ob,\ch-\ob)},scale=\ob} | |
\One{shift={(0,0)},scale=\ob} | |
\Six{shift={(\cw-\ob,0)},scale=\ob} | |
% 内領域 | |
\begin{scope}[shift={(\oa,\ob+2*\ia+2*\ib)},rotate=-90] | |
\shade[clip, right color=mytop2, left color=mybot2] | |
(\ep,\ep) rectangle (\iw-\ep,\ih-\ep); | |
\Two{shift={(0,\ih-\ib)},scale=\ib} | |
\Zero{shift={(\iw-\ib,\ih-\ib)},scale=\ib} | |
\One{shift={(0,0)},scale=\ib} | |
\Six{shift={(\iw-\ib,0)},scale=\ib} | |
\end{scope} | |
\end{tikzpicture}% | |
\end{lrbox} | |
% | |
\begin{mycenter} | |
\resizebox{!}{76mm}{\usebox{\Design}} | |
\end{mycenter} | |
%================================================= | |
\vspace{1mm} | |
\begin{mycenter} | |
\fAoyagi\jAoyagi\xSizeL{15}{16}% | |
\ltjsetparameter{kanjiskip=-.14\zw,xkanjiskip=-.08\zw} | |
皆様のご健康とご多幸を\\ | |
お祈り申し上げます | |
\end{mycenter} | |
\vspace{5mm} | |
\newcommand{\xQd}{\makebox[12pt]{}} | |
\begin{myleft} | |
\xQd | |
\parbox[t]{16em}{% | |
\fNishiki\jNishiki\xSize{16}\color{myred} | |
New Year Puzzle\par | |
\xSize{12}\color{mydblue}% | |
~年賀パズル~ | |
}% | |
\hfill | |
\parbox[t]{10em}{\raggedleft | |
\fNishiki\jNishiki\xSize{16}\color{myred}% | |
2016% | |
\xSize{12}\color{mydgreen}% | |
\,年\par | |
\xSize{10}\color{mydgreen}% | |
平成\,% | |
\xSize{12}\color{myred}% | |
28% | |
\xSize{10}\color{mydgreen}% | |
\,年\xSize{12}\par | |
}% | |
\xQd | |
\end{myleft} | |
\vspace{2mm}% | |
\begin{myleft} | |
\newcommand\xX{\raisebox{.2ex}{\xJa{×}}} | |
\xQd | |
\sffamily\jIpagoth\xSizeL{10}{12}% | |
\parbox[b]{18\zw}{% | |
右図の数式はそのまま計算すると結果は% | |
{\bfseries\color{mydgreen}28}% | |
になる。% | |
この数式に記号を% | |
{\color{mydgreen}2つ}% | |
追加して計算結果が% | |
{\bfseries\color{myred}2016}% | |
になるようにせよ。 | |
}% | |
\hfill | |
\parbox[b]{28mm}{\centering | |
\fAdventorB\xSize{20}\color{mydgreen}% | |
\setlength{\fboxsep}{5mm}% | |
\colorbox{mylcyan}{4~\xX~7}% | |
\par\vspace*{-3mm}% | |
}% | |
\xQd | |
\end{myleft} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment