Text Formattingmulticols problem

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 problem

Post by coachbennett1981 »

I can't seem to figure out why the second \paragraph is included in the multicol directly below it. Does anyone know how to fix this?

Code: Select all


\documentclass[12pt]{exam}
\usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}                   % ... or a4paper or a5paper or ... 
%\geometry{landscape}                % Activate for for rotated page geometry
%\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{multicol}
\usepackage{amsmath}
\usepackage{pst-plot}
\usepackage{pstricks-add}
\addpoints
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}
\pagestyle{headandfoot}
\firstpageheader{Section 2.6}{Precalculus}{Rational Functions and Their Graphs}
\runningheader{Section 2.6}{Precalculus}{Rational Functions and Their Graphs}
\firstpagefooter{}{}{}
\begin{document}


\fbox{\begin{tabular}{p{6in}}


 
\end{tabular}}

\paragraph{Example 1} Find the domain of each rational function:
	\begin{multicols}{3}
		\begin{parts}
			\part $f(x)=\dfrac{x^2-25}{x-5}$
			\part $g(x)=\dfrac{x}{x^2-25}$
			\part $h(x)=\dfrac{x+5}{x^2+25}$
		\end{parts}
	\end{multicols}
		\vspace{1in}
\paragraph{Check Point 1}

		\begin{multicols}{3}{
			\begin{parts}
				\part $f(x)=\dfrac{5x}{x-4}$
				\part $g(x)=\dfrac{x+7}{x^2-49}$
				\part $h(x)=\dfrac{x+7}{x^2+4}$
			\end{parts}
			}
		\end{multicols}
		
\end{document}


Last edited by coachbennett1981 on Fri Nov 19, 2010 9:25 pm, edited 1 time in total.

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

bev
Posts: 20
Joined: Wed Nov 10, 2010 10:02 am

multicols problem

Post by bev »

The problem is the way the \paragraph macro is implemented. It has zero vertical space (iirc), and so \muliticols is tricked. There are three solutions that I've found so far. The first is to put some text after the \paragraph arg:

Code: Select all

\paragraph{Check Point 1} Let's check some points!
the second is to forgo \paragraph altogether and do something like:

Code: Select all

{\parindent0pt \bfseries Check Point 1}
which looks exactly the same to me.

Lastly, make a macro that just takes up some vertical space, but it not visible:

Code: Select all

\newcommand{\blee}{\rule{1cm}{0pt}}
\paragraph{Check Point 1}\blee
Or, you could always fix the problem with the \paragraph macro, where ever it's defined in this case.
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Re: multicols problem

Post by coachbennett1981 »

Thank you for your help. I actually added some text and got your first result and it worked. I liked your macro idea.

Nick
Post Reply