# Optidef problem with constraint alignment and reference MILP model

Hi i read the optidef guide but i can't write properly my mixed integer linear problem in overleaf, the constraints are unaligned and it doesn't shows the number between parenthese for all the constraints. Also i don't know if I can refer to each constraint in the text like with the \ref{} method used for the sections

\documentclass[11pt,a4paper]{article}
\usepackage[short]{optidef}
\begin{document}
\begin{mini} {}{C_{\text{max}}}{}{}
\addConstraint{\sum_{k \in M_j} X_{ijk}}{= 1,}{\quad \forall i \in J, \forall j \in O_i\label{eq:1}}
\addConstraint{S_{ijk} + C_{ijk}}{\leq X_{ijk}\cdot L,}{\quad \forall i \in J, \forall j \in O_i, \forall k \in M_j \label{eq:2}}
\addConstraint{C_{ijk}}{\geq S_{ijk} + t_{ijk} - (1 - X_{ijk}) \cdot L,}{\quad \forall i \in J, \forall j \in O_i, \forall k \in M_j \label{eq:3}}
\addConstraint{S_{ijk}}{\geq C_{i’j’k} - (Y_{iji’j’k}) \cdot L,}{\quad \forall i < i’, \forall j \in O_i, \forall j’ \in O_{i’}, \forall k \in M_j \cap M_{j’} \label{eq:4}}
\addConstraint{S_{i’j’k}}{\geq C_{ijk} - (1 - Y_{iji’j’k}) \cdot L,}{\quad \forall i < i’, \forall j \in O_i, \forall j’ \in O_{i’}, \forall k \in M_j \cap M_{j’} \label{eq:5}}
\addConstraint{\sum_{k \in M_j} S_{ijk}}{\geq \sum_{k \in M_j} C_{i,j-1,k},}{\quad \forall i \in J, \forall j \in O_i \setminus {O_{if(i)}} \label{eq:6}}
\addConstraint{S_{ijk}, C_{ijk}, C_i}{\geq 0,}{\quad \forall i \in J, \forall j \in O_i, \forall k \in M_j}
\addConstraint{Y_{iji’j’k}}{\in {0, 1},}{\quad \forall i < i’, \forall j \in O_i, \forall j’ \in O_{i’}, \forall k \in M_j \cap M_{j’}}
\end{mini}
\end{document}


the output is this:

You seem to want mini!.

\documentclass[a4paper]{article}
\usepackage[margin=1cm,heightrounded]{geometry}
\usepackage[short]{optidef}
\begin{document}

\begin{mini!} {}{C_{\mathrm{max}}}{}{\notag}
{\quad \forall i \in J, \forall j \in O_i\label{eq:1}}
{\quad \forall i \in J, \forall j \in O_i, \forall k \in M_j \label{eq:2}}
\addConstraint{C_{ijk}}{\geq S_{ijk} + t_{ijk} - (1 - X_{ijk}) \cdot L,}
{\quad \forall i \in J, \forall j \in O_i, \forall k \in M_j \label{eq:3}}
\addConstraint{S_{ijk}}{\geq C_{i'j'k} - (Y_{iji'j'k}) \cdot L,}
{\quad \forall i < i', \forall j \in O_i, \forall j' \in O_{i'},
\forall k \in M_j \cap M_{j'} \label{eq:4}}
\addConstraint{S_{i'j'k}}{\geq C_{ijk} - (1 - Y_{iji'j'k}) \cdot L,}
{\quad \forall i < i', \forall j \in O_i, \forall j' \in O_{i'},
\forall k \in M_j \cap M_{j'} \label{eq:5}}
\addConstraint{\sum_{k \in M_j} S_{ijk}}{\geq \sum_{k \in M_j} C_{i,j-1,k},}
{\quad \forall i \in J, \forall j \in O_i \setminus {O_{if(i)}} \label{eq:6}}
{\quad \forall i \in J \label{eq:7}}

It should be \mathrm{max} (or \max), not \text{max}.