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.

I have a large n x n matrix I'm trying to typeset. My current code is as follows:

$\left(\begin{array}{c|ccc}
1 & c_2 & \cdots & c_n \\
\hline
0  & \multicolumn{3}{c}{\multirow{3}{*}{\Huge{$A$}}} \\
\vdots & & &\\
0 & & & 
\end{array}\right)$

The output is currently terrible in a number of ways. First, the large block A matrix (which is supposed to be an (n-1) x (n-1) submatrix) is not centered properly. Second, the vertical dots on the left hand side are not properly vertically centered. Third, it is just visually unappealing in a way that I can't quite put my finger on.

Does anyone have any suggestions on how to typeset this in a better manner?

share|improve this question
add comment

3 Answers

up vote 8 down vote accepted

Another option would be to use a two-column array:

\documentclass{article}

\begin{document}

\[
\left(
\begin{array}{c|c}
  1 & c_2 \cdots c_n \\ \hline
  0 & \raisebox{-15pt}{{\huge\mbox{{$A$}}}} \\[-4ex]
  \vdots & \\[-0.5ex]
  0 &
\end{array}
\right)
\]

\end{document}

enter image description here

share|improve this answer
add comment

Although there are some personal preferences built into this question (and therefore some subjectivity), I have some suggestions.

You can play around with the vertical alignment using the graphicx package command \raisebox{<height>}{<stuff>}:

\usepackage{multirow}% http://ctan.org/pkg/multirow
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
...
\[
  \left(\begin{array}{c|ccc}
    1 & c_2 & \cdots & c_n \\ \hline
    0  & \multicolumn{3}{c}{\multirow{3}{*}{\raisebox{-7mm}{\scalebox{2}{$[A]$}}}} \\
    \raisebox{2pt}{\vdots} & & &\\
    0 & & & 
  \end{array}\right)
\]

enter image description here

I've also added some brackets around the inner matrix A to accentuate the fact that it could be considered a matrix. The size of the inner/sub-matrix has also been set using \scalebox{<factor>}{<stuff>} from the graphicx package, since \Huge is a textmode font command. Using colour for certain parts of the matrix may also highlight the scope of the matrix. In the example below, cells within the array were coloured using 10% black (via black!10):

\usepackage{xcolor}% http://ctan.org/pkg/xcolor
\usepackage{colortbl}% http://ctan.org/pkg/colortbl
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
...
\[
  \left(\begin{array}{c|ccc}
    1 & c_2 & \cdots & c_n \\ \hline
    0  & \multicolumn{3}{c}{\cellcolor{black!10}} \\
    \raisebox{2pt}{\vdots} & \multicolumn{3}{c}{\cellcolor{black!10}\scalebox{2}{$[A]$}} \\
    0 & \multicolumn{3}{c}{\cellcolor{black!10}}
  \end{array}\right)
\]

enter image description here

At lower resolution the coloured matrix may should some problems. However, this should only be visible in your viewer and not the actual print.

Alignment of the brackets around the matrix can also be adjusted, but I'm not sure whether this is part of the "can't quite put my finger on [it]" part.

share|improve this answer
add comment

Probably, it is not the best solution. However, you might also try to put array inside another array. In your case it is

\[
\left(
\begin{array}{c|c}
  1 & \begin{array}{ccc} c_2 & \cdots & c_n \end{array} \\ \hline
\begin{array}{c} 0 \\ \vdots \\ 0 \end{array}  & {\Huge{A}}
\end{array}
\right)
\]

The spacing is not optimal in this case, however.

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.