[Tex/LaTex] How to make a stroke order diagram for Chinese characters

cjkfonts

I would like to make a simple document explaining how to write certain Chinese characters. The standard method, which is used in many textbooks, is to first show the complete character and then a series of simpler ones adding one stroke at a time. In order to accomplish this, I need to be able to typeset only certain strokes from a given character. There is an article on typesetting rare characters, whose technique could be adapted but it would take a lot of work. I wonder if there is a simpler way which avoids entering each stroke manually.

Best Answer

I can speak for Japanese only, but it might help you to find the right track for Chinese if there is a similar project.

I had a privilege to exchange several emails with Ulrich Apel (the AAAA and Wadoku projects) and Timothy Eyre (the creator and maintainer of the Kanji Stroke Order Font). They are both nice and helpful guys.

How the font with stroke orders works in this particular case? You simply download the font from http://www.nihilist.org.uk/ (look up for the first link from top on the webpage) and unpack it in your working directory (and eventually install it). Use it with xelatex or lualatex as any other font. I enclose an example and a preview of several kanjis.

Update: I've found this font in fonts-kanjistrokeorders package in the Ubuntu repository.

%! {xe|lua}latex mal-kanji.tex
\documentclass[a4paper]{article}
\pagestyle{empty}\parindent=0pt
\usepackage{fontspec}
\begin{document}
\centering % Font is present in working directory...
\setmainfont[ExternalLocation]{KanjiStrokeOrders_v3.001.ttf}
Good day!\par おはようございます
\newpage
Fish!\par 魚
\end{document}

mwe, part 1

mwe, part 2