Latex Math Expression Alignment

Latex Math Expression Alignment

I have an issue with aligning some math expressions. Is it possible to make some expressions aligned to "&" sign and some to the center of the page with align? I've done it as seen in the screenshot but there are some empty lines in between. I would like to align the first and the second last line to center and the rest to "&" sign without the empty spaces. Thank you in advance

\begin{gather}
    |e(t)| \leq e_{lim} \Rightarrow t \in \left\langle t_{set}; \infty\right) \label{eq:settling_time}
\end{gather}
\begin{align}
    \left|\frac{1}{K_p\cdot K_s - p_1}\cdot \left[K_p\cdot K_s\cdot e^{(p_1 - K_p\cdot K_s)\cdot t} - p_1\right]\right| &\leq e_{lim} \nonumber \\
    \frac{1}{K_p\cdot K_s - p_1}\cdot \left[K_p\cdot K_s\cdot e^{(p_1 - K_p\cdot K_s)\cdot t} - p_1\right] &> 0; \quad t \in \mathbb{R}_0^+ \nonumber \\
    \frac{1}{K_p\cdot K_s - p_1}\cdot \left[K_p\cdot K_s\cdot e^{(p_1 - K_p\cdot K_s)\cdot t} - p_1\right] &\leq e_{lim} \nonumber \\
    K_p\cdot K_s\cdot e^{(p_1 - K_p\cdot K_s)\cdot t} - p_1 &\leq e_{lim}\cdot (K_p\cdot K_s - p_1) \nonumber \\
    K_p\cdot K_s\cdot e^{(p_1 - K_p\cdot K_s)\cdot t} &\leq e_{lim}\cdot (K_p\cdot K_s - p_1) + p_1 \nonumber \\
    e^{(p_1 - K_p\cdot K_s)\cdot t} &\leq \frac{e_{lim}\cdot (K_p\cdot K_s - p_1) + p_1}{K_p\cdot K_s} \nonumber \\
    (p_1 - K_p\cdot K_s)\cdot t &\leq \ln \left[\frac{e_{lim}\cdot (K_p\cdot K_s - p_1) + p_1}{K_p\cdot K_s}\right] \nonumber \\
    t &\geq \frac{\displaystyle \ln \left[\frac{\displaystyle e_{lim}\cdot (K_p\cdot K_s - p_1) + p_1}{\displaystyle K_p\cdot K_s}\right]}{\displaystyle p_1 - K_p\cdot K_s} \nonumber
\end{align}
\begin{gather}
    t \in \Bigg \langle \frac{\displaystyle \ln \left[\frac{\displaystyle e_{lim}\cdot (K_p\cdot K_s - p_1) + p_1}{\displaystyle K_p\cdot K_s}\right]}{\displaystyle p_1 - K_p\cdot K_s}; \infty \Bigg) \in \left\langle t_{set}; \infty \right) \nonumber \\
    t_{set} = \frac{\displaystyle \ln \left[\frac{\displaystyle e_{lim}\cdot (K_p\cdot K_s - p_1) + p_1}{\displaystyle K_p\cdot K_s}\right]}{\displaystyle p_1 - K_p\cdot K_s} \label{eq:settling_time_1st_order_P_reg}
\end{gather}
1

2 Answers

You can set the aligned components within the gather using aligned:

\documentclass{article}

\usepackage{amsmath,amssymb}

\begin{document}

\begin{gather}
  | e(t) | \leq e_{\text{lim}} \Rightarrow t \in \langle t_{\text{set}}; \infty ) \\
  \begin{aligned}
    \biggl| \frac{1}{K_p \cdot K_s - p_1} \cdot \bigl[ K_p \cdot K_s \cdot e^{(p_1 - K_p \cdot K_s) \cdot t} - p_1 \bigr] \biggr| & 
      \leq e_{\text{lim}} \\
    \frac{1}{K_p \cdot K_s - p_1} \cdot \bigl[ K_p \cdot K_s \cdot e^{(p_1 - K_p \cdot K_s) \cdot t} - p_1 \bigr] &
      > 0; \quad t \in \mathbb{R}_0^+ \\
    \frac{1}{K_p \cdot K_s - p_1} \cdot \bigl[ K_p \cdot K_s \cdot e^{(p_1 - K_p \cdot K_s) \cdot t} - p_1 \bigr] &
      \leq e_{\text{lim}} \\
    K_p \cdot K_s \cdot e^{(p_1 - K_p \cdot K_s) \cdot t} - p_1 &
      \leq e_{\text{lim}} \cdot (K_p \cdot K_s - p_1) \\
    K_p \cdot K_s \cdot e^{(p_1 - K_p \cdot K_s) \cdot t} &
      \leq e_{\text{lim}} \cdot (K_p \cdot K_s - p_1) + p_1 \\
    e^{(p_1 - K_p \cdot K_s) \cdot t} &
      \leq \frac{e_{\text{lim}} \cdot (K_p \cdot K_s - p_1) + p_1}{K_p \cdot K_s} \\
    (p_1 - K_p \cdot K_s) \cdot t &
      \leq \ln \biggl[ \frac{e_{\text{lim}} \cdot (K_p \cdot K_s - p_1) + p_1}{K_p \cdot K_s} \biggr] \\
    t &
      \geq \frac{\ln \biggl[ \dfrac{e_{\text{lim}} \cdot (K_p \cdot K_s - p_1) + p_1}{K_p \cdot K_s} \biggr]}{p_1 - K_p \cdot K_s}
  \end{aligned} \nonumber \\
    t \in \Bigg \langle \frac{ \ln \biggl[ \dfrac{e_{\text{lim}} \cdot (K_p \cdot K_s - p_1) + p_1}{K_p \cdot K_s} \biggr]}{p_1 - K_p \cdot K_s}; \infty \Bigg) \in \langle t_{\text{set}}; \infty ) \nonumber \\
    t_{\text{set}} = \frac{\ln \biggl[ \dfrac{e_{\text{lim}} \cdot (K_p \cdot K_s - p_1) + p_1}{K_p \cdot K_s} \biggr]}{p_1 - K_p \cdot K_s}
\end{gather}

\end{document}

I would suggest using the \IEEEeqnarray environment. If you use the * version of this, you can get rid of all the \nonumber commands (9 in this case) and insert \yesnumber commands (2 in this case) where equation no is necessary.

\documentclass{article}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{IEEEtrantools}

%-------Shows page layout-------------------
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%-------------------------------------------

\begin{document}
    \begin{IEEEeqnarray*}{rcl}
        \IEEEeqnarraymulticol{3}{c}{|e(t)| \leq e_{lim} \Rightarrow t \in \left\langle t_{set}; \infty\right)} \yesnumber \label{eq:settling_time}\\
        \left|\frac{1}{K_p\cdot K_s - p_1}\cdot \left[K_p\cdot K_s\cdot e^{(p_1 - K_p\cdot K_s)\cdot t} - p_1\right]\right| & \leq & e_{lim}  \\
        \frac{1}{K_p\cdot K_s - p_1}\cdot \left[K_p\cdot K_s\cdot e^{(p_1 - K_p\cdot K_s)\cdot t} - p_1\right]              & >    & 0; \quad t \in \mathbb{R}_0^+  \\
        \frac{1}{K_p\cdot K_s - p_1}\cdot \left[K_p\cdot K_s\cdot e^{(p_1 - K_p\cdot K_s)\cdot t} - p_1\right]              & \leq & e_{lim}  \\
        K_p\cdot K_s\cdot e^{(p_1 - K_p\cdot K_s)\cdot t} - p_1                                                             & \leq & e_{lim}\cdot (K_p\cdot K_s - p_1)  \\
        K_p\cdot K_s\cdot e^{(p_1 - K_p\cdot K_s)\cdot t}                                                                   & \leq & e_{lim}\cdot (K_p\cdot K_s - p_1) + p_1  \\
        e^{(p_1 - K_p\cdot K_s)\cdot t}                                                                                     & \leq & \frac{e_{lim}\cdot (K_p\cdot K_s - p_1) + p_1}{K_p\cdot K_s}  \\
        (p_1 - K_p\cdot K_s)\cdot t                                                                                         & \leq & \ln \left[\frac{e_{lim}\cdot (K_p\cdot K_s - p_1) + p_1}{K_p\cdot K_s}\right]  \\
        t                                                                                                                   & \geq & \frac{\displaystyle \ln \left[\frac{\displaystyle e_{lim}\cdot (K_p\cdot K_s - p_1) + p_1}{\displaystyle K_p\cdot K_s}\right]}{\displaystyle p_1 - K_p\cdot K_s} \\
        \IEEEeqnarraymulticol{3}{c}{t \in \Bigg \langle \frac{\displaystyle \ln \left[\frac{\displaystyle e_{lim}\cdot (K_p\cdot K_s - p_1) + p_1}{\displaystyle K_p\cdot K_s}\right]}{\displaystyle p_1 - K_p\cdot K_s}; \infty \Bigg) \in \left\langle t_{set}; \infty \right)}  \\
        \IEEEeqnarraymulticol{3}{c}{t_{set} = \frac{\displaystyle \ln \left[\frac{\displaystyle e_{lim}\cdot (K_p\cdot K_s - p_1) + p_1}{\displaystyle K_p\cdot K_s}\right]}{\displaystyle p_1 - K_p\cdot K_s}} \yesnumber \label{eq:settling_time_1st_order_P_reg}
    \end{IEEEeqnarray*}
\end{document}  

Appendix F of this document covers the use of the IEEEeqnarray commands.

As mentioned in the comment, you may find quicker responses in TEX.SE

0

Your Answer

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

Robert Thorne
Author

Robert Thorne

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.