Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
    
Not necessarily a rectangle split is the best approach; for your purpose, I think you can get some insights from How to draw a thin rectangle. –  Claudio Fiandrino Mar 20 at 7:58
1  
And what is the code of your current state? –  Stefan Kottwitz Mar 20 at 8:00
4  
Add rectangle split draw splits=false to splitted node options –  Ignasi Mar 20 at 8:24
    
Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Benedikt Bauer Mar 20 at 8:32

2 Answers 2

up vote 3 down vote accepted

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

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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