答案1
一些array
s 和tikzmark
图书馆:
代码:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark,shapes.geometric,fit}
\newcommand\AddSpa[2][6pt]{\hspace{#1}#2\hspace{#1}}
\begin{document}
\[
\begin{array}{@{}c@{}}
\begin{array}[t]{c|l}
2 & 12 \\
\hline
2 & 6 \\
\hline
3 & 3 \\
\hline
& 1
\end{array}\qquad
\begin{array}[t]{c|l}
3 & 15 \\
\hline
5 & 5\\
\hline
& 1
\end{array}\qquad
\begin{array}[t]{c|l}
2 & 18 \\
\hline
3 & 9 \\
\hline
3 & 3 \\
\hline
& 1
\end{array}
\\[2cm]
\begin{array}{c@{\AddSpa{=}}c@{\AddSpa{\times}}c@{\AddSpa{\times}}c}
12 & \tikzmark{startcol1}2 & 2 & \tikzmark{startcol2}3 \\
15 & \multicolumn{1}{c}{}& 5 & 3 \\
18 & \tikzmark{endcol1}2 & 3 & \tikzmark{endcol2}3 \\
\end{array}
\end{array}
\]
\begin{tikzpicture}[remember picture,overlay]
\coordinate (aux1) at ([xshift=6pt,yshift=4pt]{pic cs:startcol1});
\coordinate (aux2) at ([xshift=6pt,yshift=4pt]{pic cs:startcol2});
\node[inner ysep=1pt,inner xsep=2pt,draw,ellipse,fit={(aux1) (pic cs:endcol1)}] {};
\node[inner ysep=1pt,inner xsep=2pt,draw,ellipse,fit={(aux2) (pic cs:endcol2)}] {};
\end{tikzpicture}
\end{document}