# making cheatsheet - in-line equations for latex in aligned environment

I am a student relatively new to latex compared to you all. I have a vector calculus final where we are allotted one cheatsheet front and back. I have a really good five-column landscape mode cheatsheet but the problem is when I use \begin{flalign*} to type equations in, they show up with lots of space in between. And also they take too much verticle space. For example:

If I do:

\begin{flalign*}
\nabla \times \mathbf{F} &= (1, 1, -2) \\
\iint_{S} \nabla \times \mathbf{F} \cdot d\mathbf{S} &= \iint_{S} (1, 1, -2) \cdot (0, 0, 1)\, dS = -2 \times \text{Area of } S = -2\pi \\
\oint_{\partial S} \mathbf{F} \cdot d\mathbf{r} &= \oint_{\partial S} (y, -x, z) \cdot (dx, dy, 0) = -2\pi
\end{flalign*}


Ill get

The issue with this is:

1. The integrals take up too much space like they are in equation mode $$equation$$. I want inline equation spacing.
2. The equations don't wrap.

So I have to instead manually change all this to in-line equations with line breaks at the end:

\textbf{Solution:} \\
$\nabla \times \mathbf{F} = (1, 1, -2)$ \\
$\iint_{S} \nabla \times \mathbf{F} \cdot d\mathbf{S} = \iint_{S} (1, 1, -2) \cdot (0, 0, 1)\, dS = -2 \times \text{Area of } S = -2\pi$ \\
$\oint_{\partial S} \mathbf{F} \cdot d\mathbf{r} = \oint_{\partial S} (y, -x, z) \cdot (dx, dy, 0) = -2\pi$ \\


so I get it like this:

but I still don't get the alignment that \begin{flalign*} provides you with. At least I get wrapping and I get CONDENSED equations.

TLDR: How can I do inline equation height with aligned environment? I just want small equations with structure.

• Welcome to TeX.SX! Please provide a minimal compilable document (MWE) for your current issue. Commented Dec 13, 2023 at 6:17

Maybe just array and line-breaking by hand? If you really want to pack content in, you're probably going to have to fiddle a bit. Or you could use a p type column to automate line-breaking, but the results may break in stranger places.

Either result is rather ugly, but entirely legible, somewhat structured and quite densely packed.

\documentclass{article}
\usepackage{mathtools}
\usepackage{array}
\begin{document}
\noindent\textbf{Solution:}\par
\noindent
$\begin{array}{l!{=}l} \nabla \times \mathbf{F} & (1, 1, -2) \\ \iint_{S} \nabla \times \mathbf{F} \cdot d\mathbf{S} & \iint_{S} (1, 1, -2) \cdot (0, 0, 1)\, dS \\ & -2 \times \text{Area of } S = -2\pi \\ \oint_{\partial S} \mathbf{F} \cdot d\mathbf{r} & \oint_{\partial S} (y, -x, z) \cdot (dx, dy, 0) \\ & -2\pi \\ \end{array}$

\noindent\textbf{Solution:}\par
\noindent
$\begin{array}{l!{=}>{$}p{.35\textwidth}<{$}} \nabla \times \mathbf{F} & (1, 1, -2) \\ \iint_{S} \nabla \times \mathbf{F} \cdot d\mathbf{S} & \iint_{S} (1, 1, -2) \cdot (0, 0, 1)\, dS = -2 \times \text{Area of } S = -2\pi \\ \oint_{\partial S} \mathbf{F} \cdot d\mathbf{r} & \oint_{\partial S} (y, -x, z) \cdot (dx, dy, 0) = -2\pi \\ \end{array}$
\end{document}


Note that there is a balance to be struck between the volume of information you put on your sheet and the speed with which you can find it under time pressure. While you don't want to waste too much vertical space, packing too much in may not be the optimal strategy either.

You can use \textstyle to switch to inline math style instead of the default display style (see Show inline math as if it were display math (and vice versa)). Getting it to wrap is best done manually.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{flalign*}
\nabla \times \mathbf{F}
&= (1, 1, -2) \\
\textstyle \iint_{S} \nabla \times \mathbf{F} \cdot d\mathbf{S}
&= \textstyle \iint_{S} (1, 1, -2) \cdot (0, 0, 1)\, dS \\
&= -2 \times \text{Area of } S = -2\pi \\
\textstyle \oint_{\partial S} \mathbf{F} \cdot d\mathbf{r}
&= \textstyle \oint_{\partial S} (y, -x, z) \cdot (dx, dy, 0) = -2\pi
\end{flalign*}
\end{document}


\documentclass[12pt]{article}
\usepackage{amsmath}

\begin{document}

\textbf{First solution:}
\begin{align*}
\nabla \times \mathbf{F} &= (1, 1, -2) \\
\iint_{S} \nabla \times \mathbf{F} \cdot d\mathbf{S} &= \iint_{S} (1, 1, -2) \cdot (0, 0, 1)\, dS = -2 \times \text{Area of } S = -2\pi \\
\oint_{\partial S} \mathbf{F} \cdot d\mathbf{r} &= \oint_{\partial S} (y, -x, z) \cdot (dx, dy, 0) = -2\pi
\end{align*}

\textbf{Second solution:}
\begin{align*}
&\begin{aligned}
\nabla \times \mathbf{F} &= (1, 1, -2) \\
\iint_{S} \nabla \times \mathbf{F} \cdot d\mathbf{S} &= \iint_{S} (1, 1, -2) \cdot (0, 0, 1)\, dS = -2 \times \text{Area of } S = -2\pi \\
\oint_{\partial S} \mathbf{F} \cdot d\mathbf{r} &= \oint_{\partial S} (y, -x, z) \cdot (dx, dy, 0) = -2\pi
\end{aligned}
\end{align*}

\end{document}