Math & ScienceHow to adjust the vertical spacements in two columns lists?

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

How to adjust the vertical spacements in two columns lists?

Post by Cham »

I would like to adjust the vertical spacements in the lists made with the MWE below. I want all vertical spacings to be constant (fixed). Currently, I'm hacking the vertical spacements using the \displaystyle and \vphantom commands.

Code: Select all

\documentclass[11pt,twoside]{book}
\usepackage{microtype,textcomp}
\usepackage[total={6.25in,10in},left=1.25in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{amsmath}
\usepackage{enumitem}
\usepackage{multicol}

\begin{document}

\begin{enumerate}
	\item Some questions :
		\begin{multicols}{2}
		\begin{enumerate}[label=\alph*)]
			\item $\displaystyle{\vphantom{\frac{1}{2}} x + 2 = 0}$.
			\medskip
			\item $\displaystyle{\vphantom{\frac{1}{2}} x + 2 = 5}$.
			\medskip
			\item $\displaystyle{\vphantom{\frac{1}{2}} 2 x + 2 = 0}$.
			\medskip
			\item $\displaystyle{\vphantom{\frac{1}{2}} 2 x = 4 x + 1}$.
			\medskip
			\item $\displaystyle{\vphantom{\frac{1}{2}} 4 x - 2 (x - 2) = 10}$.
			\medskip
			\item $\displaystyle{\vphantom{\frac{1}{2}} 5 x + 3 (2 x + 4) = 4 x - 9}$.
			\medskip
			\item $\displaystyle{\frac{5 x}{2} = 0}$.
			\medskip
			\item $\displaystyle{\frac{1}{2 x} = 5}$.
			\medskip
			\item $\displaystyle{\frac{1}{2 x - 1} = 5}$.
			\medskip
			\item $\displaystyle{\frac{1}{2 x - 5} + \frac{1}{5} = 0}$.
		\end{enumerate}
		\end{multicols}

	\item Some questions :
		\begin{multicols}{2}
		\begin{enumerate}[label=\alph*)]
			\item $\displaystyle{\frac{2}{3} + \frac{5}{9}}$.
			\medskip
			\item $\displaystyle{\frac{11}{15} + \frac{6}{20}}$.
			\medskip
			\item $\displaystyle{\frac{9}{4} + 2}$.
			\medskip
			\item $\displaystyle{\frac{5}{6} - \frac{2}{3}}$.
		\end{enumerate}
		\end{multicols}

	\item Some questions :
		\begin{multicols}{2}
		\begin{enumerate}[label=\alph*)]
			\item $\displaystyle{\vphantom{\frac{1}{2}} x \cdot x}$.
			\medskip
			\item $\displaystyle{\vphantom{\frac{1}{2}} 2 x \cdot 3 x^2}$.
			\medskip
			\item $\displaystyle{\frac{\displaystyle{4 x^2 \cdot 3 x y^2}}{\displaystyle{2 y^5}}}$.
			\medskip
			\item $\displaystyle{\frac{\displaystyle{8 x (x^2 + 4 x y)}}{\displaystyle{4 x^2}}}$.
		\end{enumerate}
		\end{multicols}
\end{enumerate}

\end{document}
Here's a preview of what this code is doing :
list.jpg
list.jpg (27.47 KiB) Viewed 10430 times
As you can see on that preview, the spacing between each item isn't exactly constant. How to fix the spacements between each item in a given list?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

How to adjust the vertical spacements in two columns lists?

Post by Cham »

Hmmm, apparently, the simplest solution is to add the option itemsep=12pt to the itemize list, and remove all the \medskip from the list.

Is this the simplest and the best solution?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

How to adjust the vertical spacements in two columns lists?

Post by Stefan Kottwitz »

multicols environment are meant to be balanced, so they will be stretched. \raggedcolumns prevents this. But that's probably not perfect too. I guess I would use a table with two columns, the items in cells, to get this into a grid.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

How to adjust the vertical spacements in two columns lists?

Post by Cham »

Well, apparently my issue is solved by the itemsep option. Try this MWE code:

Code: Select all

\documentclass[11pt,twoside]{book}
\usepackage{microtype,textcomp}
\usepackage[total={6.25in,10in},left=1.25in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{amsmath}
\usepackage{enumitem}
\usepackage{multicol}

\begin{document}

	\begin{multicols}{2}
		\begin{enumerate}[label=\alph*),itemsep=11pt]
			\item $\displaystyle{\vphantom{\frac{1}{2}} A}$.
			\item $\displaystyle{\vphantom{\frac{1}{2}} B}$.
			\item $\displaystyle{\vphantom{\frac{1}{2}} C}$.
			\item $\displaystyle{\vphantom{\frac{1}{2}} D}$.
			\item $\displaystyle{\vphantom{\frac{1}{2}} E}$.
		\end{enumerate}
	\end{multicols}

\end{document}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

How to adjust the vertical spacements in two columns lists?

Post by Stefan Kottwitz »

There are still the \vphantom commands in the code.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

How to adjust the vertical spacements in two columns lists?

Post by Cham »

Right. Removing the \vphantom commands reduces a bit the vertical spacing (set to 11 points), but it's still all uniform (no stretching). I think the issue is solved now, but I'll see this later, after my code as evolved.
Post Reply