[Tex/LaTex] Align objective function in latex

alignspacing

I am writing the following optimization model:

\documentclass{article}
\usepackage[cmex10]{amsmath}

\DeclareMathOperator*{\Min}{min}

\begin{document}

\begin{align}
&Q_t(v_{t-1},a_{ti\omega}) = \notag \\ 
&\min_{\substack{g_t,~y_t,f_t,~\theta_t,~\\\Delta u^{up},~\Delta u^{dn},\\\Delta g^{up},~\Delta g^{dn},\\g_t^c,~y_t^c,~f_t^c,~\theta_t^c}} c^\top_{t}g_{t,i}+\sum_{i \in \mathcal{I}^T}(c^{U}_i \Delta g^{up}_{t,i}+c^{D}_i \Delta g^{dn}_{t,i})+ \notag \\
&\hspace{19mm}\sum_{i \in \mathcal{I}^H}(c^{U}_i \Delta u^{up}_{t,i}+c^{D}_i \Delta u^{dn}_{t,i})+\mathcal{Q}_{t+1}(v_t)
\end{align}
\end{document}

However, I wanted both parts of the objective function to be close. I do not want that vertical space between them. Is there a way around?

the model

Best Answer

If you really want align, you can add or remove space when breaking a line. In this case, at the second line break, replacing \\ with \\[-2em] reduces the vertical spacing:

\documentclass{article}
\usepackage[cmex10]{amsmath}    
\DeclareMathOperator*{\Min}{min}
\begin{document}

\begin{align}
&Q_t(v_{t-1},a_{ti\omega}) = \notag \\ 
&\min_{\substack{...} c^\top_{t}g_{t,i}+\sum_{i \in \mathcal{I}^T}(c^{U}_i \Delta
g^{up}_{t,i}+c^{D}_i \Delta g^{dn}_{t,i})+ \notag \\[-2em] % here
&\hspace{19mm}\sum_{i \in \mathcal{I}^H}(c^{U}_i \Delta u^{up}_{t,i}+c^{D}_i \Delta u^{dn}_{t,i})+\mathcal{Q}_{t+1}(v_t)
\end{align}
\end{document}

enter image description here

This works in environments other than align, too, in case you want to switch.

Related Question