Por que o \raisebox é necessário aqui para alinhar a equação corretamente?

Por que o \raisebox é necessário aqui para alinhar a equação corretamente?

Acabei de me deparar com o seguinte problema:

Gostaria de alinhar as matrizes da última coluna para que comece com as demais colunas.

No entanto, preciso de um deslocamento para isso, que implemento com o comando \raisebox. Mas estou me perguntando por que isso é necessário. Existe uma solução melhor?

\documentclass{article}
\usepackage{graphicx} % Required for inserting images

\usepackage{xltabular}
\usepackage{adjustbox}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}

{
\centering    
\renewcommand{\arraystretch}{2}
\begin{xltabular}{\textwidth}{ >{\centering\arraybackslash}p{1.4em} >{\arraybackslash}X >{\centering\arraybackslash}p{.7\textwidth} }
    5 & Mit dem Operationsverstärker wird ähnlich verfahren: hier wird der Ausgangsstrom I\_VCVS dem Gleichungssystem hinzugefügt. Alle Elemente der Netzliste sind damit abgearbeitet. & \raisebox{-.85\height}{$\left[\begin{matrix}
        \dfrac{1}{R1} & -\dfrac{1}{R1} & 0 & 0 & 1 & 0 \\
        -\dfrac{1}{R1} & \dfrac{1}{R1}+\dfrac{1}{R2} & -\dfrac{1}{R2} & 0 & 0 & 0 \\
        0 & -\dfrac{1}{R2} & \dfrac{1}{R2} & 0 & 0 & 1 \\
        0 & 0 & 0 & 0 & -1 & 0 \\
        1 & 0 & 0 & -1 & 0 & 0 \\
        0 & v & 1 & 0 & 0 & 0 \\
    \end{matrix}\right]\cdot\left[\begin{array}{@{} c @{}}
        V1 \\
        V2 \\
        V3 \\
        0 \\
        I\_V0 \\
        I\_VCVS \\
    \end{array}\right]=\left[\begin{array}{@{} c @{}}
        0 \\
        0 \\
        0 \\
        0 \\
        U0 \\
        0 \\
    \end{array}\right]$} \\
    6 & Zum Abschluss werden die zum Masse-Potential gehörende Zeile und Spalte wegen ihrer linearen Abhängigkeit entfernt. Das Ergebnis ist gesuchte \textbf{MNA}-Gleichungssystem. Auf diese Weise stellt im Übrigen auch \textbf{SPICE} seine Netzwerkgleichungen auf & \raisebox{-.85\height}{$\left[\begin{matrix}
        \dfrac{1}{R1} & -\dfrac{1}{R1} & 0 & 1 & 0 \\
        -\dfrac{1}{R1} & \dfrac{1}{R1}+\dfrac{1}{R2} & -\dfrac{1}{R2} & 0 & 0 \\
        0 & -\dfrac{1}{R2} & \dfrac{1}{R2} & 0 & 1 \\
        1 & 0 & 0 & 0 & 0 \\
        0 & v & 1 & 0 & 0 \\
    \end{matrix}\right]\cdot\left[\begin{array}{@{} c @{}}
        V1 \\
        V2 \\
        V3 \\
        I\_V0 \\
        I\_VCVS \\
    \end{array}\right]=\left[\begin{array}{@{} c @{}}
        0 \\
        0 \\
        0 \\
        U0 \\
        0 \\
    \end{array}\right]$} \\
\end{xltabular}
}


\end{document}

Responder1

Você pode usar adjustboxcom a opção valign=t, para não precisar adivinhar.

Fiz várias outras correções: por exemplo, bmatrixem vez de tantas \left[e \right]; também \tfracem vez de \dfrac, isso ajuda a manter as matrizes em um tamanho legível, sem muito espaço entre as linhas.

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{newtxtext,newtxmath} % Times font

\usepackage{graphicx} % Required for inserting images
\usepackage{xltabular}
\usepackage{adjustbox}
\usepackage{amsmath}
%\usepackage{amssymb} % not with newtx

\begin{document}

\begingroup\small
\begin{xltabular}{\textwidth}{
  @{}
  c
  X
  >{\centering\arraybackslash\renewcommand{\arraystretch}{1.3}}p{.7\textwidth}
  @{}
}
5 & Mit dem Operationsverstärker wird ähnlich verfahren: hier wird der
    Ausgangsstrom I\_VCVS dem Gleichungssystem hinzugefügt. Alle Elemente 
    der Netzliste sind damit abgearbeitet. &
    \begin{adjustbox}{valign=t}$
      \begin{bmatrix}
        \tfrac{1}{R1} & -\tfrac{1}{R1} & 0 & 0 & 1 & 0 \\
        -\tfrac{1}{R1} & \tfrac{1}{R1}+\tfrac{1}{R2} & -\tfrac{1}{R2} & 0 & 0 & 0 \\
        0 & -\tfrac{1}{R2} & \tfrac{1}{R2} & 0 & 0 & 1 \\
        0 & 0 & 0 & 0 & -1 & 0 \\
        1 & 0 & 0 & -1 & 0 & 0 \\
        0 & v & 1 & 0 & 0 & 0 \\
      \end{bmatrix}
      \cdot
      \begin{bmatrix}
        V1 \\
        V2 \\
        V3 \\
        0 \\
        I\_V0 \\
        I\_VCVS \\
      \end{bmatrix}
      =
      \begin{bmatrix}
        0 \\
        0 \\
        0 \\
        0 \\
        U0 \\
        0 \\
      \end{bmatrix}
      $\end{adjustbox} \\
6 & Zum Abschluss werden die zum Masse-Potential gehörende Zeile und Spalte
    wegen ihrer linearen Abhängigkeit entfernt. Das Ergebnis ist gesuchte
    \textbf{MNA}-Gleichungssystem. Auf diese Weise stellt im Übrigen auch
    \textbf{SPICE} seine Netzwerkgleichungen auf &
    \begin{adjustbox}{valign=t}$
    \begin{bmatrix}
      \tfrac{1}{R1} & -\tfrac{1}{R1} & 0 & 1 & 0 \\
      -\tfrac{1}{R1} & \tfrac{1}{R1}+\tfrac{1}{R2} & -\tfrac{1}{R2} & 0 & 0 \\
      0 & -\tfrac{1}{R2} & \tfrac{1}{R2} & 0 & 1 \\
      1 & 0 & 0 & 0 & 0 \\
      0 & v & 1 & 0 & 0 \\
    \end{bmatrix}
    \cdot
    \begin{bmatrix}
      V1 \\
      V2 \\
      V3 \\
      I\_V0 \\
      I\_VCVS \\
    \end{bmatrix}
    =
    \begin{bmatrix}
      0 \\
      0 \\
      0 \\
      U0 \\
      0 \\
    \end{bmatrix}
    $\end{adjustbox} \\
\end{xltabular}
\endgroup

\end{document}

insira a descrição da imagem aqui

No entanto, não creio que esta seja uma boa forma de apresentar as suas ideias: é difícil ler uma coluna estreita.

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{newtxtext,newtxmath} % Times font
\usepackage{amsmath}
%\usepackage{amssymb} % not with newtx

\begin{document}

\begin{enumerate}
\setcounter{enumi}{4}% just to get 5 and 6 as in your example

\item Mit dem Operationsverstärker wird ähnlich verfahren: hier wird der
      Ausgangsstrom I\_VCVS dem Gleichungssystem hinzugefügt. Alle Elemente 
      der Netzliste sind damit abgearbeitet.
      \[
      \begin{bmatrix}
        \tfrac{1}{R1} & -\tfrac{1}{R1} & 0 & 0 & 1 & 0 \\
        -\tfrac{1}{R1} & \tfrac{1}{R1}+\tfrac{1}{R2} & -\tfrac{1}{R2} & 0 & 0 & 0 \\
        0 & -\tfrac{1}{R2} & \tfrac{1}{R2} & 0 & 0 & 1 \\
        0 & 0 & 0 & 0 & -1 & 0 \\
        1 & 0 & 0 & -1 & 0 & 0 \\
        0 & v & 1 & 0 & 0 & 0 \\
      \end{bmatrix}
      \cdot
      \begin{bmatrix}
        V1 \\
        V2 \\
        V3 \\
        0 \\
        I\_V0 \\
        I\_VCVS \\
      \end{bmatrix}
      =
      \begin{bmatrix}
        0 \\
        0 \\
        0 \\
        0 \\
        U0 \\
        0 \\
      \end{bmatrix}
      \]
\item Zum Abschluss werden die zum Masse-Potential gehörende Zeile und Spalte
      wegen ihrer linearen Abhängigkeit entfernt. Das Ergebnis ist gesuchte
      \textbf{MNA}-Gleichungssystem. Auf diese Weise stellt im Übrigen auch
      \textbf{SPICE} seine Netzwerkgleichungen auf
      \[
      \begin{bmatrix}
        \tfrac{1}{R1} & -\tfrac{1}{R1} & 0 & 1 & 0 \\
        -\tfrac{1}{R1} & \tfrac{1}{R1}+\tfrac{1}{R2} & -\tfrac{1}{R2} & 0 & 0 \\
        0 & -\tfrac{1}{R2} & \tfrac{1}{R2} & 0 & 1 \\
        1 & 0 & 0 & 0 & 0 \\
        0 & v & 1 & 0 & 0 \\
      \end{bmatrix}
      \cdot
      \begin{bmatrix}
        V1 \\
        V2 \\
        V3 \\
        I\_V0 \\
        I\_VCVS \\
      \end{bmatrix}
      =
      \begin{bmatrix}
        0 \\
        0 \\
        0 \\
        U0 \\
        0 \\
      \end{bmatrix}
      \]
\end{enumerate}

\end{document}

insira a descrição da imagem aqui

Responder2

Mesmo com alguma depuração e simplificação determinadas do seu código, não é fácil fazer com que o xltabularambiente se ajuste à largura do bloco de texto.

insira a descrição da imagem aqui

Existe uma solução melhor?

É quase certo que seus leitores apreciarão se você decidir tornar o layout bem menos lotado, por exemplo, mudando para uma configuração de lista enumerada.

insira a descrição da imagem aqui


\documentclass{article}
\usepackage{graphicx} 
\usepackage{xltabular}
\usepackage{amsmath,amssymb}
\renewcommand{\arraystretch}{1.5} % '2.0' is much too profligate

% new:
\usepackage{enumitem}
\usepackage{ragged2e} % for '\Centering' and '\RaggedRight' macros
\usepackage[ngerman]{babel}

\begin{document}

%% Layout #1: 'xltabular'
\begingroup
\setlength\arraycolsep{3pt} % default: 5pt
\setlength\tabcolsep{2pt} % default: 6pt
\noindent  
\begin{xltabular}{\textwidth}{@{} 
   l 
   >{\RaggedRight}X 
   >{\Centering}p{0.7\textwidth} 
   @{}}
5 & 
Mit dem Operationsverstärker wird ähnlich verfahren: hier wird der Ausgangsstrom I\_VCVS dem Gleichungssystem hinzugefügt. Alle Elemente der Netzliste sind damit abgearbeitet. & 
\raisebox{-.85\height}{%
$\begin{bmatrix}
    \frac{1}{R1} & -\frac{1}{R1} & 0 & 0 & 1 & 0 \\
    -\frac{1}{R1} & \frac{1}{R1}+\frac{1}{R2} & -\frac{1}{R2} & 0 & 0 & 0 \\
    0 & -\frac{1}{R2} & \frac{1}{R2} & 0 & 0 & 1 \\
    0 & 0 & 0 &  0 & -1 & 0 \\
    1 & 0 & 0 & -1 &  0 & 0 \\
    0 & v & 1 &  0 &  0 & 0 \\
 \end{bmatrix}%\cdot
 \begin{bmatrix}
    V1 \\
    V2 \\
    V3 \\
    0 \\
    I\_V0 \\
    I\_VCVS \\
 \end{bmatrix}=
 \begin{bmatrix}
    0 \\
    0 \\
    0 \\
    0 \\
    U0 \\
    0 \\
 \end{bmatrix}$} 
\\
6 & 
Zum Abschluss werden die zum Masse-Potential gehörende Zeile und Spalte wegen ihrer linearen Abhängigkeit entfernt. Das Ergebnis ist gesuchte \textbf{MNA}-Gleichungssystem. Auf diese Weise stellt im Übrigen auch \textbf{SPICE} seine Netzwerkgleichungen auf & 
\raisebox{-.85\height}{%
$\begin{bmatrix}
    \frac{1}{R1} & -\frac{1}{R1} & 0 & 1 & 0 \\
    -\frac{1}{R1} & \frac{1}{R1}+\frac{1}{R2} & -\frac{1}{R2} & 0 & 0 \\
    0 & -\frac{1}{R2} & \frac{1}{R2} & 0 & 1 \\
    1 & 0 & 0 & 0 & 0 \\
    0 & v & 1 & 0 & 0 \\
 \end{bmatrix}%\cdot
 \begin{bmatrix}
    V1 \\
    V2 \\
    V3 \\
    I\_V0 \\
    I\_VCVS \\
 \end{bmatrix}=
 \begin{bmatrix}
    0 \\
    0 \\
    0 \\
    U0 \\
    0 \\
 \end{bmatrix}$}
\end{xltabular}

\endgroup

\clearpage

%% Layout #2: use an enumerated list
\begin{enumerate}[start=5,left=0pt,label=\arabic*]
\item Mit dem Operationsverstärker wird ähnlich verfahren: hier wird der Ausgangsstrom I\_VCVS dem Gleichungssystem hinzugefügt. Alle Elemente der Netzliste sind damit abgearbeitet.
\[
 \begin{bmatrix}
    \frac{1}{R1} & -\frac{1}{R1} & 0 & 0 & 1 & 0 \\
    -\frac{1}{R1} & \frac{1}{R1}+\frac{1}{R2} & -\frac{1}{R2} & 0 & 0 & 0 \\
    0 & -\frac{1}{R2} & \frac{1}{R2} & 0 & 0 & 1 \\
    0 & 0 & 0 &  0 & -1 & 0 \\
    1 & 0 & 0 & -1 &  0 & 0 \\
    0 & v & 1 &  0 &  0 & 0 \\
 \end{bmatrix}%\cdot
 \begin{bmatrix}
    V1 \\
    V2 \\
    V3 \\
    0 \\
    I\_V0 \\
    I\_VCVS \\
 \end{bmatrix}=
 \begin{bmatrix}
    0 \\
    0 \\
    0 \\
    0 \\
    U0 \\
    0 \\
 \end{bmatrix}
\]
\item Zum Abschluss werden die zum Masse-Potential gehörende Zeile und Spalte wegen ihrer linearen Abhängigkeit entfernt. Das Ergebnis ist gesuchte \textbf{MNA}-Gleichungssystem. Auf diese Weise stellt im Übrigen auch \textbf{SPICE} seine Netzwerkgleichungen auf.
\[
 \begin{bmatrix}
    \frac{1}{R1} & -\frac{1}{R1} & 0 & 1 & 0 \\
    -\frac{1}{R1} & \frac{1}{R1}+\frac{1}{R2} & -\frac{1}{R2} & 0 & 0 \\
    0 & -\frac{1}{R2} & \frac{1}{R2} & 0 & 1 \\
    1 & 0 & 0 & 0 & 0 \\
    0 & v & 1 & 0 & 0 \\
 \end{bmatrix}%\cdot
 \begin{bmatrix}
    V1 \\
    V2 \\
    V3 \\
    I\_V0 \\
    I\_VCVS \\
 \end{bmatrix}=
 \begin{bmatrix}
    0 \\
    0 \\
    0 \\
    U0 \\
    0 \\
 \end{bmatrix}
\]
\end{enumerate}

\end{document}

informação relacionada