1

I want to use multi-line equation in my essay but when I use it the alignment of the equations become destruct. please help me, thank you in advance

this is my code:

\documentclass[5p,fleqn]{elsarticle}

\usepackage{lineno,hyperref}
\modulolinenumbers[10]
\usepackage{amsmath}

\begin{document}

\begin{equation}
\begin{aligned}
z=0, \forall r \in [R_i,R_o]: (uC_i)=(uC_i)_{in}, T=T_{in}, \\
P=P_{in}, (u_p C_{j,p})=0, \\
i=CH_4,H_2O, CO, CO_2,  j=H_2O,H_2 
\label{E21}
\end{aligned}
\end{equation}

\begin{equation}
\begin{split}
r=r_0, \forall z \in [0,L]: \frac{\partial (uC_i)}{\partial r}=0,\\
k_a \frac{\partial T}{\partial r}=h_w (T_w-T)
\label{E22}
\end{split}
\end{equation}


\begin{equation}
\begin{split}
r=r_i, \forall z \in [0,L]: \frac{\partial (uC_i)}{\partial r}=0,\\
 i=CH_4,H_2O, CO, CO_2,\\
\frac{d_p}{Pe_m}\frac{\partial (uC_j)}{\partial r}=N_m, j=H_2,\\      
\frac{\partial T}{\partial r}=0 
\label{E23}
\end{split}
\end{equation}

\end{document}

the result attached, enter image description here

  • 1
    Crosspost – Johannes_B Nov 22 '18 at 8:28
  • 2
    It is still unclear to me what you are trying to align where. – Johannes_B Nov 22 '18 at 8:31
  • I wanna to design my formula start from left edge of my essay and continue to right, I apologize in advance because I'm a beginner in latex – Alireza Abedin Nov 22 '18 at 8:36
  • 3
    The description "I wanna design my formula [to] start from left edge of my essay and continue to right" is rather uninformative and nonspecific. Please be a lot more specific. – Mico Nov 22 '18 at 9:42
1

Welcome to TeX.SX!. I have the same opinion with @Mico, that you should explain what you want more, or at least we need a picture stating what you need, so that we don't have to guess :)

Anyway, I think this is what you need:

\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{align}
    &\begin{array}{l}
        z=0, \forall r \in [R_i,R_o]: (uC_i)=(uC_i)_{in},    T=T_{in},\\
        P=P_{in}, (u_p C_{j,p})=0,\\
        i=CH_4,H_2O, CO, CO_2,  j=H_2O,H_2
    \end{array}\label{something1}\\[2ex]
    &\begin{array}{l}
        r=r_0, \forall z \in [0,L]: \dfrac{\partial (uC_i)}{\partial r}=0,\\
        k_a \dfrac{\partial T}{\partial r}=h_w (T_w-T)
    \end{array}\label{something2}\\[2ex]
    &\begin{array}{l}
        r=r_i, \forall z \in [0,L]: \dfrac{\partial (uC_i)}{\partial r}=0,\\
        i=CH_4,H_2O, CO, CO_2,\\
        \dfrac{d_p}{Pe_m}\dfrac{\partial (uC_j)}{\partial r}=N_m, j=H_2,\\[2ex]
        \dfrac{\partial T}{\partial r}=0 
    \end{array}\label{something3}
\end{align}
\lipsum[2]
\end{document}

enter image description here

As for the chemical symbols like H2O, CO2..., I recommend using a package which is designed for chemistry. See other TeX.SX questions relating to this, for instance, How to write a chemical formula?, etc. I'm sorry not to use it in the code above, because I have never used it :)

  • Thank you very much dear, You exactly do what I want. Thanks :) – Alireza Abedin Nov 22 '18 at 13:14

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.