3

I have this array which is perfect, but i need to add some additional content to it, but i'm extremely uncertain about how to approach this addon.

Here is my working code:

\[
  \begin{array}{c| *{4}{C{2em}}}
    & \multicolumn{1}{c}{>} & =\joinrel+ & =\joinrel- & \multicolumn{1}{c}{<} \\
    \hline
    > & 1 & 1 & 0 & 0 \\
    =\joinrel+ & 1 & 1 & 0 & 0 \\
    =\joinrel- & 0 & 0 & 1 & 1 \\
    < & 0 & 0 & 1 & 1
  \end{array}
\]

And the result:

enter image description here

I would like to add following to this array based on this example (does not have to be exactly this example, but something close enough):

enter image description here

  • You could make an array of subarrays. – John Kormylo Sep 17 '14 at 0:22
3

array

\documentclass{article}
\usepackage{array}
\newcolumntype{C}[1]{>{\centering\arraybackslash$}p{#1}<{$}}
\usepackage{graphicx}% for \rotatebox

\newsavebox{\tempbox}
\newlength{\tempwidth}
\newlength{\tempheight}

\begin{document}
%calculate size of left brace and overbrace
\savebox{\tempbox}{$\begin{array}{@{}C{2em}C{2em}C{2em}C{2em}@{}}
    1 & 1 & 0 & 0 \\
    1 & 1 & 0 & 0 \\
    0 & 0 & 1 & 1 \\
    0 & 0 & 1 & 1
  \end{array}$}
\settoheight{\tempheight}{\usebox{\tempbox}}
\settowidth{\tempwidth}{\usebox{\tempbox}}

\[
  \begin{array}{cc|c}
    \multicolumn{2}{c}{} & \textrm{text}\\
    \multicolumn{2}{c}{} & \overbrace{\rule{\tempwidth}{0pt}} \\
    && \begin{array}{@{}C{2em}C{2em}C{2em}C{2em}@{}} > & =\joinrel+ & =\joinrel- & < \end{array} \\
    \cline{2-3}
    \rotatebox[origin=c]{90}{text}\left\lbrace\rule{0pt}{\tempheight}\right. &
    \begin{array}{@{}c@{}} > \\ =\joinrel+ \\ =\joinrel- \\ < \end{array} &
    \usebox{\tempbox}
  \end{array}
\]
\end{document}

One could also use \resizebox and \rotatebox to create the large braces.

  • Spot on! Works exactly as intended :-) – JavaCake Sep 17 '14 at 6:24
  • One last thing, how do i make the vertical and horizontal line in the array thick? I dont see any | in the declaration.. – JavaCake Sep 17 '14 at 6:28
  • 1
    It's there, in the first array after the start of the equation. – John Kormylo Sep 17 '14 at 12:03

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.