Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to number gathered equations using single number

Tags:

latex

I want to number gathered equations, but single number for several equations. Following is the code I've used. But it results numbering both equations. I want to equations to be justified, not right aligned. Spilt and align environment right align the equations. Is there any way to do this?

\begin{gather}
\eta_{c1} P_{pv}(k) + \eta_{c2} P_{bat}(k) \leq P_{conG,rate} \\\
P_{grid} + P_{load} \geq -P_{conG,rate} 
\end{gather}
like image 451
Iro Avatar asked Sep 15 '25 20:09

Iro


2 Answers

After \ you can put \nonumber this way you can avoid having both equations numbered

like image 65
Good Luck Avatar answered Sep 17 '25 10:09

Good Luck


Here is a cleaner solution than using \nonumber. Using gathered or aligned environments inside an equation environment groups the equations and assigns one number to them. This is recommended by the amsmath user guide.

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{equation}
    \begin{gathered}
        \eta_{c1} P_{pv}(k) + \eta_{c2} P_{bat}(k) \leq P_{conG,rate}
        \\
        P_{grid} + P_{load} \geq -P_{conG,rate}
    \end{gathered}
\end{equation}

\begin{equation}
    \begin{aligned}
        \eta_{c1} P_{pv}(k) + \eta_{c2} P_{bat}(k) &\leq P_{conG,rate}
        \\
        P_{grid} + P_{load} &\geq -P_{conG,rate}
    \end{aligned}
\end{equation}

\end{document}

compiled

like image 39
Nathan Musoke Avatar answered Sep 17 '25 09:09

Nathan Musoke