我的 Latex 代码是
\begin{figure}[H]
\centering
\begin{tikzpicture}[node distance = 4cm, auto]
% Place nodes
\node [block] (inst) (imp) {Spark SQL};
\node [block, right=1cm of imp] (data) {Spark Streaming};
\node [block, right=1cm of data] (sql) {MLib-Machine Learning};
\node [block, right=1cm of sql] (runsql) {GraphX};
\node [block, align=left, minimum width=10cm, below=1cm of runsql] (visual) {Apache Spark};
\end{tikzpicture}
\caption{The Spark stack}
\label{fig:sysblocks}
\end{figure}
任何帮助都非常感谢。提前致谢。
答案1
我使用以下代码解决了这个问题:
\begin{tikzpicture}[node distance = .4cm, auto]
% Place nodes
\node [block] (inst) (imp) {Spark SQL};
\node [block, right=0.5cm of imp] (data) {Spark Streaming};
\node [block, right=0.5cm of data] (sql) {MLib-Machine Learning};
\node [block, right=0.5cm of sql] (runsql) {GraphX};
\path let \p1=($(imp.west)-(runsql.east)$),
\n1 = {veclen(\p1)-0.4pt}
in node[block, below=of imp.south west, anchor=north west, minimum width=\n1] {Apache Spark};
\end{tikzpicture}
\caption{The Spark stack}
\label{fig:sysblocks}
\end{figure}