0

I would like to draw a simplex table as follows,

correct

I tried,

\begin{equation}
\begin{array}{cc|cccccccc|c}
           &     & x_1 & x_2  &  x_3 & s_1 & s_2 & s_3  & a_2  &  a_3  &   \\
 \text{Basis} & c_B &  12 &   18 &   10 &  0  &  0  & 0    &   -M &   -M  & \text{RHS} \\ \hline
 s_1   &  0  & 2   &  3   &   4   &  1    & 0   & 0    &   0  &  0   &  50 \\
 a_2   & -M  & 1   &  -1  &  -1   &  0    & -1  &  0   &   1  &  0   &  0  \\
 a_3   & -M  & 0   & 1    & -1.5  &  0    & 0   &-1    &   0  &  1   &  0  \\ \hline
    &     & -M  & -0   &  2.5M &  0    & M   &  M   &  -M  &  -M  &  0  \\
    &     &12+M & 18   &10-2.5M&  0    & -M  &  0   &   0  &  0   &   \\
 \end{array}
 \end{equation}

However I get, with an issue $z_j$, and $c_j-z_j$ are not in the middle of column, incorrect

edit: And how I can draw similar of this red markers on the same tableau as follows?: with markers

  • Welcome to TeX.SE. I will suggest to use also siunitx. – Sebastiano Mar 22 at 20:26
  • Regarding your recent edit: please only ask one question per question. – leandriis Mar 22 at 20:52
  • @leandriis, OK.. – Kourabi Mar 22 at 20:54
  • 1
    @Sebastiano, thank you. Is siunitx a package in LaTex? – Kourabi Mar 22 at 20:55
  • Yes now I put the link: ctan.org/pkg/siunitx. It is uses also into the tables. – Sebastiano Mar 22 at 21:00
0

In order to center z_{j} and c_{j}-z_{j} over two columns, use the \multicolumn command as shown in the following example:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{array}{cc|cccccccc|c}
           &     & x_1 & x_2  &  x_3 & s_1 & s_2 & s_3  & a_2  &  a_3  &   \\
 \text{Basis} & c_B &  12 &   18 &   10 &  0  &  0  & 0    &   -M &   -M  & \text{RHS} \\ \hline
 s_1   &  0  & 2   &  3   &   4   &  1    & 0   & 0    &   0  &  0   &  50 \\
 a_2   & -M  & 1   &  -1  &  -1   &  0    & -1  &  0   &   1  &  0   &  0  \\
 a_3   & -M  & 0   & 1    & -1.5  &  0    & 0   &-1    &   0  &  1   &  0  \\ \hline
    \multicolumn{2}{c|}{z_{j}}     & -M  & -0   &  2.5M &  0    & M   &  M   &  -M  &  -M  &  0  \\
    \multicolumn{2}{c|}{c_{j}-z_{j}}    &12+M & 18   &10-2.5M&  0    & -M  &  0   &   0  &  0   &   \\
 \end{array}
 \]
 \end{document}
| improve this answer | |
  • thank you. The command \multicolumn doesnot work with MathJax in blogspot. Is there another method? – Kourabi Mar 22 at 21:00
  • MathJax only uses a latex-like input syntax while it uses Javascript and HTML's DOM model rather than TeX technology to process this input. So, to be honest, I have no idea. – leandriis Mar 23 at 9:12
  • Html table elements have colspan and rowspan attributes, roughly corresponding to \multicolumn and \multirow. I don't think that this could answer the OP nor the mathjax problem but could help in HTML coding. – Jhor Mar 23 at 9:47

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.