Text FormattingMulticols Alignment ISsue

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Multicols Alignment ISsue

Post by coachbennett1981 »

I have been looking online to find a similar post, but I can't find the one I made years ago. You can see that my alignment is off. I am trying to align my number in each column with the number directly across from it. See questions 8,9,10 and how the alignment is off. Any help would be appreciated.

Code: Select all

\documentclass[12pt]{article}
\usepackage[margin=.5in]{geometry}
\usepackage{amsmath}
\usepackage{multicol}

\begin{document}


\subsection*{Derivatives with Product and Quotient Rules}
Find the derivative of each of the functions below.  Be sure to show your work. 
    \begin{multicols}{2}
        \begin{enumerate}
            \item $y=\big(4x-4\big)\big(\sqrt{x}+2\big)$
                \vspace{1.5in}
            \item $y=\dfrac{x+4}{x-4}$
                 \vspace{1.5in} 
            \item $y=\dfrac{x^3}{x-1}$
                 \vspace{1.5in}
            \item $y=11-x^6\cos x$
                 \vspace{1.5in}
            \item $y=2x^2e^x$
                 \vspace{1.5in}
            \item $y=x^7\tan x-\sqrt{x}$
                 \vspace{1.5in}
            \item $y=\Big(x+\dfrac{1}{x}\Big)\Big(x-\dfrac{1}{x}\Big)$
                 \vspace{1.5in}
            \item $y=x^3\cos x-9x$
            	\vspace{1.5in}
	   \item $\dfrac{x^8+3x+7}{x^2}$
	   	\vspace{1.5in}
	   \item $y=2\sin x\big(e^x\big)$
	   	\vspace{1.5in}
	\item $y=\dfrac{\tan x}{x}$
		\vspace{1.5in}
	\item $y=\dfrac{\sin x}{10x}+\dfrac{10x}{\sin x}$
		\vspace{1.5in}
        \end{enumerate}
        		\vspace{1.5in}
    \end{multicols}
   \end{document}

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Multicols Alignment ISsue

Post by Ijon Tichy »

The height and depth of formulas with \dfrac is different from formulas without \dfrac. So this is somehow like you would have the same distance between boxes with different height and depth: Because of the different height and depth they are not aligned, if the distance between them is the same. You have either adapt the distance between the boxes (or in your example the formulas) or you have to give them the same height and depth. Here I use \vphantom to try the second suggestion:

Code: Select all

\documentclass[12pt]{article}
\usepackage[margin=.5in]{geometry}
\usepackage{amsmath}
\usepackage{multicol}

\begin{document}


\subsection*{Derivatives with Product and Quotient Rules}
Find the derivative of each of the functions below.  Be sure to show your work. 
    \begin{multicols}{2}
        \begin{enumerate}
            \item $y=\big(4x-4\big)\big(\sqrt{x}+2\big)$
                \vspace{1.5in}
            \item $y=\dfrac{x+4}{x-4}$
                 \vspace{1.5in} 
            \item $y=\dfrac{x^3}{x-1}$
                 \vspace{1.5in}
            \item $y=11-x^6\cos x$
                 \vspace{1.5in}
            \item $y=2x^2e^x\vphantom{\dfrac{a}{b}}$
                 \vspace{1.5in}
            \item $y=x^7\tan x-\sqrt{x}\vphantom{\dfrac{a}{b}}$
                 \vspace{1.5in}
            \item $y=\Big(x+\dfrac{1}{x}\Big)\Big(x-\dfrac{1}{x}\Big)$
                 \vspace{1.5in}
            \item $y=x^3\cos x-9x\vphantom{\dfrac{a}{b}}$
            	\vspace{1.5in}
	   \item $\dfrac{x^8+3x+7}{x^2}$
	   	\vspace{1.5in}
	   \item $y=2\sin x\big(e^x\big)$
	   	\vspace{1.5in}
	\item $y=\dfrac{\tan x}{x}$
		\vspace{1.5in}
	\item $y=\dfrac{\sin x}{10x}+\dfrac{10x}{\sin x}$
		\vspace{1.5in}
        \end{enumerate}
        		\vspace{1.5in}
    \end{multicols}
   \end{document}
Using \parbox[c][<height>][c]{<width>}{$…$} with always the same and sufficient <height> for all the items could also help.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Post Reply