# Creating a lattice multiplication image on LaTeX

I need an image detailing the lattice multiplication method and it should look like this:

-
Do you try to make something ? –  Alain Matthes Feb 9 at 6:43
I don't know what kind of code would work for this situation. I've tried searching online but there's nothing that I can use. This is for a 5th grade class that I'm teaching and LaTeX was recommended by the district. –  Janice Feb 9 at 6:54

Not a complete code but it's one way to begin the picture. I think there are a lot of possibilities better ... You need the fit library to draw the yellow line. You can see a lot o examples to finish the picture.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{fit}

\begin{document}
\begin{tikzpicture}[case/.style={minimum width=2cm,minimum height=2cm,draw},line/.style={blue!10!gray,line width=4,line cap=round,line join=round}]
\node[case] (a) at (0,0){} ;
\node[case] (b) at (2,0){} ;
\node[case] (c) at (0,2){} ;
\node[case] (d) at (2,2){} ;

\draw[line] (c.south west) -- (c.north west) -- (c.north east) -- (c.south west)-- ++(-1,-1);
\draw[line] (c.south west) -- (c.south east) -- (c.north east) -- (d.north east)-- (a.south west) -- ++(-1,-1);
\draw[line] (d.north east) -- (b.north east) -- (b.north west) -- (b.south west)-- (a.south west) -- (a.north  west);
\draw[line] (b.south west) -- (b.south east) -- (b.north east) -- (b.south west)-- ++(-1.25,-1.25);

\node[left=0.5 cm,above] at (a) {\huge 2};
\node[above=0.25 cm] at (c.north) {\huge 4};
\node[above=0.25 cm] at (d.north) {\huge 5};
\node[text=green,shift={(0.5,0.5)}] at (d.north east) { \huge $\times$};

\end{tikzpicture}
\end{document}


-
Thank you for the code, I've figured out the rest! –  Janice Feb 9 at 9:04