Importing a bunch of pages from old websites.
[website_subgeniuskitty.com] / data / development / misc / genkouyoushi_paper.md
CommitLineData
f6e94cb2
AT
1# Overview #
2
3As a professor of Japanese, my wife requires her students to use [genkouyoushi paper](http://en.wikipedia.org/wiki/Genk%C5%8D_y%C5%8Dshi genkouyoushi paper) on most written assignments. Although this can be purchased in Japanese bookstores (or online) and can be found freely on many websites as a PDF, the lack of control over size, spacing and color frustrated her. The following source code generates genkouyoushi paper via LaTeX and is easily customizable to match any layout the user may desire.
4
5# Files #
6
7* [LaTeX source code](genkouyoushi_paper.files/Genkouyoushi_-_Horizontal.tex)
8* [PDF Sample](genkouyoushi_paper.files/Genkouyoushi_-_Horizontal.pdf)
9
10# Source Code #
11
12 \documentclass{article}
13 \usepackage{tikz}
14 \usepackage{pdflscape}
15 \usepackage[top=1.6cm, bottom=1.6cm, left=1.6cm, right=1.6cm]{geometry}
16 \pagestyle{empty}
17 \newcommand\genkoyoshi[4]{% maxrow, maxcol, size, sep
18 \def\maxrow{#1}%
19 \def\maxcol{#2}%
20 \def\size{#3}%
21 \def\sep{#4}%
22 \begin{tikzpicture}
23 \pgfmathsetmacro{\inc}{\size+\sep}
24 \foreach \col in {1,...,\maxcol}{
25 \foreach \row in {1,...,\maxrow}{
26 \draw ({(\col-1)*\inc pt},{\row*\size})
27 rectangle ++ (\size,\size);
28 }
29 \draw ({(\col-1)*\inc-\sep},{\size})
30 rectangle ++ (\sep,\maxrow*\size);
31 }
32 \end{tikzpicture}%
33 }
34 \begin{document}
35 \begin{landscape}
36 \genkoyoshi{20}{20}{9mm}{3mm}
37 \end{landscape}
38 \end{document}