TransWikia.com

How to get the same size for all the characters in an equation?

TeX - LaTeX Asked by Hajer Hraiech Sakly on June 29, 2021

I need to have the same size for all characters inside an equation. I did some research and i found a solution using align* instead of equation but in my case it doesn’t work, I need to use equation.

My code

For example here when i use frac{}{}, lambda is smaller than the lambda outside frac{}{}.

documentclass[a4paper,10pt]{book}
usepackage{amssymb}
usepackage{mathtools}

begin{document}

begin{equation}label{eq:one}
begin{split}
textbf{X}^{-1} & = left(left(begin{array}{ccc} {underline{b}_{1}} & {cdots} & {underline{b}_{N}} end{array}right)cdot left(begin{array}{ccc} {lambda _{1}} & {cdots} & {0}  {vdots} & {ddots} & {vdots}  {0} & {cdots} & {lambda _{N}} end{array}right)cdot left(begin{array}{ccc} {underline{b}_{1}} & {cdots} & {underline{b}_{N}} end{array}right)^{-1} right)^{-1}  

& = left(begin{array}{ccc} {underline{b}_{1}} & {cdots} & {underline{b}_{N}} end{array}right)cdot left(begin{array}{ccc} {lambda _{1}} & {cdots} & {0}  {vdots} & {ddots} & {vdots}  {0} & {cdots} & {lambda _{N}} end{array}right)^{-1}cdot left(begin{array}{ccc} {underline{b}_{1}} & {cdots} & {underline{b}_{N}} end{array}right)^{-1}

& = left(begin{array}{ccc} {underline{b}_{1}} & {cdots} & {underline{b}_{N}} end{array}right)cdot left(begin{array}{ccc} {frac{1}{lambda _{1}}} & {cdots} & {0}  {vdots} & {ddots} & {vdots}  {0} & {cdots} & {frac{1}{lambda _{N}}} end{array}right)^{-1}cdot left(begin{array}{ccc} {underline{b}_{1}} & {cdots} & {underline{b}_{N}} end{array}right)^{-1}
end{split}
end{equation}

end{document}

Is it possible to obtain the same size for the whole equation (like below)? What I need

One Answer

I can think of two solutions:

  • Replace frac with dfrac (see the third row in the screenshot below); or

  • Employ inline-fraction notation instead of frac (see the fourth row).

For the use case at hand, I'd prefer the inline-fraction solution since it avoids creating a needlessly tall matrix expression. That, or just keep using frac: I doubt that your readers will experience any problems at all deciphering what the fraction terms denote.

I would also employ pmatrix environments instead of left(begin{array}{ccc} ... end{array}right), replace some of the ^{-1} terms with ' (transpose), not employ the cdot crutches, create a shorthand macro to abbreviate the many instances of underline{b} and, most of all, not encase the contents of each and every cell in curly braces.

enter image description here

documentclass[a4paper,10pt]{book}
usepackage{amssymb}
usepackage{mathtools} % for 'split' and 'pmatrix' environments
newcommandub{underline{b}}

begin{document}

begin{equation}label{eq:one}
begin{split}
mathbf{X}^{-1} 
&= left(
begin{pmatrix} 
    ub_{1} & cdots & ub_{N} 
end{pmatrix}
%cdot 
begin{pmatrix} 
    lambda_{1} & cdots & 0  
    vdots & ddots & vdots  
    0 & cdots & lambda_{N} 
end{pmatrix}
%cdot 
begin{pmatrix} 
    ub_{1} & cdots & ub_{N} 
end{pmatrix}' 
right)^{!!-1}   % end of row 1
&= 
begin{pmatrix} 
    ub_{1} & cdots & ub_{N} 
end{pmatrix}
%cdot 
begin{pmatrix} 
    lambda_{1} & cdots & 0  
    vdots & ddots & vdots  
    0 & cdots & lambda_{N} 
end{pmatrix}^{!!-1}
%cdot 
begin{pmatrix} 
    ub_{1} & cdots & ub_{N} 
end{pmatrix}' % end of row 2
&= 
begin{pmatrix} 
    ub_{1} & cdots & ub_{N} 
end{pmatrix}
%cdot 
begin{pmatrix} 
    dfrac{1}{lambda_{1}} & cdots & 0  
    vdots & ddots & vdots  0 & 
    cdots & dfrac{1^{mathstrut}}{lambda_{N}} 
end{pmatrix}^{!!-1}
%cdot 
begin{pmatrix} 
    ub_{1} & cdots & ub_{N} 
end{pmatrix}' % end of row 3
&= 
begin{pmatrix} 
    ub_{1} & cdots & ub_{N} 
end{pmatrix}
%cdot 
begin{pmatrix} 
    1/lambda_{1} & cdots & 0  
    vdots & ddots & vdots  0 & 
    cdots & 1/lambda_{N} 
end{pmatrix}^{!!-1}
%cdot 
begin{pmatrix} 
    ub_{1} & cdots & ub_{N} 
end{pmatrix}'
end{split}
end{equation}

end{document}

Correct answer by Mico on June 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP