Created
December 31, 2012 15:16
-
-
Save zr-tex8r/4420604 to your computer and use it in GitHub Desktop.
LaTeX: New Year Card 2013
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} | |
\newfontfamily{\fPagella}{TeX Gyre Pagella} | |
\newfontfamily{\fHeros}{TeX Gyre Heros} | |
\newfontface{\fNalnia}{nalnia.ttf} % nalnia | |
% http://www9.atwiki.jp/hrain/m/pages/79.html | |
\newfontface{\fComfortaa}{Comfortaa-Bold.ttf} % Comfortaa | |
\newfontface{\fAoyagi}{AoyagiKouzanFontT.ttf} % 青柳衡山フォントT | |
\newjfontface{\jAoyagi}{AoyagiKouzanFontT.ttf} % 青柳衡山フォントT | |
\newfontface{\fIpagoth}{ipaexg.ttf} % IPAexゴシック | |
\newjfontface{\jIpagoth}{ipaexg.ttf} % IPAexゴシック | |
\newjfontface{\jHui}{HuiFont29.ttf} % ふい字 | |
% http://hp.vector.co.jp/authors/VA039499/ | |
\usepackage{graphicx,xcolor,pict2e} | |
\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.4,0.1} | |
\definecolor{myyellow}{rgb}{0.8,0.7,0.3} | |
\newsavebox{\ARE} | |
\usepackage{tikz} | |
\usepackage{bxluaembed} | |
\newenvironment{mycenter}% | |
{\par\centering}{\par} | |
\newenvironment{myleft}% | |
{\par\raggedright}{\par} | |
\newcommand*{\xZ}{\hspace{0pt}} | |
\newcommand*{\xSizeL}[2]{\fontsize{#1}{#2}\selectfont} | |
\newcommand*{\xSize}[1]{\fontsize{#1}{#1}\selectfont} | |
\begin{document} | |
%================================================= | |
\begin{mycenter} | |
\fNalnia\xSize{42}\color{myred} | |
\raisebox{0pt}[18mm][0mm]{% | |
\scalebox{1.4}[1]{limelka}} | |
\end{mycenter} | |
\vspace{6mm} | |
%================================================= | |
\begin{mycenter} | |
\newcommand{\yearFont}{% | |
\fPagella\bfseries\xSize{28}% | |
} | |
\newcommand{\xT}{\hspace{.08em}} | |
\begin{luaembed} | |
<?local sx, sy, fw = 100, 100, 5 | |
local bcx, bcy, br = 70, 75, 15 | |
local hzy, my = 30, 50 | |
local dw, maxk, lr = 0.5, 98, 0.5 | |
local function ic(k, r) | |
local c = math.pi / 2 | |
return 100 - math.ceil(math.atan(k * r * c) / c * 100) | |
end | |
local function ly(k) | |
local w = dw * k | |
return hzy * w / (w + 1) | |
end | |
local lly = ly(maxk) | |
local px0, px1, pks, pke, pr = 60, 30, 1, 5, 0.2 | |
local function px(k) | |
return ly(k) / hzy * (px1 - px0) + px0 | |
end ?> | |
\begin{tikzpicture} | |
[x=0.7mm,y=0.7mm] | |
<?for k = maxk, 1, -1 do ?> | |
\fill[mygreen!<?=ic(k,lr)?>!mygray] | |
(0,0) rectangle (<?=sx?>,<?=ly(k)?>); | |
<?end ?> | |
\shade[shading=axis, | |
bottom color=mygray,top color=mygray!50!myblue] | |
(0,<?=lly?>) rectangle (<?=sx?>,<?=my?>); | |
\shade[shading=axis, | |
bottom color=mygray!50!myblue,top color=myblue] | |
(0,<?=my?>) rectangle (<?=sx?>,<?=sy?>); | |
\shade[ball color=myred!60!white] | |
(<?=bcx?>,<?=bcy?>) circle [radius=<?=br?>]; | |
<?for k = pks, pke - 1 do ?> | |
\fill[myyellow!50!white!<?=ic(k,pr)?>!mygray] | |
(<?=sx?>,<?=ly(k)?>)--(<?=px(k)?>,<?=ly(k)?>)-- | |
(<?=px(k+1)?>,<?=ly(k+1)?>)--(<?=sx?>,<?=ly(k+1)?>)--cycle; | |
<?end?> | |
<?do | |
local x1, x2 = bcx - br, bcx + br ?> | |
\shade[outer color=myyellow!50!white!<?=ic(1,pr)?>!mygray, | |
inner color=myyellow!20!mygray] | |
(<?=x1?>,<?=ly(1)?>) rectangle (<?=x2?>,<?=ly(2)?>); | |
<?end?> | |
<?do | |
local fx, fy = sx - fw, sy - fw ?> | |
\fill[black] | |
(0,0)--(<?=sx?>,0)-- | |
(<?=sx?>,<?=sy?>)--(0,<?=sy?>)--cycle | |
(<?=fw?>,<?=fw?>)--(<?=fw?>,<?=fy?>)-- | |
(<?=fx?>,<?=fy?>)--(<?=fx?>,<?=fw?>)--cycle; | |
<?end ?> | |
\node[white,font=\yearFont] | |
at (22,89) {2\xT0\xT1\xT3} ; | |
\begin{scope}[fill=white, | |
xshift=55mm,yshift=0.3mm,scale=0.005] | |
%\input{t-yato.tex} % 署名のアウトラインデータ | |
\end{scope} | |
\end{tikzpicture} | |
\end{luaembed} | |
\end{mycenter} | |
%================================================= | |
\vspace{1mm} | |
\begin{mycenter} | |
\fAoyagi\jAoyagi\xSizeL{12}{13}% | |
% 字詰めを kanjiskip を流用して行う | |
\ltjsetparameter{kanjiskip=-.14\zw,xkanjiskip=-.08\zw} | |
皆様のご健康とご多幸を\\ | |
お祈り申し上げます | |
\end{mycenter} | |
\vspace{3mm} | |
\newcommand{\xQd}{\makebox[12pt]{}} | |
\begin{myleft} | |
\xQd\fComfortaa\xSize{16}\color{mydblue} | |
New Year Puzzle% | |
\hfill | |
{% | |
\jIpagoth\xSize{8}\color{mydgreen}% | |
{% | |
\fHeros\bfseries\xSize{12}\color{myred}% | |
2013% | |
}% | |
\,年 | |
}% | |
\xQd\linebreak\xQd | |
\jHui\xSize{12}\color{mydgreen}% | |
~年賀パズル~ | |
\end{myleft} | |
\begin{myleft} | |
\xQd\hspace{6pt}% | |
\fIpagoth\jIpagoth\xSizeL{8}{10}% | |
\parbox[b]{13\zw}{% | |
右の図の空きマスに数字や演算記号を入れて | |
\textcolor{mydblue}{各行}に正しい計算式を作れ。 | |
ただし、\textcolor{mydgreen}{各縦列}について、 | |
上の欄に記されている | |
数字・記号を1回ずつ使わなければならない。 | |
(例えば左端の3つのマスには | |
2、3、6が1つずつ入る。) | |
}% | |
\hfill | |
{% | |
\newcommand{\onecol}[4]{% | |
\put(#1.5,5.6){\makebox(0,0)[b]{#2}}% | |
\put(#1.5,4.8){\makebox(0,0)[b]{#3}}% | |
\put(#1.5,4.0){\makebox(0,0)[b]{#4}}% | |
\put(#1.5,3.2){\makebox(0,0)[b]{\xG ↓}}% | |
} | |
\newcommand{\xG}{\color{mydgreen}} | |
\newcommand{\xM}{^^^^2212} % U+2212 MINUS SIGN | |
\setlength{\unitlength}{14pt} | |
\begin{picture}(10,5.8) | |
\ltjsetparameter{jacharrange={-2,-3,-6,-8}} % 全字を欧文扱い | |
\color{black!50} | |
\multiput(1,0)(1,0){9}{\line(0,1){3}} | |
\color{mydblue} | |
\fHeros\xSize{11.2}% | |
\multiput(0,3)(1,0){11}{\line(0,1){3.4}} | |
\onecol{0}{2}{3}{6} | |
\onecol{1}{\xG+}{\xG+}{3} | |
\onecol{2}{\xG×}{4}{9} | |
\onecol{3}{ }{0}{6} | |
\onecol{4}{\xG÷}{1}{2} | |
\onecol{5}{}{\xG+}{8} | |
\onecol{6}{\xG\xM}{1}{2} | |
\onecol{7}{0}{3}{6} | |
\onecol{8}{}{\xG÷}{1} | |
\onecol{9}{1}{1}{3} | |
\color{black} | |
\thicklines | |
\put(0,0){\framebox(10,3){}} | |
\polyline(0,1)(10,1) | |
\polyline(0,2)(10,2) | |
\put(3,0){\makebox(1,0.8){\xG =}} | |
\put(8,1){\makebox(1,0.8){\xG =}} | |
\put(5,2){\makebox(1,0.8){\xG =}} | |
\end{picture} | |
}% | |
\xQd | |
\end{myleft} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Visit my blog page to see the output:
http://d.hatena.ne.jp/zrbabbler/20130101/1356995677