Text FormattingMath formulas in a matrix

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
brgirgis
Posts: 2
Joined: Tue May 25, 2010 8:18 pm

Math formulas in a matrix

Post by brgirgis »

Hi;

I'm trying to write some math formulas into a matrix and the output coming up not as I expected. Parts of the formulas had their font size changed to match the smaller terms. I need a way to make each matrix element fit its contents as a usual equation would do.

Thanks!

Code: Select all

\begin{equation}
\begin{bmatrix}
U_2                   & U_3                   & U_4 \\ 
\frac{U_2 U_2}{U_1}+P & \frac{U_2 U_3}{U_1}   & \frac{U_2 U_4}{U_1} \\ 
\frac{U_3 U_2}{U_1}   & \frac{U_3 U_3}{U_1}+P & \frac{U_3 U_4}{U_1} \\
\frac{U_4 U_2}{U_1}   & \frac{U_4 U_3}{U_1}   & \frac{U_4 U_4}{U_1}+P \\
\frac{U_2}{U_1} \left(U_5+P\right) &
\frac{U_3}{U_1} \left(U_5+P\right) &
\frac{U_4}{U_1} \left(U_5+P\right)
\end{bmatrix}
\end{equation}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

brgirgis
Posts: 2
Joined: Tue May 25, 2010 8:18 pm

Re: Math formulas in a matrix

Post by brgirgis »

I figured it! Use \dfrac instead of \frac. Thanks!
Post Reply