7

everybody. I was trying to compile a block matrix whose first line has a part that should be centered in that part of the line.

My closest attempt is the code:

\begin{align}
\mathbf{\hat{F}}_{11}^{(1)-1}
= 
\left[
\begin{array}{c|cc}
0 & \mathbf{1}_{10}& \\
\hline
\mathbf{1}_{10} 
 & 
\mathbf{M}_{11}^{(1)} & 
\mathbf{M}_{11}^{(1)\ast}\mathbf{\bar{I}}_{5} \\
&
\mathbf{\bar{I}}_{5}\mathbf{M}_{11}^{(1)H} &
\mathbf{\bar{I}}_{5}\mathbf{M}_{11}^{(1)}\mathbf{\bar{I}}_{5}\\
\end{array}
\right]
\end{align}

which produce the result:

enter image description here

Ideally, the element $1_{10}$ should be centered in both, line 1 and column 1. Any trick?

Thank you!! :)

4
  • 1
    Welcome to TeX.SE! You could write \multicolumn{2}{c}{$\mathbf{1}_{10}$} to make $\mathbf{1}_{10}$` straddle columns 2 and 3. Commented May 14, 2014 at 20:08
  • @Mico: The \multicolumn needs to be without the $. Commented May 14, 2014 at 20:14
  • Nice! Thanks @Mico. It works very good. That trick is as simple as useful. Commented May 14, 2014 at 20:19
  • @PeterGrill - Thanks for catching the mistake. I'll post a full answer to mention the correct setup. Commented May 14, 2014 at 20:21

2 Answers 2

4

I suggest you use \multicolumn{2}{c}{...} to make the \mathbf{1}_{10} in the first row straddle columns 2 and 3. You may also want to load the multirow package and use an instruction such as \multirow{2}{*}{$\mathbf{1}_{10}$} so that the second \mathbf{1}_{10} straddles rows 2 and 3. (Incidentally, should that second \mathbf{1}_{10} term get a transpose symbol attached to it?)

enter image description here

\documentclass{article}
\usepackage{multirow}  % for `\multirow` macro
\begin{document}
\begin{equation}
\hat{\mathbf{F}}_{11}^{(1)-1}
= 
\left[
\begin{array}{c|cc}
0 & \multicolumn{2}{c}{\mathbf{1}_{10}} \\
\hline
\multirow{2}{*}{$\mathbf{1}_{10}$}
 & 
\mathbf{M}_{11}^{(1)} & 
\mathbf{M}_{11}^{(1)\ast}\bar{\mathbf{I}}_{5} \\
&
\bar{\mathbf{I}}_{5}\mathbf{M}_{11}^{(1)H} &
\bar{\mathbf{I}}_{5}\mathbf{M}_{11}^{(1)}\bar{\mathbf{I}}_{5}\\
\end{array}
\right]
\end{equation}
\end{document}
1

With {pNiceArray} of nicematrix.

\documentclass{article}
\usepackage{nicematrix}

\begin{document}
\begin{equation}
\hat{\mathbf{F}}_{11}^{(1)-1}
= 
\begin{bNiceArray}{c|cc}[margin]
0 & \Block{1-2}{\mathbf{1}_{10}} \\
\hline
\Block{2-1}{\mathbf{1}_{10}}
 & 
\mathbf{M}_{11}^{(1)} & 
\mathbf{M}_{11}^{(1)\ast}\bar{\mathbf{I}}_{5} \\
&
\bar{\mathbf{I}}_{5}\mathbf{M}_{11}^{(1)H} &
\bar{\mathbf{I}}_{5}\mathbf{M}_{11}^{(1)}\bar{\mathbf{I}}_{5}\\
\end{bNiceArray}
\end{equation}

\end{document}

You need several compilations (because nicematrix uses PGF/TikZ nodes under the hood).

Output of the above code

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.