2

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:

Six limit equations configured in two rows & three columns

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

enter image description here

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?

1
  • 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 2

5

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}

enter image description here

3

You could manage this in a much simpler way:

enter image description here

\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).

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .