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.

How to Tex a table in the form? I'm not interested in the detail of the matrix content, just interested in the form of the matrix, especially how to put the arrows and labels outside the matrix.

enter image description here

Here is what I got so far:

\left(
\begin{array}{c|c|c|ccc}
 1 & 1 & 1 & 1 & \gets & \ket{1}\\
\hline
 1 & 1 & 1 & 1 & \gets & \ket{1}\\
\hline
 1 & 1 & 1 & 1 & \gets & \ket{1}\\
\hline
 1 & 1 & 1 & 1 & \gets & \ket{1}\\
\uparrow & \uparrow & \uparrow & \uparrow & & \\
\ket{1} & \ket{1} & \ket{1} & \ket{1} & & 
\end{array}
\right)

enter image description here

share|improve this question
2  
Can you paste the table content? It's really not so fun to make an example from scratch just to try out things. And there are some duplicates on this site too. –  percusse Apr 24 '13 at 15:46
    
Would putting an array around it help? You might need \multicolumn to put the matrix in. –  Betohaku Apr 24 '13 at 15:50
1  
Welcome to TeX.sx! –  Peter Jansson Apr 24 '13 at 16:03
    
@percusse thanks for the suggestion, I've put the content. I'm very new to tex and this site, could you suggest some terms for me to search for the duplicates? Thanks. –  user0501 Apr 24 '13 at 17:53
add comment

1 Answer

up vote 5 down vote accepted

Here is a proof-of-concept using the blkarray package.

enter image description here

\documentclass{article}
\usepackage{array,blkarray}% http://ctan.org/pkg/{array,blkarray}
\begin{document}
$\begin{blockarray}{(cccc)>{\leftarrow}l}
  a & b & c & d & 1 \\
  e & f & g & h & 2 \\
  i & j & k & l & 3 \\
  \begin{block}{ccccl}
    \uparrow & \uparrow & \uparrow & \uparrow & \\
    4 & 5 & 6 & 7
  \end{block}
\end{blockarray}$
\end{document}

The idea is to define an "overlay" blockarray environment that contains the desired encompassing structure. Elements within that differ from this is constructed using the block environment. The interface is similar to that of tabular and array structures, with the benefit of being able to use array functionality (as I've done with the right-most column's \leftarrow insertion).

Any question should be directed to the package author David Carlisle in chat. He frequently solves problems regarding all his package deficiencies there... for free.

share|improve this answer
add comment

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.