Text Formattingmulticol | Uneven Columns that don't split itemized Lists

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
HunterDX77M
Posts: 2
Joined: Tue Jun 19, 2012 6:48 pm

multicol | Uneven Columns that don't split itemized Lists

Post by HunterDX77M »

Hello, all. I just joined the forum today and am new to LaTeX.

I was making a sheet for one of my students (I'm a math tutor) that shows examples of how to solve equations and was using the multicol package. At the moment, the columns are the same length on the page, which cuts off a certain item and makes it continue on the next column, which is going to confuse my student. How would I make it so that individual items in a column stay wholly in one column and don't "spill over" into the next column?

Here is the code that I am using. Please excuse any bad habits of LaTeX coding that might be there, as I'm new to LaTeX, and my primary concern was to get it to work and later make it look nice.

Code: Select all

\documentclass[10pt]{article}
\usepackage{multicol}
\begin{document}
\begin{multicols}{2}
	\begin{enumerate}
	\item $2x - 3 = 13$
	
	$2x - 3 + 3 = 13 + 3$	
	
	$2x + 0 = 16$
	
	$2x = 16$
	
	$x = 16 \div 2$
	
	$x = 8$
	
	\item $\frac{x}{3} + 2 = 10$
	
	$\frac{x}{3} + 2 - 2 = 10 - 2$
	
	$\frac{x}{3} + 0 = 8$
	
	$\frac{x}{3} = 8$
	
	$\frac{x}{3} \times \frac{3}{1} = 8 \times \frac{3}{1}$
	
	$x = 8 \times 3$
	
	$x = 24$
	
	\item $2x^2 = 128$
	
	$2x^2 \div 2= 128 \div 2$
	
	$x^2 = 64$
	
	$\sqrt{x^2} = \sqrt{64}$
	
	$x = 8 ~~ or ~~ -8$
	
	$x = 8 ~~ or ~~ x=-8$
	
	\item $(x + 1)^2 - 2 = 7$
	
	$(x + 1)^2 - 2 + 2 = 7 + 2$
	
	$(x + 1)^2 + 0 = 9$
	
	$(x + 1)^2 = 9$
	
	$\sqrt{(x + 1)^2} = \sqrt{9}$
	
	$\sqrt{(x + 1)^2} = 3 ~~ or  ~~ -3$
	
	$(x + 1) = 3 ~~ or ~~ (x + 1) = -3$
	
	$x + 1 = 3 ~~ or ~~ x + 1 = -3$
	
	$x + 1 - 1 = 3 - 1 ~~ or ~~ x + 1 - 1 = -3 - 1$
	
	$x = 2 ~~ or ~~ x = -4$
	
	\end{enumerate}
\end{multicols}
\end{document}
WARNING: You are in the presence of a n00b. Stupid questions can and will be asked.

Operating System: Ubuntu Linux 12.04 LTS
Editor/IDE: TexMaker

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

multicol | Uneven Columns that don't split itemized Lists

Post by localghost »

Use the multicols* environment as explained in Section 2.2 of the multicol manual.


Best regards and welcome to the board
Thorsten
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

multicol | Uneven Columns that don't split itemized Lists

Post by cgnieder »

You could be the first test user of my experimental exsheets package (which you can get here). It provides the environment tasks which is similar to the itemize or enumerate but lets you choose the number of columns without another package and never breaks individual items at all (which also could be a design flaw...)

If you consider using it, be sure to put the files

Code: Select all

exsheets_headings.def
exsheets_headings.cfg
exsheets_tasks.def
exsheets_tasks.cfg
in the same directory as the exsheets.sty file.

Code: Select all

\documentclass[10pt]{article}
\usepackage{kantlipsum}% just for dummy text
\usepackage[load-tasks]{exsheets} % get it here: https://bitbucket.org/cgnieder/exsheets/
\begin{document}
\kant[1]
\begin{tasks}[style=enumerate]{2}
 %% first
 $2x - 3 = 13$ \par
 $2x - 3 + 3 = 13 + 3$ \par
 $2x + 0 = 16$ \par
 $2x = 16$ \par
 $x = 16 \div 2$ \par
 $x = 8$ ;
 %% second
 $\frac{x}{3} + 2 = 10$ \par
 $\frac{x}{3} + 2 - 2 = 10 - 2$ \par
 $\frac{x}{3} + 0 = 8$ \par
 $\frac{x}{3} = 8$ \par
 $\frac{x}{3} \times \frac{3}{1} = 8 \times \frac{3}{1}$ \par
 $x = 8 \times 3$ \par
 $x = 24$ ;
 %% third
 $2x^2 = 128$ \par
 $2x^2 \div 2= 128 \div 2$ \par
 $x^2 = 64$ \par
 $\sqrt{x^2} = \sqrt{64}$ \par
 $x = 8 ~~ or ~~ -8$ \par
 $x = 8 ~~ or ~~ x=-8$ ;
 %% forth
 $(x + 1)^2 - 2 = 7$ \par
 $(x + 1)^2 - 2 + 2 = 7 + 2$ \par
 $(x + 1)^2 + 0 = 9$ \par
 $(x + 1)^2 = 9$ \par
 $\sqrt{(x + 1)^2} = \sqrt{9}$ \par
 $\sqrt{(x + 1)^2} = 3 ~~ or  ~~ -3$ \par
 $(x + 1) = 3 ~~ or ~~ (x + 1) = -3$ \par
 $x + 1 = 3 ~~ or ~~ x + 1 = -3$ \par
 $x + 1 - 1 = 3 - 1 ~~ or ~~ x + 1 - 1 = -3 - 1$ \par
 $x = 2 ~~ or ~~ x = -4$
\end{tasks}
\end{document}
exsheets.png
exsheets.png (37.63 KiB) Viewed 9499 times
Regards
site moderator & package author
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

multicol | Uneven Columns that don't split itemized Lists

Post by cgnieder »

HunterDX77M wrote:How would I make it so that individual items in a column stay wholly in one column and don't “spill over” into the next column?
BTW: multicols* does not prevent items to be broken (see example below). It simply doesn't balance the columns if a page is not full.

Code: Select all

\documentclass[10pt]{article}
\usepackage{multicol}
\usepackage{lipsum}% for dummy text
\begin{document}
\begin{multicols*}{2}
\begin{enumerate}
 \item \lipsum[2]
 \item \lipsum[2]
 \item \lipsum[2]
 \item \lipsum[2]
\end{enumerate}
\end{multicols*}
\end{document}
If you don't want the items to be broken (and don't want another package) the simplest thing would be to put the item into boxes or minipages:

Code: Select all

\documentclass[10pt]{article}
\usepackage{multicol}
\usepackage{lipsum}% for dummy text
\newcommand\Item[1]{\item\begin{minipage}[t]{\linewidth}#1\end{minipage}}
\begin{document}
\begin{multicols}{2}
\begin{enumerate}
 \Item{\lipsum[2]}
 \Item{\lipsum[2]}
 \Item{\lipsum[2]}
 \Item{\lipsum[2]}
\end{enumerate}
\end{multicols}
\end{document}
Best regards
site moderator & package author
Post Reply