需要 LaTex Sketch 帮助吗?

需要 LaTex Sketch 帮助吗?

我正在使用 Tiz 绘制一个折衷了很多东西的图形,我肯定会需要更多的图形。如果有人能帮忙就太好了!我目前陷入困境,特别是在块定位方面……

tikz 草图

这是我目前所拥有的,但我需要一些箭头文字:

\begin{tikzpicture}
        [block/.style={draw,minimum width=#1,minimum height=2em},
        block/.default=10em,high/.style={minimum height=3em},node distance=2em]
        \node (n0){Start};
        \node[block=28em,high,below=of n0] (n1){Identification Goal Definition + Prior Knowledge Accumulation};
        \node[block,below=of n1.south west,xshift=2em,anchor=north west] (n2){System Excitation};
        \node[block,below=of n2] (n3){Model Architecture Selection};
        \node[block,below=of n3] (n4){Order and Parameter Estimation};
        \node[block,below=of n4] (n5){Model Validation};
        \node[block=25em,high,below=of n5.south west,anchor=north west] (n6){Successful System Identification};

        \draw[-stealth] (n0) edge (n1)
        foreach \X in {1,...,5} {(n\X.south-|n2) edge (n\the\numexpr\X+1\relax.north-|n2)}
        (n5.east) -- ++(5em,0) coordinate (aux) |- (n2);
        \draw[-stealth] (aux|-n4) edge (n4) (n5.east) --++ (2em,0);
        \draw[-stealth] (aux|-n3) edge (n3) (n5.east) --++ (2em,0);

    \end{tikzpicture}

在此处输入图片描述

答案1

欢迎!本网站上有大约 100 个这样的图表。现在又多了一个。为了实现正确的定位,您可能需要使用库positioning。还有许多其他工具,例如,chains但在这种情况下,在我看来它们没有用。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[block/.style={draw,minimum width=#1,minimum height=2em},
 block/.default=10em,high/.style={minimum height=3em},node distance=2em]
 \node (n0){Start};
 \node[block=28em,high,below=of n0] (n1){};
 \node[block,below=of n1.south west,xshift=2em,anchor=north west] (n2){};
 \node[block,below=of n2] (n3){};
 \node[block,below=of n3] (n4){};
 \node[block=25em,high,below=of n4.south west,anchor=north west] (n5){};
 \draw[-stealth] (n0) edge (n1)
 foreach \X in {1,...,4} {(n\X.south-|n2) edge (n\the\numexpr\X+1\relax.north-|n2)}
 (n4.east) -- ++(5em,0) coordinate (aux) |- (n2);
 \draw[-stealth] (aux|-n3) edge (n3) (n4.east) --++ (2em,0);
\end{tikzpicture}
\end{document}

在此处输入图片描述

为了添加箭头,您可以使用quotes

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,quotes}
\begin{document}
\begin{tikzpicture}[block/.style={draw,minimum width=#1,minimum height=2em},
 block/.default=10em,high/.style={minimum height=3em},node distance=2em,auto]
 \node (n0){Start};
 \node[block=28em,high,below=of n0] (n1){};
 \node[block,below=of n1.south west,xshift=2em,anchor=north west] (n2){};
 \node[block,below=of n2] (n3){};
 \node[block,below=of n3] (n4){};
 \node[block=25em,high,below=of n4.south west,anchor=north west] (n5){};
 \draw[-stealth] (n0) edge["a"] (n1)
 foreach \X in {1,...,4} {(n\X.south-|n2) edge["b"] (n\the\numexpr\X+1\relax.north-|n2)}
 (n4.east) -- ++(5em,0) coordinate (aux) |- node[pos=0.75]{c}(n2);
 \draw[-stealth] (aux|-n3) edge["d"] (n3) (n4.east) --node{e}++  (2em,0);
\end{tikzpicture}
\end{document}

在此处输入图片描述

这是带有箭头文本的更新问题的代码。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,quotes}
\begin{document}
\begin{tikzpicture}
        [block/.style={draw,minimum width=#1,minimum height=2em},
        block/.default=10em,high/.style={minimum height=3em},
        node distance=2em,auto]
        \node (n0){Start};
        \node[block=28em,high,below=of n0] (n1){Identification Goal Definition + Prior Knowledge Accumulation};
        \node[block,below=of n1.south west,xshift=2em,anchor=north west] (n2){System Excitation};
        \node[block,below=of n2] (n3){Model Architecture Selection};
        \node[block,below=of n3] (n4){Order and Parameter Estimation};
        \node[block,below=of n4] (n5){Model Validation};
        \node[block=25em,high,below=of n5.south west,anchor=north west] (n6){Successful System Identification};

        \draw[-stealth] (n0) edge["a"] (n1)
        foreach \Y [count=\X] in {bla,blub,pft,ghh,trf} 
        {(n\X.south-|n2) edge["\Y"] (n\the\numexpr\X+1\relax.north-|n2)}
        (n5.east) --  ++(5em,0) coordinate (aux) |- node[pos=0.75] {d} (n2) ;
        \draw[-stealth] (aux|-n3) edge["c"] (n3)
         (aux|-n4) edge["b"] (n4) (n5.east) -- node[pos=0.5]
        {prt} ++ (2em,0);
    \end{tikzpicture}
\end{document}

在此处输入图片描述

这些文本都是独一无二的,因此您可以用任何您想要的文本替换它们。如果您只是将 添加到文档中,请确保加载quotes库(当然还有)。positioningtikzpicture

答案2

@Schrödinger 的猫答案的一个小变化。使用chains库和宏“join:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                chains, 
                positioning}

\begin{document}
    \begin{tikzpicture}[
    node distance = 8mm and 0mm,
      start chain = going above,
       box/.style = {draw, minimum width=#1, minimum height=12mm, on chain},
     box/.default = 44mm,
every join/.style = {<-},
                > = {Stealth[length=3mm]}
                        ]
\node (n1) [box=88mm]{};
\node (n2) [box, above right=of n1.north west] {};
\node (n3) [box,join] {};
\node (n4) [box,join] {};
\node (n5) [box=96mm, above right=8mm and -8mm of n4.north west] {};
\draw[<-]  (n5.north) -- ++ (0,0.8) node[above] {Start};
%
    \begin{scope}[every path/.style={->}]
\draw  (n5.south -| n4) -- (n4);
\draw  (n2.east) -- ++ (1,0);
\draw  (n2.east) ++ (1,0) -- ++ (1,0) |- (n3);
\draw  (n3.east) ++ (2,0) |- (n4);
\draw  (n2) -- (n2 |- n1.north);
    \end{scope}
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容