1

i try to draw a split rectangle like this:

enter image description here

And this is my current state :/ Any ideas?

enter image description here

2 Answers2

3

An alternative using stacks.

\documentclass{article}
\usepackage{xcolor}
\usepackage{stackengine}
\begin{document}
\setstackgap{L}{1.6\baselineskip}
\fcolorbox{black}{gray!40}{\ensurestackMath{\Centerstack{\,x_1\, x_2 {} {\vdots} {} x_n}}}
\end{document}

enter image description here

2

On this task you can use the tikz package along with the array environment, if you don't need some inside/outside ticks in it. If you do, there are better ways how to get them.

\documentclass[a4paper]{article}
\pagestyle{empty}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node[draw=blue, fill=blue!30, line width=2pt]
  {\def\arraystretch{1.5}%
  $\begin{array}{c}
  x_1\\ x_2\\[9pt] \vdots\\[6pt] x_n
  \end{array}$};
\end{tikzpicture}
\end{document}

MWE

Malipivo
  • 13,287