带有文本、箭头、虚线和括号的 TikZ 图形

带有文本、箭头、虚线和括号的 TikZ 图形

我正在尝试制作下图: 预期数字

到目前为止,这是我的代码:

\documentclass{article}
\usepackage{amsmath}
\usepackage{arydshln}

\begin{document}
\pagestyle{empty}
\centering

\[
\begin{array}{ccccc}
\text{First Factor} & \xrightarrow{\hspace*{2cm}} & \text{Second Factor} & \xrightarrow{\hspace*{2cm}} & \text{Multiple Factors} \\
\text{(Parenthetical)} & &  &  & \text{(M = 100)} \\
\end{array}
\]

\[
\begin{array}{ccccc}
&&& \left\downarrow\rule{0cm}{1cm}\right.\phantom{(\varphi^n)^*}\\
\end{array}
\]

Long text explaining what is the output in this row  \\ $Y_{ipt}$ = f(factor1, factor2, factor3, factor4, factor5, factor6, factor7, factor8)

\[
\begin{array}{ccccc}
&&& \left\downarrow\rule{0cm}{1cm}\right.\phantom{(\varphi^n)^*}\\
\end{array}
\]

Another Long text explaining what is the output in this row
$\hat{Y}_{pt}$ explaining the predicted values considering factor1, factor2, factor3, factor4, factor5, factor6, factor7,  and factor8

\[
\begin{array}{ccccc}
&&& \left\downarrow\rule{0cm}{1cm}\right.\phantom{(\varphi^n)^*}\\
\end{array}
\]

One more long text explaining the output \\\hdashline[10.5pt/7pt]

New stage begins calculating the mean ($\mu$) and the variance ($\omega$) with some other parameters to understand our results

\[
\begin{array}{ccccc}
&&& \left\downarrow\rule{0cm}{1cm}\right.\phantom{(\varphi^n)^*}\\
\end{array}
\]

$\mu_{pt} =$ f(factor1, factor2, factor3, factor4, factor5, factor6, factor7, factor8, factor1*factor2, factor2*factor3, factor4*factor5)
$\omega_{pt}$=f(factor9, factor10, factor11, factor12, factor13, factor14, factor15, factor16, factor17, factor18, factor19, factor20)

\end{document}

正如您所见,我离这个目标还很远,因为我制作的东西既不高效,也不是真正的数字。我确信有更好的方法可以使用 TikZ 等软件包来实现,但我无法成功编码。

答案1

使用 TikZ,正如@daleif 在他的评论中所建议的那样:

\documentclass{article}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                chains,
                decorations.pathmorphing,
                calligraphy,
                positioning}
\makeatletter
\tikzset{suspend join/.code={\def\tikz@after@path{}}}
\makeatother

\begin{document}
\pagestyle{empty}
\centering

    \begin{tikzpicture}[
node distance = 12mm and 0mm,
  start chain = A going below,
every node/.append style = {align=flush center},
   box/.style = {minimum height=9mm, text width=124mm,
                 font=\itshape\sffamily\small, on chain=A, join=by arr},
   arr/.style = {-{Triangle[angle=60:2 3]}, thick},
    BC/.style = {decorate,  % Brace, calligraphy
                 decoration={calligraphic brace, amplitude=4pt,
                             pre =moveto, pre  length=1pt,
                             post=moveto, post length=1pt,
                             raise=4pt,
                             mirror}, % for mirroring of brace
                 very thick,
                 pen colour=black
                },
                        ]
\node[box] {};
\node (A-1C) at (A-1) {Second Factor};
\node (A-1L) [right=of A-1.west] {First Factor\\(Parenthetical)};
\node (A-1R) [ left=of A-1.east] {Multipole Factor\\($M=100$)};
\draw[arr]  (A-1L) -- (A-1C);
\draw[arr]  (A-1C) -- (A-1R);
\draw   (A-1.north west) -- (A-1.north east);

\node[box]  {Long text explaining what is the output in this row
             $Y_{ipt}=f$ factor1, factor2, factor3, factor4,
             factor5, factor6, factor7,  and factor8};
\node[box]  {Another Long text explaining what is the output in this row
             $\hat{Y}_{pt}$ explaining the predicted values considering factor1, factor2, factor3, factor4,\\
             factor5, factor6, factor7,  and factor8};
\node[box]  {One more long text explaining the output};

\draw[dashed]   (A-4.south west) -- (A-4.south east);

\node[box, suspend join,
      below=0pt of A-4]  
            {New stage begins calculating the mean ($\mu$) and the variance ($\omega$) with some other parameters to understand our results};
\node[box]  {New stage begins calculating the mean ($\mu$) and the variance ($\omega$) with some other parameters to understand our results};

\node[box]  {$\mu_{pt} =$ f(factor1, factor2, factor3, factor4, factor5, factor6, factor7, factor8,\\
                factor1*factor2, factor2*factor3, factor4*factor5)\\
            $\omega_{pt}=f$(factor9, factor10, factor11, factor12, factor13, factor14, factor15, factor16,\\ 
                factor17, factor18, factor19, factor20)};
\draw   (A-7.south west) -- (A-7.south east);
%%%%
\draw[BC] (A-1.north west) -- 
    node[left=8pt] {\textbf{1\textsuperscript{st}}\\ \textbf{stage}} (A-4.south west);
\draw[BC] (A-5.north west) -- 
    node[left=8pt] {\textbf{2\textsuperscript{st}}\\ \textbf{stage}} (A-7.south west);

    \end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容