小学生写汉字怎样简单画垫子?

小学生写汉字怎样简单画垫子?

我想要实现如下图的效果:

在此处输入图片描述

但我只能画出这样的图:

在此处输入图片描述

有没有什么简单的方法来绘制这些垫子?

 \documentclass[border=2mm]{standalone}
  \usepackage{tikz}
  \usepackage{pinyin}
\begin{document}

\begin{tikzpicture}
\draw[dash pattern=on 2.2pt off 2.2pt](0,0)grid[step=0.5](1,1);
                    \draw[thick](0,0)rectangle(1,1);
                    \node at (0.5,1.3){\ping4};                  
\draw[dash pattern=on 2.2pt off 2.2pt](1.2,0)grid[step=0.5](2.2,1);
                    \draw[thick](1.2,0)rectangle(2.2,1);
                    \node at (1.7,1.3){\ba2};
\draw[dash pattern=on 2.2pt off 2.2pt](2.6,0)grid[step=0.5](3.6,1);
                    \draw[thick](2.6,0)rectangle(3.6,1);
                    \node at (3.1,1.3){\chuan2};
\draw[dash pattern=on 2.2pt off 2.2pt](3.8,0)grid[step=0.5](4.8,1);
                    \draw[thick](3.8,0)rectangle(4.8,1);
                    \node at (4.3,1.3){\dai4};
\end{tikzpicture}

\end{document} 

答案1

我建议创建一张图片并在表格中重复它。要更改大小,请更改缩放比例\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} 

在此处输入图片描述

答案2

仅展示quotes带有文本的图片的 TikZ 库,以及如何使用该foreach语句。

\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}

渲染

答案3

\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} 

拼音

答案4

这些是盒子: 在此处输入图片描述

\documentclass{article}


\usepackage{tikz}
\newsavebox{\rectangle}

\newcommand{\boxme}[4]{%
    \begin{tikzpicture}
    \draw (0,0) rectangle (1,+1);
    \draw[dashed] (0.5,0)--(0.5,1);
    \draw[dashed] (0,0.5)--(1,0.5);
    \end{tikzpicture}}

\begin{document}



\begin{tikzpicture}
\foreach \x in { 0,3,6,9,12}
 \foreach \y in { 0,2,4,6,8}
  {
   \node at (\x,\y) {\boxme{}{}{}{}};
   \node at (\x+1.1,\y) {\boxme{}{}{}{}};
  }
\end{tikzpicture}
\end{document}

相关内容