1

I have constructed the following table:

enter image description here

To do so, I used the following code:

begin{equation*}
    \begin{array}{c|ccc|c}
        & & & & \overline{b} \\ \hline
        x_5 & 1 & 0 & 0 & 0 \\
        x_6 & 0 & 1 & 0 & 0 \\
        x_7 & 0 & 0 & 1 & 1\\ \hline
        z & 0 & 0 & 0 & 0
    \end{array}     
    \hspace{2cm}
    \begin{array}{|c|}
    x_1 \\ \hline
    \fbox{$0.5$} \\
    0.5 \\ 
    1 \\ \hline 
    10
    \end{array}
\end{equation*}

But I really would like to add some further spacing in the tables, making it look bigger, i.e., make them look like this:

enter image description here

What change would I have to make to my code to get the result I want? Thanks for any help in advance!

UPDATE. I was able to extend my tables further horizantally using the command \arraycolsep = 12pt. How would one make the lines look darker like in the image I posted? The current state is the following: enter image description here

1 Answer 1

2

You can locally change the value of \arraycolsep:

\documentclass{article}
\usepackage{amsmath,array}

\begin{document}

\begin{equation*}
  \setlength{\arraycolsep}{12pt}
  \newcommand{\FILLER}{\begin{matrix} 0 & 0 & 0 \end{matrix}}
  \begin{array}[t]{c|ccc|c}
  & & & & \bar{b} \\
  \hline
  x_5 & 1 & 0 & 0 & 0 \\
  x_6 & 0 & 1 & 0 & 0 \\
  x_7 & 0 & 0 & 1 & 1\\
  \hline
  z & 0 & 0 & 0 & 0 \\[-0.8\normalbaselineskip]
  & \multicolumn{3}{c|}{\underbrace{\hphantom{\FILLER}}_{w^1}} & \\
  \end{array}
  \qquad
  \setlength{\arraycolsep}{3pt}
  \begin{array}[t]{|ccc|}
  & x_1 & \\
  \hline
  & \multicolumn{1}{|c|}{0.5} & \\
  \cline{2-2}
  & 0.5 & \\ 
  & 1 & \\
  \hline 
  & 10 &
  \end{array}
\end{equation*}

\end{document}

enter image description here

For thicker lines, add something like

\setlength{\arrayrulewidth}{0.8pt}

to get

enter image description here

9
  • I figured it out just now! Thanks for the help! Doyou know how to make the lines look darker? Just like in the picture I originally posted? @egreg
    – Rodrigo
    Commented Jan 4, 2022 at 16:31
  • @Seabourn Added.
    – egreg
    Commented Jan 4, 2022 at 16:32
  • It's not changing anything for me... Am I doing something wrong? Here is my code: \begin{equation*} \setlength{\arraycolsep}{12pt} \setlength{\arrayrulewidth}{0.8pt} \begin{array}{c|ccc|c} & & & & \overline{b} \\ \hline x_5 & 1 & -9 & 0 & 0 \\ x_4 & 0 & 1 & 0 & 0 \\ x_7 & 0 & 0 & 1 & 1\\ \hline z & 10.5 & -70.5 & 0 & 0 \end{array} \hspace{2cm} \begin{array}{|c|} x_6 \\ \hline -9 \\ \fbox{$4$} \\ 0 \\ \hline 24 \end{array} \end{equation*}
    – Rodrigo
    Commented Jan 4, 2022 at 16:37
  • @Seabourn Try with 6pt instead of 0.8pt: does it produce very thick rules?
    – egreg
    Commented Jan 4, 2022 at 16:39
  • Still doesn't change
    – Rodrigo
    Commented Jan 4, 2022 at 16:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .