I want to write these equations in latex format, but I can't find how I can set proper settings to have this form. Will be glad if anyone can help me.
Anyone can help me to write these equations in Latex
equationstemplates
Related Solutions
There are a couple of packages for typesetting chemistry stuff, one such is chemmacros
. The equation in your image can be typeset as
\ch{S + E <>[ $k_{\mathrm{SI}}$ ][ $k_{\mathrm{IS}}$ ] E.I <>[ $k_{\mathrm{PI}}$ ][ $k_{\mathrm{IP}}$ ] P + E}
which will give
I suggest you take a look at the manual for the package. It is probably installed along with the package in your TeX distribution, and you can find it by writing texdoc chemmacros
in a command prompt/terminal (or in the search field in the start menu, if you're on Windows). Or you can get it at http://www.ctan.org/pkg/chemmacros
Complete code:
\documentclass{article}
\usepackage{chemmacros}
\begin{document}
\ch{S + E <>[ $k_{\mathrm{SI}}$ ][ $k_{\mathrm{IS}}$ ] E.I <>[ $k_{\mathrm{PI}}$ ][ $k_{\mathrm{IP}}$ ] P + E}
\end{document}
The default is for equations is to center them, and there are several way you can get the equations left aligned.
If you want all your equations left aligned you can use the
fleqn
option to theamsmath
package:Note that equations are aligned on the left but not flush with the margin. If you desire them further to the left you can adjust
\mathindent
. For instance, to get them to be flush with the margin you can apply\setlength{\mathindent}{0pt}
:If you don't want all the equations to be left aligned then you could use the
flalign
environment for the ones which you desire to be left aligned. This yields and output similar to the first image with the equations aligned to the left, but not flush with the margin.If you add a trailing
&
to at least one of the equations then you end up with the equations flush with the margin.And, as egreg pointed out, you can also use the
align
(oralignat
) environment which can be used to specify that the equations be left aligned. These won't be flush with the margin so the output will be as in the first image above.
Notes:
- The
showframe
package was used just to show the page margins. It is not needed in your actual use case.
Code: fleqn
option:
\documentclass{article}
\usepackage{showframe}
\usepackage[fleqn]{amsmath}
\newcommand*{\MyEquations}{%
\begin{equation}
\alpha_{ng}^{min}-\alpha_{ng}^{max}+\gamma_n\leq C_{ng}~~\forall g\in\phi^{G-n},\forall n\in\phi^N
\end{equation}
\begin{equation}
\beta_l^{min}-\beta_l^{max}+\frac{\epsilon_l^{min}}{\beta_l}-\frac{\epsilon_l^{max}}{\beta_l}-\gamma_{n}=0~~\forall l\in\phi^L\mid SB(l)=n\\
\end{equation}
\begin{equation}
\beta_l^{min}-\beta_l^{max}+\frac{\epsilon_l^{min}}{\beta_l}-\frac{\epsilon_l^{max}}{\beta_l}+\gamma_{n}=0~~\forall l\in\phi^L\mid RB(l)=n\\
\end{equation}
\begin{gather}
\begin{split}
&-\sum_{\forall l \in\phi^l\mid SB(l)=n}\epsilon_l^{min}+\sum_{\forall l \in\phi^l\mid RB(l)=n}\epsilon_l^{min}\\
&+\sum_{\forall l \in\phi^l\mid SB(l)=n}\epsilon_l^{max}-\sum_{\forall l \in\phi^l\mid RB(l)=n}\epsilon_l^{max}\nonumber\\
&+\delta_n^{min}-\delta_n^{max}=0~~\forall n\in \phi^n\\
\end{split}
\end{gather}%
}
\begin{document}
\noindent
Using \verb|fleqn| option:
\MyEquations
\noindent
With \verb|fleqn| option and \verb|\mathindent=0pt|:
\setlength{\mathindent}{0pt}
\MyEquations
\end{document}
Code: flalign
environment:
\documentclass{article}
\usepackage{showframe}
\usepackage{amsmath}
\begin{document}
\noindent
Using \verb|flalign| environment:
\begin{flalign}
&\alpha_{ng}^{min}-\alpha_{ng}^{max}+\gamma_n\leq C_{ng}~~\forall g\in\phi^{G-n},\forall n\in\phi^N \\
&\beta_l^{min}-\beta_l^{max}+\frac{\epsilon_l^{min}}{\beta_l}-\frac{\epsilon_l^{max}}{\beta_l}-\gamma_{n}=0
\forall l\in\phi^L\mid SB(l)=n\\
&\beta_l^{min}-\beta_l^{max}+\frac{\epsilon_l^{min}}{\beta_l}-\frac{\epsilon_l^{max}}{\beta_l}+\gamma_{n}=0~~\forall l\in\phi^L\mid RB(l)=n \\\nonumber
&-\sum_{\forall l \in\phi^l\mid SB(l)=n}\epsilon_l^{min}+\sum_{\forall l \in\phi^l\mid RB(l)=n}\epsilon_l^{min}\\\nonumber
&+\sum_{\forall l \in\phi^l\mid SB(l)=n}\epsilon_l^{max}-\sum_{\forall l \in\phi^l\mid RB(l)=n}\epsilon_l^{max}\\\nonumber
&+\delta_n^{min}-\delta_n^{max}=0~~\forall n\in \phi^n
\end{flalign}
Using \verb|flalign| environment
with a trailing \verb|&|:
\begin{flalign}
&\alpha_{ng}^{min}-\alpha_{ng}^{max}+\gamma_n\leq C_{ng}~~\forall g\in\phi^{G-n},\forall n\in\phi^N &\\
&\beta_l^{min}-\beta_l^{max}+\frac{\epsilon_l^{min}}{\beta_l}-\frac{\epsilon_l^{max}}{\beta_l}-\gamma_{n}=0
\forall l\in\phi^L\mid SB(l)=n\\
&\beta_l^{min}-\beta_l^{max}+\frac{\epsilon_l^{min}}{\beta_l}-\frac{\epsilon_l^{max}}{\beta_l}+\gamma_{n}=0~~\forall l\in\phi^L\mid RB(l)=n \\\nonumber
&-\sum_{\forall l \in\phi^l\mid SB(l)=n}\epsilon_l^{min}+\sum_{\forall l \in\phi^l\mid RB(l)=n}\epsilon_l^{min}\\\nonumber
&+\sum_{\forall l \in\phi^l\mid SB(l)=n}\epsilon_l^{max}-\sum_{\forall l \in\phi^l\mid RB(l)=n}\epsilon_l^{max}\\\nonumber
&+\delta_n^{min}-\delta_n^{max}=0~~\forall n\in \phi^n
\end{flalign}
\end{document}
Code: align
environment:
\documentclass{article}
\usepackage{showframe}
\usepackage{amsmath}
\begin{document}
\noindent
Using \verb|align| environment:
\begin{align}
&\alpha_{ng}^{min}-\alpha_{ng}^{max}+\gamma_n\leq C_{ng}~~\forall g\in\phi^{G-n},\forall n\in\phi^N \\
&\beta_l^{min}-\beta_l^{max}+\frac{\epsilon_l^{min}}{\beta_l}-\frac{\epsilon_l^{max}}{\beta_l}-\gamma_{n}=0
\forall l\in\phi^L\mid SB(l)=n\\
&\beta_l^{min}-\beta_l^{max}+\frac{\epsilon_l^{min}}{\beta_l}-\frac{\epsilon_l^{max}}{\beta_l}+\gamma_{n}=0~~\forall l\in\phi^L\mid RB(l)=n \\\nonumber
&-\sum_{\forall l \in\phi^l\mid SB(l)=n}\epsilon_l^{min}+\sum_{\forall l \in\phi^l\mid RB(l)=n}\epsilon_l^{min}\\\nonumber
&+\sum_{\forall l \in\phi^l\mid SB(l)=n}\epsilon_l^{max}-\sum_{\forall l \in\phi^l\mid RB(l)=n}\epsilon_l^{max}\\\nonumber
&+\delta_n^{min}-\delta_n^{max}=0~~\forall n\in \phi^n
\end{align}
\end{document}
Best Answer
The
amsmath
package provides a number of environments to simplify typesetting multi-line displayed equations. For the case at hand, using analignat
environment would seem like a natural choice.Aside: Observe that TeX and LaTeX typeset math-mode numerals and equation numbers as well as both round and square parentheses with an upright font shape. That's quite different from the screenshot you posted.