TransWikia.com

Two optimization problems aligned horizontally one next to the other

TeX - LaTeX Asked on June 30, 2021

As the title suggests. Below I’m attaching an example/image that helps visualize what I’m trying to do.

enter image description here

So far, I have been able to align my two optimization problems vertically. Searching other questions/answers here, I tried using the multicol package but the end result is really bad (see below for the code). I cannot figure out a nice alignment.

Any hints (packages or environments) that I could use to produce the alignment as shown in the picture?

documentclass{article}
usepackage{multicol,amsmath}
begin{document}
begin{multicols}{2}

begin{alignat}{3}
& text{minimize} quad && c ^ T x 
& text{subject to} quad && A x = b, 
& && x succeq 0.
end{alignat}break

begin{alignat}{2}
& text{maximize} quad && - b ^ T nu 
& text{subject to} quad && A ^ T nu + c succeq 0.
end{alignat}

end{multicols}
end{document}

One Answer

The screenshot you posted suggests that you want to top-align the two optimization problem statements. The multicol package may not be the best-suited tool for this typesetting objective. I would like to suggest that you use two side-by-side top-aligned minipage environments, each of width 0.45textwidth. A separate comment: since there really is just one alignment column in the optimization problem statements, align should do just as well as alignat.

enter image description here

documentclass{article}
usepackage{amsmath} for 'align' environment
begin{document}

noindent
begin{minipage}[t]{0.45textwidth}
begin{align}
text{minimize}   quad& c ^ T! x 
text{subject to} quad& A x = b, 
                       &x succeq 0,.
end{align}
end{minipage}%
hfill % maximize separation between the 'minipage' environments
begin{minipage}[t]{0.45textwidth}
begin{align}
text{maximize}   quad& - b ^ T! nu 
text{subject to} quad& A ^ T! nu + c succeq 0 ,.
end{align}
end{minipage}

end{document}

Correct answer by Mico on June 30, 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