Is there a package for specifying optimization problems, such as in linear programming, quadratic programming, convex programming, etc.?

Or do I have to write my own code with align, constraints and so on? I thought that there might be a very elegant way to specify a min/max problem with some constraints below it.

I am talking about something like Example 2.2 in http://people.ucsc.edu/~rgil/Optimization.pdf.

EDIT: Following a request below, I add an illustrating example of a problem I had with align.

```
\begin{alignat}{3}
\min && n \\
\mathrm{s.t.} && xxxxxxx \\
&& yyyyyyyyyyyyyyyyyyy \\
&& zzzzzzzzzzzzzzzzzzz
\end{alignat}
```

What happens is that n is aligned to the far left. I want all of the left columns to be centered below each other.

This is my way of formulating a constrained optimization problem, if someone has a better idea I will be glad to hear about it.

If I use only two columns, there is almost no space between $\min$ and $n$. I am almost tempted to use eqnarray 🙂

## Best Answer

A bit late but it might help other people looking for the same answer. The package optidef was intended as the easy way to define optimization problems.

The package has several more options. Below some examples are provided. To have a completely overview of the features and options check the documentation.

## Using a shorter description of minimize/subject to.

## Breaking the objective accross several lines.

## Multilabeling/no labeling:

## Alignment position of constraints with respect to the objective:

Alternative 1Alternative 2Alternative 3## Other optimization environments

argminimaxiargmaxiFull details on the different implementations above (and more details) can be found in the documentation: http://ctan.cs.uu.nl/macros/latex/contrib/optidef/optidef.pdf.

Feature requests and discussion of issues can be done through the github page: https://github.com/jeslago/optidef