如何安装包 \usetikzlibrary{positioning,fit,arrows.meta,backgrounds}?

如何安装包 \usetikzlibrary{positioning,fit,arrows.meta,backgrounds}?

\usetikzlibrary{positioning,fit,arrows.meta,backgrounds}我使用latex 代码中的线来生成带箭头的架构图。但它显示错误,如下所示

找不到文件\usetikzlibrary{positioning,fit,arrows.meta,backgrounds}...

因此我无法正确生成架构图。请有人帮助我在 Ubuntu 14.04 中的 LaTeX 代码中使用上述包。

我的代码如下。

\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,fit,arrows.meta,backgrounds}


\tikzset{
    module/.style={%
        draw, rounded corners,
        minimum width=#1,
        minimum height=7mm,
        font=\sffamily
        },
    module/.default=2cm,
    >=LaTeX
}

\begin{document}
\begin{tikzpicture}[
    % This will show the frame around the figure
    show background rectangle]

    % Place first 6 items
    \node[module] (I1) {Item-1};
    \node[module, below=of I1] (I2) {Item-2};
    \node[module, below=of I2] (I3) {Item-3};
    \node[module=1cm, below=8mm of I3] (I5) {Item-5};
    \node[module=1cm, left= 3mm of I5] (I4) {Item-4};
    \node[module=1cm, right= 3mm of I5] (I6) {Item-6};
    % Inner box around Items 3-6
    \node[fit=(I3) (I4) (I6), draw, inner sep=2mm] (fit3) {};
    % Outer box around all left items
    \node[fit=(fit3) (I1), draw, inner sep=2mm] (fit1) {};
    % Connections
    \foreach \i in {4,5,6}
        \draw[->] (I3)--(I\i);
    \draw[->] (I2)--(I1);
    \draw[->] (I2)--(fit3);

    % Items 7-8-9. Item 7 as label of Item-8
    \node[module, right=2cm of {I2-|fit1.east}, 
        label={[yshift=5mm, font=\sffamily]Item-7}] 
        (I8) {Item-8};
    \node[module, below=of I8] (I9) {Item-9};
    %outer box around items 8-9
    \node[fit={(I9) (I9|-fit1.south) (I9|-fit1.north)}, draw, inner xsep=5mm, inner ysep=-\pgflinewidth] (fit8) {};

    %arrow between boxes
    \draw[<->,dashed] (fit1)--(fit8);

    %upper label
    \path (fit1.north east)--node[above=3mm, font=\sffamily\bfseries] (arc) {Architecture} (fit8.north west);

\end{tikzpicture}
\end{document}

相关内容