如何在 LaTeX 中绘制下面的图表?

如何在 LaTeX 中绘制下面的图表?

看起来很简单,但我对 LaTeX 图表还是个新手。如果能得到一些帮助我会很高兴。

图表

答案1

最终我做到了。

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning}
\begin{document}

\tikzstyle{block} = [draw, rectangle, minimum height=3em, minimum width=3em]
\tikzstyle{virtual} = [coordinate]

\begin{tikzpicture}[auto]
    % Place nodes
    \node [virtual]                 (input)                        {};
    \node [block, right of=input, node distance=4cm]   (trule)     {Transformation Rules};
    \node [below of=trule]          (vrule)                        {Validation Rules};
    \node [virtual, right of=trule, node distance=4cm] (output)    {};
    \node [left of=input]           (rinput)                       {A};
    \node [right of=output]         (routput)                      {B};
    % Connect nodes
    \draw [->] (input) -- node [name=i] {\(Input\)} (trule);
    \draw [->] (trule) -- node [name=o] {\(Output\)} (output);
\end{tikzpicture}

\end{document}

最终图表

感谢所有人,特别是 A Feldman 和 AJN。

答案2

这就是我所做的[特别感谢 A Feldman 提供链接]。

    \documentclass{article}

    \usepackage{tikz}
    \usetikzlibrary{shapes,arrows,positioning}
    \begin{document}

    \tikzstyle{block} = [draw, rectangle, minimum height=3em, minimum width=3em]
    \tikzstyle{virtual} = [coordinate]

    \begin{tikzpicture}[auto, node distance=4cm]
        % Place nodes
        \node [virtual]                 (input)     {};
        \node [block, right of=input]   (trule)     {Transformation Rules};
        \node [below of=trule]          (vrule)     {Validation Rules};
        \node [virtual, right of=trule] (output)    {};
        \node [left of=input]           (rinput)    {Hello};
        \node [right of=output]         (routput)   {World};
        % Connect nodes
        \draw [->] (input) -- node [name=i] {$input$} (trule);
        \draw [->] (trule) -- node [name=o] {$output$}(output);
    \end{tikzpicture}

    \end{document}

但文字与图表之间的空隙太大。

图表latex1

相关内容