我有以下代码:
\begin{figure}[h!]
\centering
\bordermatrix{~& \ket{\Phi_{0}} & \ket{S} & \ket{D} & \ket{T} & \ket{Q} & \dots \cr
\bra{\Phi_{0}} & E_{0} & \textbf{0} & \dirint{\Phi_{0}}{\hat{H}}{D} & \textbf{0} & \textbf{0} & \dots \cr
\bra{S} & & \dirint{S}{\hat{H}}{S} & \dirint{S}{\hat{H}}{D} & \dirint{S}{\hat{H}}{T} & \textbf{0} & \dots \cr
\bra{D} & & & \dirint{D}{\hat{H}}{D} & \dirint{D}{\hat{H}}{T} & \dirint{D}{\hat{H}}{Q} & \dots \cr
\bra{T} & & & & \dirint{T}{\hat{H}}{T} & \dirint{T}{\hat{H}}{Q} & \dots \cr
\bra{Q} & & & & & \dirint{Q}{\hat{H}}{Q} & \dots \cr
\vdots & & & & & & \ddots \cr}
\caption{Structure of the full-CI matrix. The matrix is hermitian, therefore, only the
upper triangle is shown. The multitudes of singly, doubly, triply, etc. excited determinants
are denoted as \ket{S}, \ket{D}, \ket{T}, etc.}
\label{fig:FCI_mat}
\end{figure}
它可以编译,但矩阵未居中。实际上,删除\centering
不会改变矩阵的位置 - 它保持左对齐。有人知道如何将其置于中心吗?
谢谢!
答案1
放进\bordermatrix
去
\[
\]
并使其成为显示方程。
\documentclass{article}
\usepackage{amsmath,braket}
\newcommand{\dirint}{\int} %% just for compiling, change it in your file
\begin{document}
\begin{figure}[h!]
\[
\bordermatrix{~& \ket{\Phi_{0}} & \ket{S} & \ket{D} & \ket{T} & \ket{Q} & \dots \cr
\bra{\Phi_{0}} & E_{0} & \textbf{0} & \dirint{\Phi_{0}}{\hat{H}}{D} & \textbf{0} & \textbf{0} & \dots \cr
\bra{S} & & \dirint{S}{\hat{H}}{S} & \dirint{S}{\hat{H}}{D} & \dirint{S}{\hat{H}}{T} & \textbf{0} & \dots \cr
\bra{D} & & & \dirint{D}{\hat{H}}{D} & \dirint{D}{\hat{H}}{T} & \dirint{D}{\hat{H}}{Q} & \dots \cr
\bra{T} & & & & \dirint{T}{\hat{H}}{T} & \dirint{T}{\hat{H}}{Q} & \dots \cr
\bra{Q} & & & & & \dirint{Q}{\hat{H}}{Q} & \dots \cr
\vdots & & & & & & \ddots \cr}
\]
\caption{Structure of the full-CI matrix. The matrix is hermitian, therefore, only the
upper triangle is shown. The multitudes of singly, doubly, triply, etc. excited determinants
are denoted as $\ket{S}$, $\ket{D}$, $\ket{T}$, etc.}
\label{fig:FCI_mat}
\end{figure}
\end{document}