命名路径并将重复代码移出范围

命名路径并将重复代码移出范围

我想将重复路径代码(-0.5,.25) -- (-0.5,-.25) -- (0.5,-.25) -- (0.5,.25)移出作用域环境。我可以命名此路径,然后在作用域块内引用它吗?

  \begin{scope} [mem/.style={upper left=gray!40, very thin}]
    \node[draw, black, thick, minimum width =4cm,
          minimum height=6cm, fill=teal!15] (rambox) at (-1.5,0) {};
    \node[black,scale=1.0] at (-1.5,2.7) {\textsf{MEMORY}};
    \node[blue,scale=0.8] at (-1.5,-2.7) {$2^{32}$ bytes $\approx 4.29$ GB};

    \node [matrix] (ram) at (-1.5,0)
    {
      \node[blue] {Address} ;&  \node[blue] {Content}; & \\
      \node { \memcellsize \texttt{0xffffffff}} ;&  \shadedraw [mem] (-0.5,.25) -- (-0.5,-.25) -- (0.5,-.25) -- (0.5,.25) -- cycle ;  & \\
      \node { \memcellsize \texttt{0xfffffffe}} ;&  \shadedraw [mem] (-0.5,.25) -- (-0.5,-.25) -- (0.5,-.25) -- (0.5,.25) -- cycle ;  & \\
      \node { \memcellsize \texttt{0xfffffffd}} ;&  \shadedraw [mem] (-0.5,.25) -- (-0.5,-.25) -- (0.5,-.25) -- (0.5,.25) -- cycle ;  & \\
      \node {$\ddots$} ;&  \node{$\ddots$}; & \\
      \node { \memcellsize \texttt{0x00000003}} ;&  \shadedraw [mem]  (-0.5,.25) -- (-0.5,-.25) -- (0.5,-.25) -- (0.5,.25) --cycle ; & \\
      \node { \memcellsize \texttt{0x00000002}} ;&  \shadedraw [mem]  (-0.5,.25) -- (-0.5,-.25) -- (0.5,-.25) -- (0.5,.25) --cycle ; & \\
      \node { \memcellsize \texttt{0x00000001}} ;&  \shadedraw [mem]  (-0.5,.25) -- (-0.5,-.25) -- (0.5,-.25) -- (0.5,.25); & \\
      \node {  \memcellsize \texttt{0x00000000}} ;& \shadedraw [mem]  (-0.5,.25) -- (-0.5,-.25) -- (0.5,-.25) -- (0.5,.25) ; & \\
    };
  \end{scope}

同样,我想将Stealth{}下面给出的选项移动到 tikz 环境的开头。


\draw[{Stealth[length=2mm, width=2mm]}-{Stealth[length=2mm, width=2mm]},thick] (iocntrl) -- (storage1);
\draw[{Stealth[length=2mm, width=2mm]}-{Stealth[length=2mm, width=2mm]},thick] (iocntrl) |- (rambox) node [near end, fill=white, text width = 1.5cm] {\footnotesize{Load/Store}};
\draw[{Stealth[length=2mm, width=2mm]}-{Stealth[length=2mm, width=2mm]},thick] (iocntrl) |- (regbox) node [near start, fill=white] {\footnotesize{syscall}};
\draw[{Stealth[length=2mm, width=2mm]}-{Stealth[length=2mm, width=2mm]},thick] (iocntrl) -- (userio);

相关内容