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.

This question already has an answer here:

The following matrix is of size $10 \times 10$, however it is representing an $m \times m$ matrix. Hence I need to signify that the first five columns represent terms $0$ to $\frac{m}{2} - 1$ and the second five columns represent terms $\frac{m}{2}$ to $m$. I have an attached an image of what I need to represent.

\documentclass[a4paper,12pt,times,numbered,print,index]{article}   
\RequirePackage[left=37mm,right=30mm,top=35mm,bottom=30mm]{geometry}
\RequirePackage{libertine} 
\RequirePackage[small,bf,labelsep=space,
    tableposition=top]{caption} 
\usepackage{multirow}  
\usepackage{subfig,amsfonts,amsmath,amssymb,braket}
\usepackage{algorithm}% http://ctan.org/pkg/algorithms
\usepackage{algpseudocode}% http://ctan.org/pkg/algorithmicx

\begin{document}

$$
H_{ab}=
\begin{bmatrix}
    1           & 1         & 0         & \dots     & \dots     & 0         &  0        & 0         & \dots     & 0 \\
    0           & 0         & 0         & \dots     & \dots     & 1         & -1        & 0         & \dots     & \vdots \\
    \vdots      & \dots     & \dots     & \dots     & \dots     & 0         & 0         & 0         & \dots     & \vdots \\
    \vdots      & \dots     & \dots     & \dots     & \dots     & \dots     & \dots     & \dots     & \dots     & \vdots \\
    0           & \dots     & \dots     & \dots     & \dots     & \dots     & \dots     & \dots     & \dots     & 0 \\ 
\end{bmatrix}
$$
\end{document}

enter image description here

Does anyone have any idea how I could represent this in LaTeX? If it is not possible to get it to display exactly like in the image I don't mind, I am just looking for a way to represent th e information in the image as clearly as possible. Anyone know how to accomplish this?

share|improve this question

marked as duplicate by Peter Grill, Heiko Oberdiek, egreg, Werner, percusse Apr 5 at 17:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Please see Why is \[\] preferable to $$? –  Werner Apr 5 at 17:53

1 Answer 1

up vote 3 down vote accepted

This is just a manual placement of the respective braces in a nested array:

enter image description here

\documentclass{article}   
\usepackage{amsmath,amssymb,array,graphicx}
\newcolumntype{C}[1]{>{\centering\arraybackslash$}p{#1}<{$}}

\begin{document}

\[
  \begin{array}{@{}r@{}}
    \overbrace{\begin{array}{@{}*{5}{C{1.5em}}@{}}
      &&&&
    \end{array}}^{\text{Columns: $0$ to $m/2-1$}}
    \overbrace{\begin{array}{@{}*{5}{C{1.5em}}@{}}
      &&&&
    \end{array}}^{\text{Columns: $m/2$ to $m$}} \hspace*{25pt}\\[-.5\normalbaselineskip]
  H_{ab} = 
  \left.\hspace*{-\nulldelimiterspace}
    \left[\begin{array}{@{}*{10}{C{1.5em}}@{}}
      1           & 1         & 0         & \cdots     & \cdots     & 0         &  0        & 0         & \cdots     & 0 \\
      0           & 0         & 0         & \cdots     & \cdots     & 1         & -1        & 0         & \cdots     & \vdots \\
      \vdots      & \cdots     & \cdots     & \cdots     & \cdots     & 0         & 0         & 0         & \cdots     & \vdots \\
      \vdots      & \cdots     & \cdots     & \cdots     & \cdots     & \cdots     & \cdots     & \cdots     & \cdots     & \vdots \\
      0           & \cdots     & \cdots     & \cdots     & \cdots     & \cdots     & \cdots     & \cdots     & \cdots     & 0 \\ 
    \end{array}\right]\right\} \rotatebox[origin=c]{-90}{\scriptsize Rows: $0$ to $m$}
  \end{array}
\]
\end{document}
share|improve this answer
1  
...had been working on this for 10 minutes after I saw the duplicate. :-| –  Werner Apr 5 at 17:36
    
Appreciate it, very nice! –  sonicboom Apr 5 at 18:23

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