
Coloquei uma expressão matricial em uma tabela. Agora estou tentando inserir uma legenda, mas recebo um erro e a legenda não aparece no meu pdf. Este é o meu código:
\begin{table*}
\[
\begin{bmatrix}
y_\triangle \\
y
\end{bmatrix}
\Large
=
\renewcommand\arraystretch{2}
\begin{bmatrix}[c|ccc]
- \frac{\omega_i C C_{dyn} H G}{1+C C_{dyn} H G} & \frac{\omega_i C C_{dyn}}{1+C C_{dyn} H G} & \frac{\omega_i}{1+C C_{dyn} H G} & - \frac{\omega_i C C_{dyn} H}{1+C C_{dyn} H G} \\ \hline
\frac{\omega_p G}{1+C C_{dyn} H G} & \frac{\omega_p C C_{dyn} G}{1+C C_{dyn} H G} & \frac{\omega_p G}{1+C C_{dyn} H G} & - \frac{\omega_p C C_{dyn} H G}{1+C C_{dyn} H G}
\end{bmatrix}
\normalsize
\renewcommand\arraystretch{1}
\begin{bmatrix}
u_\triangle \\
r\\
\omega \\
n
\end{bmatrix}
\]
\caption{Trasformata U_LFT del sistema}
\label{fig:ulft}
\end{table*}
No preâmbulo inseri este código para inserir linha vertical na matriz.
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother
Obrigado a todos pela ajuda
Responder1
Para se livrar da mensagem de erro gerada pela legenda, altere _
para \_
no argumento de \caption
.
Você também deve considerar a solução de vários outros problemas. Livre-se das alterações no tamanho da fonte na fórmula, na \hline
diretiva e nas alterações em \arraystretch
. Use \dfrac
em vez de \frac
se desejar termos fracionários maiores.
\documentclass{article}
\usepackage[italian]{babel}
\usepackage{amsmath} % for 'bmatrix' environment and '\dfrac' macro
\usepackage[a4paper,margin=2.5cm]{geometry} % set page and text block parameters
\begin{document}
\begin{table}
\[
\begin{bmatrix} y_\triangle \\ y \end{bmatrix}
%%%\Large
=
%%%\renewcommand\arraystretch{2}
\begin{bmatrix}%%%[c|ccc]
-\dfrac{\omega_i C C_{\mathrm{dyn}} H G}{1+C C_{\mathrm{dyn}} H G} &
\dfrac{\omega_i C C_{\mathrm{dyn}}}{1+C C_{\mathrm{dyn}} H G} &
\dfrac{\omega_i}{1+C C_{\mathrm{dyn}} H G} &
-\dfrac{\omega_i C C_{\mathrm{dyn}} H}{1+C C_{\mathrm{dyn}} H G} \\[3ex] %%%\hline
\dfrac{\omega_p G}{1+C C_{\mathrm{dyn}} H G} &
\dfrac{\omega_p C C_{\mathrm{dyn}} G}{1+C C_{\mathrm{dyn}} H G} &
\dfrac{\omega_p G}{1+C C_{\mathrm{dyn}} H G} &
-\dfrac{\omega_p C C_{\mathrm{dyn}} H G}{1+C C_{\mathrm{dyn}} H G}
\end{bmatrix}
%%%\normalsize
%%%\renewcommand\arraystretch{1}
\begin{bmatrix} u_\triangle \\ r\\ \omega \\ n \end{bmatrix}
\]
\caption{Trasformata U\_LFT del sistema} % <--- change "_" to "\_"
\label{fig:ulft}
\end{table}
\end{document}
Termo aditivo: Se você precisar inserir uma linha vertical e uma horizontal na matriz 2x4, sugiro que faça isso usando um array
ambiente, em vez de um bmatrix
ambiente. Dessa forma, você não terá que \hline
gerar uma linha muito longa e que acabe interferindo nos colchetes.
\left[ \begin{array}{@{}c|ccc@{}}
-\dfrac{\omega_i C C_{\mathrm{dyn}} H G}{1+C C_{\mathrm{dyn}} H G} &
\dfrac{\omega_i C C_{\mathrm{dyn}}}{1+C C_{\mathrm{dyn}} H G} &
\dfrac{\omega_i}{1+C C_{\mathrm{dyn}} H G} &
- \dfrac{\omega_i C C_{\mathrm{dyn}} H}{1+C C_{\mathrm{dyn}} H G} \\[2ex]
\hline
% use '\mathstrut' to get a bit more vertical separation:
\dfrac{\omega_p G^{\mathstrut}}{1+C C_{\mathrm{dyn}} H G} &
\dfrac{\omega_p C C_{\mathrm{dyn}} G}{1+C C_{\mathrm{dyn}} H G} &
\dfrac{\omega_p G}{1+C C_{\mathrm{dyn}} H G} &
- \dfrac{\omega_p C C_{\mathrm{dyn}} H G}{1+C C_{\mathrm{dyn}} H G}
\end{array}\right]