如何强制大矩阵水平居中并允许其超出两个边距?

如何强制大矩阵水平居中并允许其超出两个边距?

我正在尝试让一个非常大的矩阵居中。我知道它太大了,无法放入边距内,但我仍然希望它保持当前大小。如下图所示,矩阵仅与右边距重叠,我希望它水平居中并对称地超出两个边距(例如,如果它超出右边距 1 厘米,那么它也应该超出左边距 1 厘米)。

如果可能的话,我希望解决方案array中包含环境,或者至少包含另一个环境,让我能够在矩阵内绘制水平和垂直线,如下所示:

在此处输入图片描述

我的源代码:

\documentclass[11pt, a4paper]{book}
\usepackage{makecell}
\usepackage{amsmath}
\usepackage{amssymb, amsfonts}
\usepackage{graphicx}
\usepackage{float}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{adjustbox}

\newcommand {\arraystretchdefaultl} {1.3}
\newcommand{\arraystretchdefault}{ \renewcommand {\arraystretch} {\arraystretchdefaultl} }
\arraystretchdefault

\usepackage[showframe = true]{geometry}

\begin{document}

    \begin{equation}
    \left[
        \begin{array}{c}
        V_{i} \\ \midrule[0.25mm]
        0
        \end{array}
    \right]
    %
    =
    %
    \left[
        \begin{array}{c c!{\vrule width 0.25mm} c c}
        & Z_{orig} &  & col. \medspace k - col. \medspace p \\ \Xcline{1-4}{0.25mm}
        & row. \medspace k - row. \medspace p & & Z_{th,kp}+Z_{b}\\
        \end{array}
    \right]
    %
    \left[
        \begin{array}{c}
        I_{i} \\ \midrule[0.25mm]
        I_{q}
        \end{array}
    \right]
\end{equation}


\begin{adjustbox}{width=1\textwidth, center}

    \begin{minipage}{1\textwidth}
    %
        \begin{equation}
        %
                %
                \renewcommand{\arraystretch}{1.1}
                \left[
                    \begin{array}{c}
                        V_{1} \\
                        \vdots \\
                        V_{l} \\
                        \vdots \\
                        V_{k} \\
                        \vdots \\
                        V_{p} \\
                        \vdots \\
                        \vdots \\ \midrule[0.25mm]
                        0 \\
                    \end{array}
                \right]
                =
                \renewcommand{\arraystretch}{1.1}
                \left[
                    \begin{array}{c c c c c c c c c !{\vrule width 0.25mm}c}
                        & & & & & Z_{1k} & \dotsm & Z_{1p} & \dotsm & Z_{1k} - Z_{1p} \\
                        & & \scalebox{1}{$Z_{orig}$} &  & & \vdots & & \vdots &  & \vdots \\
                        & & & & & Z_{lk} & \dotsm & Z_{lp} & \dotsm & Z_{lk} - Z_{lp} \\
                        & & &  & & \vdots & & \vdots &  & \vdots \\
                        Z_{k1} & \dotsm & \dotsm & Z_{km} & \dotsm & Z_{kk} & \dotsm & Z_{kp} & \dotsm & Z_{kk} - Z_{kp} \\
                        \vdots & & & \vdots & & \vdots & & \vdots &  & \vdots \\
                        Z_{p1} & \dotsm & \dotsm & Z_{pm} & \dotsm & Z_{pk} & \dotsm & Z_{pp} & \dotsm & Z_{pk} - Z_{pp} \\
                        \vdots & & & \vdots & & \vdots & & \vdots &  & \vdots \\
                        \vdots & & & \vdots & & \vdots & & \vdots &  & \vdots \\ \Xcline{1-10}{0.25mm}
                        Z_{k1} - Z_{p1} & \dotsm & \dotsm & Z_{km} - Z_{pm} & \dotsm & Z_{kk} - Z_{pk} & \dotsm & Z_{kp} - Z_{pp} & \dotsm & Z_{th, kp} + Z_{b} \\
                    \end{array}
                    \right]
                    \left[
                    \begin{array}{c}
                        V_{1} \\
                        \vdots \\
                        V_{l} \\
                        \vdots \\
                        V_{k} \\
                        \vdots \\
                        V_{p} \\
                        \vdots \\
                        \vdots \\ \midrule[0.25mm]
                        0 \\
                    \end{array}
                    \right]
                %
                \arraystretchdefault
        %
        \end{equation}
    %
    \end{minipage}

\end{adjustbox}




\end{document}

答案1

像这样?

在此处输入图片描述

为了在文本宽度的两侧溢出,我使用了adjustwidth包中的宏changepage。我重写了你的矩阵(使其更短以适应一列)并使用较小的字体。

\documentclass[11pt, a4paper]{book}
\usepackage{amsmath, amssymb}
\usepackage{graphicx}
\usepackage{float}
\usepackage{booktabs, makecell, tabularx}
\usepackage[strict]{changepage}

\newcommand {\arraystretchdefaultl} {1.3}
\newcommand{\arraystretchdefault}{ \renewcommand {\arraystretch} {\arraystretchdefaultl} }
\arraystretchdefault

\usepackage[showframe = true]{geometry}

\begin{document}
\begin{equation}
\left[\begin{array}{c}
    V_{i} \\ \midrule[0.25mm]
    0
\end{array}\right]
    %
    =
    %
\left[\begin{array}{c c!{\vrule width 0.25mm} c c}
    & Z_{orig} &  & col. \medspace k - col. \medspace p \\ \Xcline{1-4}{0.25mm}
    & row. \medspace k - row. \medspace p & & Z_{th,kp}+Z_{b}\\
\end{array}\right]
    %
\left[\begin{array}{c}
    I_{i} \\ \midrule[0.25mm]
    I_{q}
\end{array}\right]
\end{equation}

\begin{adjustwidth}{-3em}{-5em}
    \renewcommand{\arraystretch}{1.1}
    \small
\begin{equation}
\left[\begin{array}{c}
    V_{1}   \\
    \vdots  \\
    V_{l}   \\
    \vdots  \\
    V_{k}   \\
    \vdots  \\
    V_{p}   \\
    \vdots  \\ \Xcline{1-1}{0.25mm}
        0   \\
\end{array}\right]
    =
\left[\begin{array}{cc cc cc cc !{\vrule width 0.25mm} c}
        &        &        &        & Z_{1k} & \dotsm & Z_{1p} & \dotsm & Z_{1k} - Z_{1p}    \\
        &        &        &        & \vdots &        & \vdots &        & \vdots             \\
        &        &  Z_{orig}       
                          &        & Z_{lk} & \dotsm & Z_{lp} & \dotsm & Z_{lk} - Z_{lp}    \\
        &        &        &        & \vdots &        & \vdots &        & \vdots             \\
Z_{k1}  & \dotsm & Z_{km} & \dotsm & Z_{kk} & \dotsm & Z_{kp} & \dotsm & Z_{kk} - Z_{kp}    \\
\vdots  &        & \vdots &        & \vdots &        & \vdots &        & \vdots             \\
Z_{p1}  & \dotsm & Z_{pm} & \dotsm & Z_{pk} & \dotsm & Z_{pp} & \dotsm & Z_{pk} - Z_{pp}    \\
\vdots  &        & \vdots &        & \vdots &        & \vdots &        & \vdots             \\ \Xcline{1-9}{0.25mm}
Z_{k1} - Z_{p1}
        & \dotsm & Z_{km} - Z_{pm}
                          & \dotsm & Z_{kk} - Z_{pk}
                                            & \dotsm & Z_{kp} - Z_{pp}
                                                              & \dotsm & Z_{th, kp} + Z_{b}
\end{array}\right]
%
\left[\begin{array}{c}
    V_{1}   \\
    \vdots  \\
    V_{l}   \\
    \vdots  \\
    V_{k}   \\
    \vdots  \\
    V_{p}   \\
    \vdots  \\ \Xcline{1-1}{0.25mm}
        0   \\
\end{array}\right]
        \end{equation}
            \arraystretchdefault
\end{adjustwidth}
\end{document}

相关内容