1

I would like to create these two equations in the overleaf with TeX Live 2022 in two column template.

Here is the expectation (yellow highlighted):

![expectation

Zoom in version:

![enter image description here

Then, this is the code:

\documentclass[journal]{IEEEtran}
\usepackage{mathtools}
\usepackage{amsmath}
\begin{document}

\renewcommand{\labelenumi}{(\roman{enumi})}
\begin{enumerate}
    \item 
    \begin{equation} \label{eq:corollary_i}
    \max_{i^{\ast} =1,...,n} (q_i^{\ast}\cdot p_i^{\ast} + (1-q_i^{\ast})c_i^{\ast} \quad  \forall i^{\ast}\geq(n-1), q_i^{\ast}\cdot c_i^{\ast} + (1-q_i^{\ast})p_i^{\ast} \quad   \text{for $i^{\ast} = n$}) \geq (n-1)w + nv
    \end{equation}
 
    \item
    \begin{equation} \label{eq:corollary_ii}
    \max_{i^{\ast\ast} =1,...,n} (q_i^{\ast\ast}\cdot p_i^{\ast\ast} + (1-q_i^{\ast\ast})c_i^{\ast\ast} \quad  \forall i^{\ast\ast}\geq(n-1), q_i^{\ast\ast}\cdot c_i^{\ast\ast} + (1-q_i^{\ast\ast})p_i^{\ast\ast} \quad  \text{for $i^{\ast} = n$} \geq (n+1)w + (n+2)v
    \end{equation}    
\end{enumerate}

\end{document}

However, the printed result is as follows (the equations surpass the column space).

result

Does anyone how to ensure those two equations will fit into 1 column? Thank you.

3
  • Your equations are very long (apparently) and has unclear structure. Please, provide a sketch, how should they like to be..
    – Zarko
    Commented Mar 8, 2023 at 4:23
  • 1
    Equations have to be manually broken/formatted to fit the columns. I would lose the enumerate, as it will only reduce the available width. Or at least use enumitem to get rid of the hanging indentation. Commented Mar 8, 2023 at 4:28
  • Hi @Zarko and John, I edited the expected equations in the questions page. Can you take a look, please? Commented Mar 8, 2023 at 4:53

3 Answers 3

1
  • Your MWE is not close to what you show to like have
  • equation also on image is quite long
  • a possible way is to reduce font size in equation and left out not needed sympo `\cdot and parenthesis
  • for equation I suggest to use cases from mathtools
\documentclass[journal]{IEEEtran}
\usepackage{mathtools}

\usepackage{lipsum}


\begin{document}
{\footnotesize
    \begin{flalign}
(i) &   \max_{i^{\ast} = 1,\dotsc,n} 
        \begin{cases}
        q_i^{\ast} p_i^{\ast} + (1-q_i^{\ast})c_i^{\ast} & i^{\ast}\leq(n-1)    \\
        q_i^{\ast} p_i^{\ast} + (1-q_i^{\ast})p_i^{\ast} & i^{\ast}=n
        \end{cases}      
        \geq W_1(n)    \label{eq:corollary_i} \\
(ii) & \max_{i^{\ast\ast}=1,...,n}
        \begin{cases}
            q_i^{\ast\ast}p_i^{\ast\ast} + (1-q_i^{\ast\ast})c_i^{\ast\ast} 
                & i^{\ast\ast}\leq(n-1) \\ 
            q_i^{\ast\ast} c_i^{\ast\ast} + (1-q_i^{\ast\ast})p_i^{\ast\ast}
                & i^{\ast} = n        
        \end{cases}
         \geq W_2(n)      \label{eq:corollary_ii} 
    \end{flalign}
}%
where $W_1(n) = (n+1)w + nv$ and $W_2(n) = (n-1)w + (n+2)v$.

\lipsum
\end{document}

enter image description here

Addendum:
With enumerate list and nccmath package for shifting equation to the left and multlined to split longer equation into two lines. This enable to write equation without reducing of font inside them:

\documentclass[journal]{IEEEtran}
\usepackage{nccmath,  mathtools}
\usepackage{enumitem}

\usepackage{lipsum}


\begin{document}
\lipsum[66]
\begin{fleqn}[0pt]
\begin{enumerate}[label=(\roman*),wide]
\item 
    \begin{equation}\label{eq:corollary_i}
\max_{i^{\ast} = 1,\dotsc,n}
        \begin{cases}
        q_i^{\ast} p_i^{\ast} + (1-q_i^{\ast})c_i^{\ast} & i^{\ast}\leq(n-1)    \\
        q_i^{\ast} p_i^{\ast} + (1-q_i^{\ast})p_i^{\ast} & i^{\ast}=n
        \end{cases}
        \quad   \geq W_1(n)
    \end{equation}
\item 
    \begin{equation}\label{eq:corollary_ii}
\max_{i^{\ast\ast}=1,...,n}
        \begin{cases}
            \begin{multlined}
                q_i^{\ast\ast}p_i^{\ast\ast} + \\[-2ex]
                    (1-q_i^{\ast\ast})c_i^{\ast\ast}
            \end{multlined}
                &   i^{\ast\ast}\leq(n-1) \\[3ex]
           \begin{multlined}
            q_i^{\ast\ast} c_i^{\ast\ast} + \\[-2ex]
                    (1-q_i^{\ast\ast})p_i^{\ast\ast}
             \end{multlined}
               &    i^{\ast} = n
        \end{cases}
        \quad   \geq W_2(n)
    \end{equation}
\end{enumerate}
\end{fleqn}
where $W_1(n) = (n+1)w + nv$ and $W_2(n) = (n-1)w + (n+2)v$.

\lipsum
\end{document}

enter image description here

1

Is this works for you?

\documentclass[journal]{IEEEtran}
\usepackage{mathtools}
\usepackage{cuted}
\usepackage{lipsum}
\begin{document}

\lipsum[1-2]
\begin{strip}
\renewcommand{\labelenumi}{(\roman{enumi})}
\begin{enumerate}
    \item 
    \begin{equation} \label{eq:corollary_i}
    \max_{i^{\ast} =1,\ldots,n} (q_i^{\ast}\cdot p_i^{\ast} + (1-q_i^{\ast})c_i^{\ast} \quad  \forall i^{\ast}\geq(n-1), q_i^{\ast}\cdot c_i^{\ast} + (1-q_i^{\ast})p_i^{\ast} \quad   \text{for $i^{\ast} = n$}) \geq (n-1)w + nv
    \end{equation}
 
    \item
    \begin{equation} \label{eq:corollary_ii}
    \max_{i^{\ast\ast} =1,\ldots,n} (q_i^{\ast\ast}\cdot p_i^{\ast\ast} + (1-q_i^{\ast\ast})c_i^{\ast\ast} \quad  \forall i^{\ast\ast}\geq(n-1), q_i^{\ast\ast}\cdot c_i^{\ast\ast} + (1-q_i^{\ast\ast})p_i^{\ast\ast} \quad  \text{for $i^{\ast} = n$} \geq (n+1)w + (n+2)v
    \end{equation}    
\end{enumerate}
\end{strip}

\lipsum[3-4]

\end{document}

enter image description here

0

You can use align* or multiline

1
  • 7
    Can you please show some code, that shows, how this can be used to solve the issue? Best would be, to add a working example, that can be copied and tried out. Currently this answer is more or less just a comment not a complete answer.
    – cabohah
    Commented Mar 8, 2023 at 6:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .