# Aligning multiple functions across multiple lines

I am developing a LaTeX document that includes several math formulas. In this document, I'd like to print a list of six limit equations formatted in two rows with three equations each. For each "column" created in this configuration, I'd like the equations in each of the two "rows" to be aligned at the left-most side of the equation. I have tried several configurations, but I am not getting the proper alignment . I am using the following code which applies the \align function:

\textbf{Vertical asymptote} - For a function $y = f(x)$, a line $x = a$ given that at least one of the following is true:\\
\\
\begin{align}
\begin{aligned}
&\lim_{x \to a} f(x) = \infty  &\lim_{x \to a^{-}} f(x) = \infty &\lim_{x \to a^{+}} = \infty \nonumber\\
&\lim_{x \to a} f(x) = -\infty &\lim_{x \to a^{-}} f(x) = -\infty &\lim_{x \to a^{+}} = -\infty \nonumber
\end{aligned}
\end{align}



This produces the following PDF:

I would like the values to appear as shown below. (Note this is rough sketch done in Word to show the desired alignment.)

As I understand it, the "&" indicates where the equations are to be aligned, but this does not appear to be working. The equations in the first & third "columns" appear to be aligned, but not the equations in the second "column". Also, the "columns" are squished together.

Any thoughts on how I might adjust this code to accomplish proper alignment?

• the intention of align is you mark the alignment points at the = so &= the layout you want will then be automatic. unrelated but never use \\  before the alignment Oct 5, 2021 at 19:05

## 2 Answers

I put my answer in relation to my tastes :-) with the enviroment alignat...I observe that there are the packages geometry (to fit all in the page) and parskip to have not any indents.

\documentclass[12pt]{article}

\usepackage{amsmath,amssymb}
\usepackage{geometry,parskip}

\begin{document}
\textbf{Vertical asymptote}:  For a function $y = f(x)$, a line $x = a$ given that at least one of the following is true:
\begin{alignat}{3}
\lim_{x \to a} f(x) &=\infty, & \quad \lim_{x \to a^{-}} f(x) & =\infty,  & \quad \lim_{x \to a^{+}} f(x) &=\infty \nonumber\\
\lim_{x \to a} f(x) &=-\infty, & \quad \lim_{x \to a^{-}} f(x) & =-\infty,  & \quad \lim_{x \to a^{+}} f(x) &=-\infty \nonumber
\end{alignat}

\end{document}


You could manage this in a much simpler way:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\textbf{Vertical asymptote} - For a function $y = f(x)$, a line $x = a$ given that at least one of the following is true:
\begin{align*}
\lim_{x \to a} f(x) &=  \infty & \lim_{x \to a^-} f(x) &=  \infty & \lim_{x \to a^+} f(x) &=  \infty \\
\lim_{x \to a} f(x) &= -\infty & \lim_{x \to a^-} f(x) &= -\infty & \lim_{x \to a^+} f(x) &= -\infty
\end{align*}

\end{document}


Use a & at every alignment point, and & to separate the respective alignments (hence 2n-1 number of &s).

• Hi, in the 3-th column is missed the f(x). Oct 5, 2021 at 19:08