![有人可以修复这个怪物吗](https://linux22.com/image/292767/%E6%9C%89%E4%BA%BA%E5%8F%AF%E4%BB%A5%E4%BF%AE%E5%A4%8D%E8%BF%99%E4%B8%AA%E6%80%AA%E7%89%A9%E5%90%97.png)
\begin{pmatrix}
m_{1+}\hat{p}_{1H}\hat{q}_{1H} & \multicolumn{2}{c}{\text{\kern0.5em\smash{\raisebox{-1ex}{\Large 0}}}} & \multicolumn{1}{|c}{m_{12}\hat{p}_{1H}\hat{q}_{1H}} \\
& \ddots & &\multicolumn{1}{|c}{\vdots}\\
\multicolumn{2}{c}{\text{\kern-0.5em\smash{\raisebox{0.75ex}{\Large 0}}}} & m_{I+}\hat{p}_{IH}\hat{q}_{IH} & \multicolumn{1}{|c}{m_{I2}\hat{p}_{IH}\hat{q}_{IH}} \\
\cline{1-5} \\ m_{12}\hat{p}_{1H}\hat{q}_{1H} & \hdots & m_{I2}\hat{p}_{IH}\hat{q}_{IH} & \multicolumn{1}{|c}{\sum_{i=1}^I m_{i2}\hat{p}_{iH}\hat{q}_{iH}}
\end{pmatrix}
我要这个:
我有这个:
答案1
这是我做的……
我没有使用pmatrix
,但是使用了array
环境和multirow
包将 0 放在 2 行中...我认为这样更好...
以下是我得到的:
以下是 MWE:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath, amsthm, amssymb, amsfonts}
\usepackage{multirow}
\renewcommand\arraystretch{1.5} % To increase the spaces between rows...
\begin{document}
\[
\left( \begin{array}{ccc|c}
m_{1+}\hat{p}_{1H}\hat{q}_{1H} & & \multirow{2}{*}{\Large 0} & m_{12}\hat{p}_{1H}\hat{q}_{1H} \\
\multirow{2}{*}{\Large 0} & \ddots & & \vdots\\
& & m_{I+}\hat{p}_{IH}\hat{q}_{IH} & m_{I2}\hat{p}_{IH}\hat{q}_{IH} \\ \hline
m_{12}\hat{p}_{1H}\hat{q}_{1H} & \hdots & m_{I2}\hat{p}_{IH}\hat{q}_{IH} & \displaystyle{\sum_{i=1}^I m_{i2}\hat{p}_{iH}\hat{q}_{iH}}
\end{array}
\right)
\]
\end{document}
我希望它有帮助...
PS:displaystyle
最后一个单元格中的选项是强制 LaTeX 像在经典数学模式下一样编写表达式...
答案2
我会远离那个怪物,而是选择
\documentclass[]{article}
\usepackage{mathtools}
\DeclarePairedDelimiter{\diagfences}{(}{)}
\newcommand{\diag}{\operatorname{diag}\diagfences}
\begin{document}\noindent
Let $a$ be the vector and m be the diagonal matrix given by
\[
a = \begin{pmatrix}\hat{p}_{1H}\hat{q}_{1H} & \ldots & \hat{p}_{IH}\hat{q}_{IH}\end{pmatrix}^T
\!\!,\ \ m = \diag{m_{12},\ldots,m_{I2}},
\]
then the info matrix $A$ is given by
\[
A = \begin{pmatrix}m+\diag{a}&ma\\ (ma)^T &\;\ \|ma\|_1\end{pmatrix}
\]
\end{document}
由于 Aditya 的建议,这里和那里做了一些微小的调整。