2

I am having some trouble trying to split my equations to get the desired effect that I want. The first picture is how I want to be able to align my equations, the only difference is that in the first picture I have page margins set to 0.45in and now I need to have them set to 1.0in.

enter image description here

When I adjust the margins to 1.0 in with the code below, I get the second picture where the equation number is being pushed down to the next line because the expression on the first line is too long:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{lipsum}
\usepackage[margin=0.45in, includefoot]{geometry}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{enumitem}
\usepackage{ stmaryrd }
\usepackage{comment}
\usepackage[svgnames]{xcolor}
\usepackage{xcolor}
\usepackage{framed}
\usepackage{sectsty}
\usepackage{apacite}
\usepackage[normalem]{ulem}


\begin{document}
\begin{align*}
    \min_{L_{t}} \quad & \sum_{t=1}^T\sum_{i=1}^I\sum_{j=1}^J \hspace{0.5em}\beta^{t-1} \left[  (c + p\thinspace\tau\thinspace\alpha^{(i,j)} + f^{h}) L_{t}^{(i,j)}G_{t,NewGrowth}^{(i,j)}  + \alpha^{(i,j)}(\tilde{f} + p\tau)\thinspace G_{t,PostTreatment}^{(i,j)}\right]\\[5pt]
    \text{s.t.} \quad & B_{t,PreDispersal}^{(i,j)} = \rho G_{t-1,PostTreatment}^{(i,j)} & \forall i,j,t \quad \tag{1}
\end{align*}
\end{document}

Picture 2

I know that I have to use a split or multline environment, but everytime that I do my equations just blow up off of the page or their alignment becomes chaotic. Here is an example with the split environment.

Ideally I would like to be able to split the first expression into two lines and have the equations numbers lined up and not pushed down to the lines below. enter image description here

1
  • 1
    Change & \forall to \qquad \forall. – Donald Arseneau May 27 '20 at 3:42
3

I see no need for the & symbol before \forall i,j,t in the second row. A \quad or \qquad spacing directive should suffice.

I would use an aligned environment inside an equation environment; this setup generates a single equation number, with the optional argument of aligned ([t] or [b] indicating whether the equation number should be placed at the top or bottom. The default is [c] -- in which case you could also use a split environment in place of the aligned environment.

In the following, I've set {aligned}[b], removed all thinspace directives (\thinspace and \,), rendered the variable names -- NewGrowth etc -- used in various subscripts in the upright Roman font via \mathrm, and loaded the mleftright package to fix some horizontal-spacing issues associated with the use of \left and \right.

An additional suggestion: You may want to think about indicating whether the minimization should be carried out over L_{t} or L_{t}^{(i,j)}; the latter would indicate that there are I\times J\timesT rather than just T choice variables, right? Maybe this point will be utterly obvious to your readers. On the off chance, though, that some of your readers aren't quite up to speed, writing L_{t}^{(i,j)} might just provide them with an extra bit of clarity.

enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb}
\usepackage{mleftright}\mleftright
\usepackage{lipsum}
\usepackage[margin=1in, includefoot]{geometry} % note: "1in"
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{fixcmex} % fix some issues with Latin Modern's scalable operators
\usepackage{enumitem,stmaryrd,comment}
\usepackage[svgnames]{xcolor}
%%%%%%\usepackage{xcolor} % don't load packages more than once
\usepackage{framed}
\usepackage{sectsty}
\usepackage{apacite}
\usepackage[normalem]{ulem}

\begin{document}
\begin{equation}
\begin{aligned}[b] % 'b' to place eq. number at bottom-right of env.
    \min_{L_{t}}\quad & \sum_{t=1}^T \sum_{i=1}^I \sum_{j=1}^J 
         \beta^{t-1} \left[ (c + p\tau\alpha^{(i,j)} 
         + f^{h}) L_{t}^{(i,j)} 
         G_{t,\mathrm{NewGrowth}}^{(i,j)}  
         + \alpha^{(i,j)}(\tilde{f} + p\tau) 
         G_{t,\mathrm{PostTreatment}}^{(i,j)} \right] \\[1ex]
    \text{s.t.}\quad & B_{t,\mathrm{PreDispersal}}^{(i,j)} = 
        \rho G_{t-1,\mathrm{PostTreatment}}^{(i,j)} 
        \quad \forall i,j,t 
\end{aligned}
\end{equation}
\end{document}
3
  • 1
    Or split . You forgot to tell the OP that you removed all spacing directives (I agree with you, of course). Also, when lmodern is used, I recommend \usepackage{fixcmex} to get scalable big operators. – egreg May 27 '20 at 9:32
  • @egreg - Thanks for these comments and suggestions. I've updated my answer in several places to incorporate your observations. – Mico May 27 '20 at 11:16
  • 1
    Thanks everybody. Still getting the hang of LaTeX so it's appreciated. – GrayLiterature May 27 '20 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.