[Tex/LaTex] Japanese practise paper (Genkou Youshi)

cjktemplates

I'm trying to figure out a way of creating a Japanese character practice sheet. The type that I'm looking to create looks a little like the Genkou Youshi that this question was looking to cover. Except that a Japanese character is inserted into the topmost 4-5 boxes of a row, where the instances of the character after the first are printed in a progressively lighter shade until they have faded away completely.

Here's an example of what I'm looking to create:

enter image description here

Is this possible to do? If so, where should I start? I'm a bit of a beginner to TeX, but am willing to learn.

I'm currently using:

  • TexMaker 3.5
  • TexLive 2011
  • Windows 7 (But I can move over the Debian if needed)
  • This answer from the previously mentioned question.

Best Answer

Here you go. My code is a mild extension of this answer by Paul Gaborit.

Code

\documentclass{article}
\usepackage{tikz}
\pagestyle{empty}
\newcommand\genkoyoshi[4]{%
  \def\rowopacities{#1}%
  \def\colnames{#2}%
  \def\size{#3}%
  \def\sep{#4}%
  \begin{tikzpicture}[yscale=-1]
    \pgfmathsetmacro{\inc}{\size+\sep}
    \newcounter{col}
    \newcounter{row}
    \foreach \colname in \colnames{
      \addtocounter{col}{1}
      \setcounter{row}{0}
      \foreach \rowopacity in \rowopacities{
        \addtocounter{row}{1}
        \draw ({(\thecol-1)*\inc pt},{\therow*\size})
        rectangle ++ (\size,\size);
        \node[text=black!\rowopacity] at ({(\thecol-1)*\inc+\size*0.5 pt},{\therow*\size+\size*0.5}) {\colname};
      }
    }
  \end{tikzpicture}%
}
\begin{document}
\genkoyoshi{100,66,33,0,0,0,0,0,0,0}{a,b,c,d,e,f,g,h,i,j,k}{8mm}{2mm}
\end{document}

Comments on the code

  • The list 100,66,33,0,0,0,0,0,0,0 gives the opacity of each row -- 0 is transparent, and 100 is completely black. The length of that list gives the number of rows, hence the 0 fillers at the end.

  • The list a,b,c,d,e,f,g,h,i,j,k gives the character you want in each column.

  • The 8mm is the height and width of each cell, and the 2mm is the size of the gap between columns

  • The notation black!40 gives a colour that is 40% black and 60% white.

  • Each letter is centred horizontally and vertically in its cell, which is why the g looks a bit high and the d looks a bit low. If you don't like this, change {\colname} on line 20 to {\strut\colname}.

Result

enter image description here

Related Question