TransWikia.com

Align text under variables

TeX - LaTeX Asked by John W. de Burgh on May 3, 2021

Is there any easy way to align the conditions under the equation? As you can see the less equal zero condition is not vertically aligned.

documentclass[border=10pt]{standalone}
usepackage[utf8]{inputenc}
usepackage{amsmath}
begin{document}

$
Omega =-underset{ge 0}{gamma}underset{ge 0}{(b-Ax)}+
        underset{ge 0}{(x-l)}underset{ge 0}{alpha}+
        underset{ge 0}{(u-x)}underset{ge 0}{-beta}+
        underset{ge 0}{(c-gamma A-alpha I-beta I)}underset{ge 0}{x}
        $
end{document}

enter image description here

One Answer

The following defined Funderset that inserts a mathstrut as part of the underset construction. You can change this by supplying a different first (optional) argument.

documentclass[border=10pt]{standalone}
usepackage[utf8]{inputenc}
usepackage{amsmath}
newcommandFunderset[3][mathstrut]{underset{#1#2}{#1#3}}
begin{document}

$
Omega =-Funderset{ge 0}{gamma}Funderset{ge 0}{(b-Ax)}+
        Funderset{ge 0}{(x-l)}Funderset{ge 0}{alpha}+
        Funderset{ge 0}{(u-x)}Funderset{ge 0}{-beta}+
        Funderset{ge 0}{(c-gamma A-alpha I-beta I)}Funderset{ge 0}{x}
        $
end{document}

enter image description here

Correct answer by user238301 on May 3, 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