TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to draw table,

correct table

I tried,

\begin{equation}
\begin{array}{c}
z \\ 
s_1 \\
s_2 \\
s_3 
\end{array}
\begin{bmatrix}
\begin{array}{c|ccccc|c}
  z & x_1 & x_2 & s_1 & s_2 & s_3 & b \\ \hline
  1 & 0 & 0 & 1.6 & 2.2 & 0 & 544 \\ \hline
  0 & 1 & 1 & 0.4 & -0.2 & 0 & 16  \\
  0 & 0 & 1 & -0.2 & 0.6 & 0 & 72 \\
  0 & 0 & 0 & -0.4 & 0.2 & 1 & 19 \\
\end{array}
\end{bmatrix}
\end{equation}

However I get, with an allignment issue on the left,

incorrect

share|improve this question
up vote 2 down vote accepted

As soon as I posted the question i realized by adding another item in the first array I could move it down,

\begin{equation}
\begin{array}{c}
\\
z \\ 
s_1 \\
s_2 \\
s_3 
\end{array}
\begin{bmatrix}
\begin{array}{c|ccccc|c}
  z & x_1 & x_2 & s_1 & s_2 & s_3 & b \\ \hline
  1 & 0 & 0 & 1.6 & 2.2 & 0 & 544 \\ \hline
  0 & 1 & 1 & 0.4 & -0.2 & 0 & 16  \\
  0 & 0 & 1 & -0.2 & 0.6 & 0 & 72 \\
  0 & 0 & 0 & -0.4 & 0.2 & 1 & 19 \\
\end{array}
\end{bmatrix}
\end{equation}

Is this the best method however?

share|improve this answer
    
It's a bit odd, in my opinion, to have the labels inside a matrix. I would advocate using a \kbordermatrix to label the columns as well as rows instead. – Ollie Ford Nov 18 '15 at 7:06

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.