4

The output I get

enter image description here

The output I want is the same except that the brackets of the Z_bus matrix should stretch to contain phantom content of array environment as follows

enter image description here

Clearly, I can use \phantom and define the array I need inside it, but after try to write the visible content \bar{\mathnormalbold{Z}}_{bus}, the content starts stretching further.

My MWE

\documentclass{book}


    % ========== Table packages ==========
    \usepackage{tabularx}
% BEGIN_FOLD

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

% END_FOLD

    \usepackage{booktabs}
    \usepackage{makecell}


    % ========== Equations and math packages ==========
    \usepackage{amsmath}
    \usepackage{amssymb, amsfonts}
    \usepackage{mathtools}
    \usepackage[defaultmathsizes, italic, eulergreek, symbolre, symbolmisc]{mathastext}


\begin{document}

\begin{align}
    \left[
        \begin{array}{c}
            \mathnormalbold{V}_{G}
            \\
        %
            \Xhline{0.25mm}
            V_{R, \thinspace i}
        %
            \\
            V_{R, \thinspace j}
        \end{array}
    \right] &=
%
    \left[
        \begin{array}{c !{\vrule width 0.25mm}c c}
            \bar{\mathnormalbold{Z}}_{GG} & \bar{\mathnormalbold{Z}}_{GR_{i}} & \bar{\mathnormalbold{Z}}_{GR_{j}}
        \\
            \Xhline{0.25mm}
        %
            \bar{\mathnormalbold{Z}}_{R_{i}G} & \bar{Z}_{RR, \thinspace ii} & \bar{Z}_{RR, \thinspace ij}
        %
        \\
            \bar{\mathnormalbold{Z}}_{R_{j}G} & \bar{Z}_{RR, \thinspace ij} & \bar{Z}_{R, \thinspace jj}
        \end{array}
    \right]
    %
    \left[      
        \begin{array}{c}
            \bar{\mathnormalbold{I}}_{G}
        \\
        \Xhline{0.25mm}
        %
            \bar{I}_{R, \thinspace i}
        \\
        %
            \bar{I}_{R, \thinspace j}
        \end{array}
    \right]
\label{eq:op_imp_load_RER_int_op}
\\
\intertext{where}
\bar{\mathnormalbold{Z}}_{bus} &=
    \left[
        \begin{array}{c !{\vrule width 0.25mm}c c}
            \bar{\mathnormalbold{Z}}_{GG} & \bar{\mathnormalbold{Z}}_{GR_{i}} & \bar{\mathnormalbold{Z}}_{GR_{j}}
        \\
        \Xhline{0.25mm}
        %           
            \bar{\mathnormalbold{Z}}_{R_{i}G} & \bar{Z}_{RR, \thinspace ii} & \bar{Z}_{RR, \thinspace ij}
        \\
        %
            \bar{\mathnormalbold{Z}}_{R_{j}G} & \bar{Z}_{RR, \thinspace ij} & \bar{Z}_{R, \thinspace jj}
        \end{array}
    \right]
\label{eq:Z_bus_hat_def}
\end{align}

\end{document}
0

Feel free to use wider rules (I don't think you should). I removed mathastext that yields a painful result.

\documentclass{book}
\usepackage{amsmath,bm}

\newcommand{\bigarraystretch}{\renewcommand{\arraystretch}{1.3}}

\begin{document}

\begingroup\bigarraystretch
\newcommand{\Zbus}{%
  \begin{array}{@{} c | c c @{}}
    \bar{\bm{Z}}_{GG} & \bar{\bm{Z}}_{GR_{i}} & \bar{\bm{Z}}_{GR_{j}} \\
    \hline
    \bar{\bm{Z}}_{R_{i}G} & \bar{Z}_{RR,ii} & \bar{Z}_{RR,ij} \\
    \bar{\bm{Z}}_{R_{j}G} & \bar{Z}_{RR,ij} & \bar{Z}_{R,jj}
  \end{array}%
}
\begin{align}
\left[\begin{array}{@{}c@{}}
  \bm{V}_{G} \\
  \hline
  V_{R,i} \\
  V_{R,j}
\end{array}\right]
&=
\begin{bmatrix}
\vphantom{\Zbus}
\ooalign{\hphantom{$\Zbus$}\cr\hfil$\bar{\bm{Z}}_{\mathrm{bus}}$\hfil\cr}
\end{bmatrix}
\left[\begin{array}{@{} c @{}}
  \bar{\bm{I}}_{G} \\
  \hline
  \bar{I}_{R,i} \\
  \bar{I}_{R,j}
\end{array}\right]
\label{eq:op_imp_load_RER_int_op}
\\
\intertext{where}
\bar{\bm{Z}}_{\mathrm{bus}} &= \left[\Zbus\right]
\label{eq:Z_bus_hat_def}
\end{align}
\endgroup

\end{document}

The idea is to save the contents of the Zbus matrix and to use \ooalign to superimpose the symbol over the horizontal space taken by the matrix, with the vertical space before it to set the size of the brackets.

enter image description here

2

Here is a solution with saveboxes:

\documentclass{book}


    % ========== Table packages ==========
    \usepackage{tabularx}
% BEGIN_FOLD

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

% END_FOLD

    \usepackage{booktabs}
    \usepackage{makecell}


    % ========== Equations and math packages ==========
    \usepackage{amsmath}
    \usepackage{amssymb, amsfonts}
    \usepackage{mathtools}
    \usepackage[defaultmathsizes, italic, eulergreek, symbolre, symbolmisc]{mathastext}

\newsavebox{\mybox}
\newsavebox{\mysbox}
\begin{document}

\begin{align}
    \left[
        \begin{array}{c}
            \mathnormalbold{V}_{G}
            \\
        %
            \Xhline{0.25mm}
            V_{R, \thinspace i}
        %
            \\
            V_{R, \thinspace j}
        \end{array}
    \right] &=
%
    \left[
        \savebox{\mybox}{\hbox{\(\begin{array}{c !{\vrule width 0.25mm}c c}
            \bar{\mathnormalbold{Z}}_{GG} & \bar{\mathnormalbold{Z}}_{GR_{i}} & \bar{\mathnormalbold{Z}}_{GR_{j}}
        \\
            \Xhline{0.25mm}
        %
            \bar{\mathnormalbold{Z}}_{R_{i}G} & \bar{Z}_{RR, \thinspace ii} & \bar{Z}_{RR, \thinspace ij}
        %
        \\
            \bar{\mathnormalbold{Z}}_{R_{j}G} & \bar{Z}_{RR, \thinspace ij} & \bar{Z}_{R, \thinspace jj}
        \end{array}\)}}\savebox{\mysbox}{\hbox{\(\bar{Z}_{bus}\)}}
        \vphantom{\usebox{\mybox}}\hspace{\dimexpr(\dimexpr\wd\mybox/2)-\dimexpr(\wd\mysbox/2)}\usebox{\mysbox}\hspace{\dimexpr(\dimexpr\wd\mybox/2)-\dimexpr(\wd\mysbox/2)}
    \right]
    %
    \left[      
        \begin{array}{c}
            \bar{\mathnormalbold{I}}_{G}
        \\
        \Xhline{0.25mm}
        %
            \bar{I}_{R, \thinspace i}
        \\
        %
            \bar{I}_{R, \thinspace j}
        \end{array}
    \right]
\label{eq:op_imp_load_RER_int_op}
\\
\intertext{where}
\bar{\mathnormalbold{Z}}_{bus} &=
    \left[
        \begin{array}{c !{\vrule width 0.25mm}c c}
            \bar{\mathnormalbold{Z}}_{GG} & \bar{\mathnormalbold{Z}}_{GR_{i}} & \bar{\mathnormalbold{Z}}_{GR_{j}}
        \\
        \Xhline{0.25mm}
        %           
            \bar{\mathnormalbold{Z}}_{R_{i}G} & \bar{Z}_{RR, \thinspace ii} & \bar{Z}_{RR, \thinspace ij}
        \\
        %
            \bar{\mathnormalbold{Z}}_{R_{j}G} & \bar{Z}_{RR, \thinspace ij} & \bar{Z}_{R, \thinspace jj}
        \end{array}
    \right]
\label{eq:Z_bus_hat_def}
\end{align}

\end{document}

It could be better to put this functionality inside a \newcommand of course. Feel free to ask me for this if this way seems ok to you.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.