How to simply draw matts for pupils writing Chinese character?
I suggest create one picture and repeat it in a table. To change the size change the scaling of \tikz
.
\documentclass[11pt]{article}
\usepackage{geometry}\geometry{body={15cm,20cm}}
\usepackage{tikz}
\usepackage{pinyin}
\newcommand\matt[1]{%
\tikz[scale=0.5]{%
\draw[dashed,thin](0,0)grid(2,2);
\draw[thick](0,0)rectangle(2,2);
\node[anchor=south] at (1,2){\strut#1};
}}
\begin{document}
\begin{tabular}{ccccc}
\matt{\ping4} \matt{\ba2} & \matt{\ping4} \matt{\ba2} & \matt{\ping4} \matt{\ba2} & \matt{\ping4} \matt{\ba2} & \matt{\ping4} \matt{\ba2}\\
\matt{\ping4} \matt{\ba2} & \matt{\ping4} \matt{\ba2} & \matt{\ping4} \matt{\ba2} & \matt{\ping4} \matt{\ba2} & \matt{\ping4} \matt{\ba2}\\
\matt{\ping4} \matt{\ba2} & \matt{\ping4} \matt{\ba2} & \matt{\ping4} \matt{\ba2} & \matt{\ping4} \matt{\ba2} & \matt{\ping4} \matt{\ba2}\\
\matt{\ping4} \matt{\ba2} & \matt{\ping4} \matt{\ba2} & \matt{\ping4} \matt{\ba2} & \matt{\ping4} \matt{\ba2} & \matt{\ping4} \matt{\ba2}
\end{tabular}
\end{document}
Just to show the quotes
TikZ library for pics with text, and how to use the foreach
statement.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{quotes}
\tikzset{
matt/.pic={
\draw (0,0) rectangle (1,1);
\draw[dashed] (0.5,0) -- (0.5,1);
\draw[dashed] (0,0.5) -- (1,0.5);
\draw (0.5,1) node[above] {\tikzpictext};
}
}
\begin{document}
% Inline use
\tikz\pic["p\`ing"]{matt};
\tikz\pic["b\'a"]{matt};
\begin{tikzpicture}
\path (0,0)
\foreach \couple in {{p\`ing, b\'a}, {chu\'an, d\`ai}} {
\foreach \matt in \couple {
pic["\matt"]{matt} ++(1.2,0)
}
++(0.2,0)
};
\end{tikzpicture}
\end{document}
\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usepackage{pinyin}
\tikzset{
grid/.pic={
\draw[dash pattern=on 2.2pt off 2.2pt](0,0)grid[step=0.5](1,1);
\draw[thick](0,0)rectangle(1,1);
}
}
\begin{document}
\begin{tikzpicture}
\pic at (0,0) {grid};
\node at (0.5,1.3){\ping4};
\pic at (1.2,0) {grid};
\node at (1.7,1.3){\ba2};
\pic at (2.6,0) {grid};
\node at (3.1,1.3){\chuan2};
\pic at (3.8,0) {grid};
\node at (4.3,1.3){\dai4};
\end{tikzpicture}
\end{document}