Latex 中的绘图系统架构

Latex 中的绘图系统架构

我想要绘制如下图所示的系统架构 在此处输入图片描述

你能帮助我吗?

答案1

也许 TikZ 有一些类似的东西:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix,shapes.multipart,shapes.geometric,fit,scopes}
\tikzset{
  >= latex,
  el/.style={ellipse, draw, text width=8em, align=center},
  rs/.style={rectangle split, draw, rectangle split parts=#1},
  ou/.style={draw, inner xsep=1em, inner ysep=1ex, fit=#1}
}
\begin{document}
\begin{tikzpicture}
  \matrix[matrix of nodes, row sep=5ex, column sep=1em] (mx) {
    INPUT:& |[el]| newspaper text \\
    ANALYSER& |[rs=3]|
    lexical tagger\nodepart{two}morphological analyser\nodepart{three}parser \\
    & |[el]| {analysed newspaper text} \\
    SIMPLIFIER& |[rs=2]| syntactic simplifier\nodepart{two}lexical simplifier \\
    OUTPUT:& |[el]| simplified newspaper text \\
  };
  \node[ou=(mx-2-2)] (ana) {};
  \node[ou=(mx-4-2)] (sim) {};
  {[->]
  \draw(mx-1-2)edge(ana) (ana)edge(mx-3-2) (mx-3-2)edge(sim) (sim)edge(mx-5-2);
  }
\end{tikzpicture}
\end{document}

在此处输入图片描述

或者,使用 MetaPost (使用 编译lualatex):

\documentclass{article}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
input boxes;

nodesep := 15; % space between nodes
ellipdy := 15; % the dy of ellipses

vardef cuta(suffix a, b) = % from Peter Grogono's MetaPost reference manual
  drawarrow a.c -- b.c cutbefore bpath.a cutafter bpath.b;
enddef;

beginfig(1);
  % define contents
  circleit.txt("newspaper text");
  boxjoin(a.sw = b.nw; a.se = b.ne);
  boxit.lext("lexical tagger");
  boxit.mora("morphological analyser");
  boxit.prsr("parser");
  boxjoin();
  circleit.atxt("analysed text");
  boxjoin(a.sw = b.nw; a.se = b.ne);
  boxit.syns("syntactic simplifier");
  boxit.lexs("lexical simplifier");
  boxjoin();
  circleit.stxt("simplified text");

  % position and tweak
  txt.dy  = ellipdy;
  atxt.dy = ellipdy;
  stxt.dy = ellipdy;
  lext.ne - lext.nw = (110,0);
  txt.s  - lext.n = (0,nodesep);
  prsr.s - atxt.n = (0,nodesep);
  atxt.s - syns.n = (0,nodesep);
  lexs.s - stxt.n = (0,nodesep);

  % draw everything
  picture pic; pic := image(drawboxed(lext, mora, prsr););
  draw pic; draw bbox pic;
  drawboxed(txt, atxt);
  pic := image(drawboxed(syns, lexs));
  draw pic; draw bbox pic;
  drawboxed(stxt);
  cuta(txt, lext);
  cuta(prsr, atxt);
  cuta(atxt, syns);
  cuta(lexs, stxt);
endfig;
end;
\end{mplibcode}
\end{document}

在此处输入图片描述

答案2

运行pdflatex -shell-escape

\documentclass{article}
\usepackage{auto-pst-pdf}
\usepackage{pst-node}
\begin{document}

\begin{psmatrix}[rowsep=5mm]
    INPUT:    & \psovalbox{newspaper text} \\
    ANALYSER  & \psframebox{\tabular{|c|}\hline lexical tagger\\\hline
                morphological analyser\\\hline parser\\\hline\endtabular}\\
              & \psovalbox{\parbox{2.5cm}{analysed newspaper text}} \\
    SIMPLIFIER& \psframebox{\tabular{|c|}\hline syntactic simplifier\\\hline
                 lexical simplifier\\\hline \endtabular}\\
    OUTPUT:   & \psovalbox{\parbox{2.5cm}{simplified newspaper text}}
\ncline{->}{1,2}{2,2}\ncline{->}{2,2}{3,2}            
\ncline{->}{3,2}{4,2}\ncline{->}{4,2}{5,2}            
\end{psmatrix}

\end{document}

示例输出

答案3

TikZ 是最好的选择,你可以构建很多示例,例如这个:

http://www.texample.net/tikz/examples/assignment-structure/

相关内容