tkz-linknodes,子图对齐问题

tkz-linknodes,子图对齐问题

我无法管理各种图形之间的对齐。我该怎么办?谢谢

 \documentclass[a4paper,11pt]{article}
    \usepackage[utf8]{inputenc}
    \usepackage[upright]{fourier}
    \usepackage{amsmath,tkz-linknodes,tikz,subfig}
    \begin{document}
    \begin{figure}
    \subfloat[][]{\label{fig:prodottopolinomiopolinomio}
    \begin{minipage}{12cm}
    \begin{tikzpicture}
    \node (a) {$(A$};
    \node (p1)[right of=a, node distance=15]{$+$};
    \node (b)[right of=p1, node distance=15]{$B)^2$};
    \node (R)[right of=b, node distance=15]{$=$};
    \node (as)[right of=R, node distance=15]{$A^2$};
    \node (s1)[right of=as, node distance=15]{$+$};
    \node (bs)[right of=s1, node distance=15]{$B^2$};
    \node (s2)[right of=bs, node distance=15]{$+$};
    \node (dp)[right of=s2, node distance=15]{$2AB$};
    \path (a.north) edge [bend left=45,-triangle 90](as.north);
    \path (a.north) edge [bend left=45,-triangle 90](dp.north);
    \path(b.south)edge [bend right=45,-triangle 90](bs.south);
    \path(b.south)edge [bend right=45,-triangle 90](dp.south);

    \end{tikzpicture}
    \end{minipage}
    }%
    \subfloat[][]{\label{fig:polinomiquadratobinomio1}
    \begin{minipage}{12cm}
    \begin{NodesList}
        \begin{align*}
            \left(a+2b\right)^2&\AddNode[1]\AddNode[2]\AddNode[3]\AddNode[4]\\
            +a^2&\AddNode[1]&\\ 
            +4b^2&\AddNode[2]&\\
            +4ab&\AddNode[3]\\
            \left(a+2b\right)^2=a^2+4b^2+4ab&\AddNode[4]
        \end{align*}
        \tikzset{LabelStyle/.style = {left=0.1cm,pos=0.5,text=red,fill=white}}
        \LinkNodes[margin=2cm]{$a\cdot a$}%    
        \LinkNodes[margin=2cm]{$2b\cdot 2b$}%
        \LinkNodes[margin=2cm]{$2\cdot a \cdot 2b$}%
        \LinkNodes[margin=2cm]{ottengo}% 
    \end{NodesList}
    \end{minipage}
    }%
    \qquad%
    \subfloat[][]{\label{fig:polinomiquadratobinomio2}
    \begin{minipage}{12cm}%
    \begin{NodesList}
        \begin{align*}
            \left(2x-3y\right)^2&\AddNode[1]\AddNode[2]\AddNode[3]\AddNode[4]\\
            +4x^2&\AddNode[1]&\\ 
            +9y^2&\AddNode[2]&\\
            -12xy&\AddNode[3]\\
            \left(2x-3y\right)^2=4x^2+9y^2-12xy&\AddNode[4]
        \end{align*}
        \tikzset{LabelStyle/.style = {left=0.1cm,pos=0.5,text=red,fill=white}}
        \LinkNodes[margin=2cm]{$2x\cdot 2x$}%    
        \LinkNodes[margin=2cm]{$(-3y)\cdot (-3y)$}%
        \LinkNodes[margin=2cm]{$2\cdot (2x) \cdot(-3y)$}%
        \LinkNodes[margin=2cm]{ottengo}% 
    \end{NodesList}
    \end{minipage}
    }%
    \subfloat[][]{\label{fig:polinomiquadratobinomio3}
    \begin{minipage}{12cm}%
    \begin{NodesList}
        \begin{align*}
        \left(2-z\right)^2&\AddNode[1]\AddNode[2]\AddNode[3]\AddNode[4]\\
        +4&\AddNode[1]&\\ 
        +z^2&\AddNode[2]&\\
        -4z&\AddNode[3]\\
        \left(2-z\right)^2=4+z^2-4z&\AddNode[4]
    \end{align*}
    \tikzset{LabelStyle/.style = {left=0.1cm,pos=0.5,text=red,fill=white}}
    \LinkNodes[margin=2cm]{$2\cdot 2$}%    
    \LinkNodes[margin=2cm]{$(-z)\cdot (-z)$}%
    \LinkNodes[margin=2cm]{$2\cdot (2) \cdot(-z)$}%
    \LinkNodes[margin=2cm]{ottengo}% 
    \end{NodesList}
    \end{minipage}
    }

    \caption{Quadrato Binomio}
      \label{fig:QuadratobinomioG}
    \end{figure}
    \end{document} 

我试图获得以下类型的对齐

AA

AA。

我不想要这种类型的对齐

A

A

A

A

enter code here
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[upright]{fourier}
\usepackage{amsmath,tkz-linknodes}
\usepackage{tikz}
\usepackage{subcaption}
\usepackage{subfig}
\begin{document}
\begin{figure}
\begin{minipage}[h]{7cm}
\centering
\begin{tikzpicture}
\clip (-0.3,-1) rectangle (4.6,1.4);
\node (a) {$(A$};
\node (p1)[right of=a, node distance=15]{$+$};
\node (b)[right of=p1, node distance=15]{$B)^2$};
\node (R)[right of=b, node distance=15]{$=$};
\node (as)[right of=R, node distance=15]{$A^2$};
\node (s1)[right of=as, node distance=15]{$+$};
\node (bs)[right of=s1, node distance=15]{$B^2$};
\node (s2)[right of=bs, node distance=15]{$+$};
\node (dp)[right of=s2, node distance=15]{$2AB$};
\path (a.north) edge [bend left=45,-triangle 90](as.north);
\path (a.north) edge [bend left=45,-triangle 90](dp.north);
\path(b.south)edge [bend right=45,-triangle 90](bs.south);
\path(b.south)edge [bend right=45,-triangle 90](dp.south);
\end{tikzpicture}
\subcaption{aaaaaa}\label{fig:QuadratobinomioGa}%
\end{minipage}
\begin{minipage}[h]{8cm}
\begin{NodesList}
\centering
    \begin{align*}  \left(a+2b\right)^2&\AddNode[1]\AddNode[2]\AddNode[3]\AddNode[4]\\
        +a^2&\AddNode[1]&\\ 
        +4b^2&\AddNode[2]&\\
        +4ab&\AddNode[3]&\\
        \left(a+2b\right)^2=a^2+4b^2+4ab&\AddNode[4]
    \end{align*}
    \tikzset{LabelStyle/.style = {left=0.1cm,pos=0.5,text=red,fill=white}}
    \LinkNodes[margin=1cm]{$a\cdot a$}%    
    \LinkNodes[margin=1cm]{$2b\cdot 2b$}%
    \LinkNodes[margin=1cm]{$2\cdot a \cdot 2b$}%
    \LinkNodes[margin=1cm]{ottengo}% 
\end{NodesList}
\subcaption{bbbbbb}\label{fig:QuadratobinomioGb}%
\end{minipage}%
\qquad%
\begin{minipage}[h]{8cm}
\begin{NodesList}
\centering
    \begin{align*}  \left(2x-3y\right)^2&\AddNode[1]\AddNode[2]\AddNode[3]\AddNode[4]\\
        +4x^2&\AddNode[1]&\\ 
        +9y^2&\AddNode[2]&\\
        -12xy&\AddNode[3]\\
        \left(2x-3y\right)^2 =4x^2+9y^2-12xy&\AddNode[4]
    \end{align*}
    \tikzset{LabelStyle/.style = {left=0.1cm,pos=0.5,text=red,fill=white}}
    \LinkNodes[margin=0cm]{$2x\cdot 2x$}%    
    \LinkNodes[margin=0cm]{$(-3y)\cdot (-3y)$}%
    \LinkNodes[margin=0cm]{$2\cdot (2x) \cdot(-3y)$}%
    \LinkNodes[margin=0cm]{ottengo}% 
\end{NodesList}
\subcaption{cccc}\label{fig:QuadratobinomioGc}%
\end{minipage}%
\begin{minipage}[h]{8cm}
\begin{NodesList}
\centering
    \begin{align*}
        \left(2-z\right)^2&\AddNode[1]\AddNode[2]\AddNode[3]\AddNode[4]\\
        +4&\AddNode[1]&\\ 
        +z^2&\AddNode[2]&\\
        -4z&\AddNode[3]\\
        \left(2-z\right)^2=4+z^2-4z&\AddNode[4]
    \end{align*}
    \tikzset{LabelStyle/.style = {left=0.1cm,pos=0.5,text=red,fill=white}}
    \LinkNodes[margin=1cm]{$2\cdot 2$}%    
    \LinkNodes[margin=1cm]{$(-z)\cdot (-z)$}%
    \LinkNodes[margin=1cm]{$2\cdot (2) \cdot(-z)$}%
    \LinkNodes[margin=1cm]{ottengo}% 
\end{NodesList}
\subcaption{ddddd}\label{fig:QuadratobinomioGd}%
\end{minipage}%
\caption{Quadrato Binomio}
  \label{fig:QuadratobinomioG}
\end{figure}
\end{document}

有用

答案1

如果你=&=最后的环境线align*产生:

在此处输入图片描述

笔记:

  • 消除了过多的新线(它们在环境中是不允许的align),同时也影响了图片。

代码:

\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[upright]{fourier}
\usepackage{amsmath,tkz-linknodes}
\usepackage{tikz}
\usepackage{subfig}

\begin{document}

\begin{figure}
\subfloat[][]{\label{fig:prodottopolinomiopolinomio}
\begin{minipage}{12cm}
\begin{tikzpicture}
\node (a) {$(A$};
\node (p1)[right of=a, node distance=15]{$+$};
\node (b)[right of=p1, node distance=15]{$B)^2$};
\node (R)[right of=b, node distance=15]{$=$};
\node (as)[right of=R, node distance=15]{$A^2$};
\node (s1)[right of=as, node distance=15]{$+$};
\node (bs)[right of=s1, node distance=15]{$B^2$};
\node (s2)[right of=bs, node distance=15]{$+$};
\node (dp)[right of=s2, node distance=15]{$2AB$};
\path (a.north) edge [bend left=45,-triangle 90](as.north);
\path (a.north) edge [bend left=45,-triangle 90](dp.north);
\path(b.south)edge [bend right=45,-triangle 90](bs.south);
\path(b.south)edge [bend right=45,-triangle 90](dp.south);
\end{tikzpicture}
\end{minipage}
}%

\subfloat[][]{\label{fig:polinomiquadratobinomio1}

\begin{minipage}{12cm}
\begin{NodesList}
    \begin{align*}  \left(a+2b\right)^2&\AddNode[1]\AddNode[2]\AddNode[3]\AddNode[4]\\
        +a^2&\AddNode[1]&\\ 
        +4b^2&\AddNode[2]&\\
        +4ab&\AddNode[3]&\\
        \left(a+2b\right)^2&=a^2+4b^2+4ab\AddNode[4]
    \end{align*}

    \tikzset{LabelStyle/.style = {left=0.1cm,pos=0.5,text=red,fill=white}}

    \LinkNodes[margin=2cm]{$a\cdot a$}%    
    \LinkNodes[margin=2cm]{$2b\cdot 2b$}%
    \LinkNodes[margin=2cm]{$2\cdot a \cdot 2b$}%
    \LinkNodes[margin=2cm]{ottengo}% 
\end{NodesList}
\end{minipage}%
}%

\qquad%
\subfloat[][]{\label{fig:polinomiquadratobinomio2}

\begin{minipage}{12cm}%
\begin{NodesList}
    \begin{align*}  \left(2x-3y\right)^2&\AddNode[1]\AddNode[2]\AddNode[3]\AddNode[4]\\
        +4x^2&\AddNode[1]&\\ 
        +9y^2&\AddNode[2]&\\
        -12xy&\AddNode[3]\\
        \left(2x-3y\right)^2 &=4x^2+9y^2-12xy\AddNode[4]
    \end{align*}

    \tikzset{LabelStyle/.style = {left=0.1cm,pos=0.5,text=red,fill=white}}

    \LinkNodes[margin=2cm]{$2x\cdot 2x$}%    
    \LinkNodes[margin=2cm]{$(-3y)\cdot (-3y)$}%
    \LinkNodes[margin=2cm]{$2\cdot (2x) \cdot(-3y)$}%
    \LinkNodes[margin=2cm]{ottengo}% 
\end{NodesList}
\end{minipage}%
}%

\subfloat[][]{\label{fig:polinomiquadratobinomio3}

\begin{minipage}{12cm}%
\begin{NodesList}
    \begin{align*}
        \left(2-z\right)^2&\AddNode[1]\AddNode[2]\AddNode[3]\AddNode[4]\\
        +4&\AddNode[1]&\\ 
        +z^2&\AddNode[2]&\\
        -4z&\AddNode[3]\\
        \left(2-z\right)^2&=4+z^2-4z\AddNode[4]
    \end{align*}
    \tikzset{LabelStyle/.style = {left=0.1cm,pos=0.5,text=red,fill=white}}
    \LinkNodes[margin=2cm]{$2\cdot 2$}%    
    \LinkNodes[margin=2cm]{$(-z)\cdot (-z)$}%
    \LinkNodes[margin=2cm]{$2\cdot (2) \cdot(-z)$}%
    \LinkNodes[margin=2cm]{ottengo}% 
\end{NodesList}
\end{minipage}%
}

\caption{Quadrato Binomio}
  \label{fig:QuadratobinomioG}
\end{figure}
\end{document} 

相关内容