# How to make the following alignat example prettier?

Using the alignat environment (for my first time), I managed to make the following example:

The following code was used:

\usepackage{amsmath,amssymb}
\begin{document}

\begin{alignat*}{5}
\end{alignat*}

\end{document}


What I want to do is (i) align $t$ at the center and (ii) align $-\infty$ and $e^{\alpha t}$ at the right. How can I achieve this?

• You need to understand the number of &'s and where to place them. Her you have 4(?) alignment points so you'll need 7 & per line (4 for alignment and 3 for separating the alignment columns). Remember that each alignment column is a left-hand & right-hand where the left-hand is right-aligned and right-hand is left aligned. So your first problem is solved by moving the first &. Commented Dec 6, 2022 at 11:33

An alternative solution is to use an array like this:


\begin{equation*}
\begin{array} {rcccl}
\end{array}
\end{equation*}


Result:

Something like this

\documentclass[a4paper]{article}
\usepackage{amsmath,amssymb}
\begin{document}

\begin{alignat*}{6}
\\
e^{\alpha t}                                           &       & \longleftarrow &       & \psi_\lambda^- & (t) &       & \longrightarrow &       & B_-(\lambda) e^{\alpha t} + A_-(\lambda)  e^{-\alpha t}
\\
A_+(\lambda) e^{\alpha t} + B_+(\lambda) e^{-\alpha t} &       & \longleftarrow &       & \psi_\lambda^+ & (t) &       & \longrightarrow &       &
e^{-\alpha t}
\end{alignat*}

\end{document}


You can use IEEEtrantools:

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{IEEEtrantools}

\begin{document}

\begin{IEEEeqnarray*}{r C c C l}
-\infty     & \longleftarrow & t                 & \longrightarrow & \infty \\
%
e^{\alpha t} & \longleftarrow & \psi_\lambda^-(t) & \longrightarrow &
B_-(\lambda) e^{\alpha t} + A_-(\lambda) e^{-\alpha t} \\
%
A_+(\lambda) e^{\alpha t} + B_+(\lambda) e^{-\alpha t}
& \longleftarrow & \psi_\lambda^+(t) & \longrightarrow & e^{-\alpha t}
\end{IEEEeqnarray*}

\end{document}