2

I took the answer from the following question: proportional boxes in Tikz (array diagram) I had no problem until now, it compiled without any problem, however I just updated Ubuntu and it does not compile anymore. I am getting the following error

\begin{scope} on input line 9 ended by \end{tikzpicture}. \end{tikzpicture} (followed by: )

Extra }, or forgotten \endgroup. ...e[MyStyle, on chain] (vlos\xi) {$\name$};} (followed by: )  

I tried to update the latex but at the moment the repository is frozen. How can I fix this?

\tikzset{
    MyStyle/.style={draw, text width=25pt, text height=10pt, text centered,minimum height=\heightof{$n-2$}+2*2*1mm)},
    myarrow/.style={shape=single arrow, rotate=90, inner sep=5pt, outer sep=0pt, 
                    single arrow head extend=0pt, minimum height=7.5pt, text width=0pt, draw=blue!50, fill=blue!25}

}

\begin{tikzpicture}[-{Stealth[length=2.5pt]}]
\begin{scope} [start chain, node distance=-.5pt]  
  \foreach \name [count=\xi] in {1,2,3,\cdots,k,\cdots,n-k, \cdots,
  n-2,n-1,n}{ \node[MyStyle, on chain] (vlos\xi) {$\name$};}
 \end{scope}
\node[above= 0.1cm of vlos1, xshift=-0.5cm]{$u_{los}$};

\draw [decorate,decoration={brace,amplitude=10pt,mirror}]
  (vlos7.south west) -- (vlos11.south east) node[black,midway,below=8pt]
  {Removed data};
\end{tikzpicture}
\begin{tikzpicture}[
    -{Stealth[length=2.5pt]}
  ]
\begin{scope} [start chain, node distance=-.5pt]  
  \foreach \name [count=\xi] in {1,2,3,\cdots,k,\cdots,n-k, \cdots,
  n-2,n-1,n}{ \node[MyStyle, on chain] (vlos\xi) {$\name$};
  }
 \end{scope}
\node[above= 0.1cm of vlos1, xshift=-0.5cm]{$u_{bef}$};

\draw [decorate,decoration={brace,amplitude=10pt,mirror}]
  (vlos1.south west) -- (vlos5.south east) node[black,midway,below=8pt]
  {Removed data};
\end{tikzpicture}
2
3

Replacing \heightof with something defined and loading the required TikZ libraries, the code compiles just fine.

modified code

\documentclass[border=10pt,tikz,multi]{standalone}
\usetikzlibrary{arrows.meta,shapes.arrows,chains,decorations.pathreplacing}
\begin{document}
\newlength\myht
\settoheight{\myht}{$n-2$}
\tikzset{%
  MyStyle/.style={draw, text width=25pt, text height=10pt, text centered,minimum height=\myht+2*2*1mm)},
  myarrow/.style={shape=single arrow, rotate=90, inner sep=5pt, outer sep=0pt, single arrow head extend=0pt, minimum height=7.5pt, text width=0pt, draw=blue!50, fill=blue!25}
}

\begin{tikzpicture}[-{Stealth[length=2.5pt]}]
  \begin{scope} [start chain, node distance=-.5pt]
    \foreach \name [count=\xi] in {1,2,3,\cdots,k,\cdots,n-k, \cdots,
      n-2,n-1,n}{ \node[MyStyle, on chain] (vlos\xi) {$\name$};}
  \end{scope}
  \node[above= 0.1cm of vlos1, xshift=-0.5cm]{$u_{los}$};

  \draw [decorate,decoration={brace,amplitude=10pt,mirror}]
  (vlos7.south west) -- (vlos11.south east) node[black,midway,below=8pt]
  {Removed data};
\end{tikzpicture}
\begin{tikzpicture}[
  -{Stealth[length=2.5pt]}
  ]
  \begin{scope} [start chain, node distance=-.5pt]
    \foreach \name [count=\xi] in {1,2,3,\cdots,k,\cdots,n-k, \cdots,
      n-2,n-1,n}{ \node[MyStyle, on chain] (vlos\xi) {$\name$};
    }
  \end{scope}
  \node[above= 0.1cm of vlos1, xshift=-0.5cm]{$u_{bef}$};

  \draw [decorate,decoration={brace,amplitude=10pt,mirror}]
  (vlos1.south west) -- (vlos5.south east) node[black,midway,below=8pt]
  {Removed data};
\end{tikzpicture}
\end{document}
2
  • (i) is the arrow on the right end of braces intentional? (ii) in TikZ manual is text centered used only in section "27. Using Graph Drawing in TikZ", for other nodes is used align=center ... what is more correct?
    – Zarko
    Apr 23 '16 at 5:48
  • (i) I don't know. You'd have to ask the OP ;). (ii) I'm not sure either is more correct but the mention in the discussion of graphs mentions text centered as an example of an ordinary option understood by TikZ and not as an option specific to graphs.
    – cfr
    Apr 23 '16 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.