Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The following code produces:

enter image description here

\documentclass[11pt,twoside,openany]{book}

\usepackage{amsmath,amssymb}
\usepackage{lipsum}
\usepackage{multicol}

%-------------------------------------------------------------------------------
\usepackage[centering,marginparwidth=2in]{geometry}
\evensidemargin 1.5in
\oddsidemargin 1.5in
\setlength{\textwidth}{5.5in}
%-------------------------------------------------------------------------------

\newenvironment{exotmp}{%
\begingroup
  \begin{list}{}{%
  \setlength{\leftmargin}{-1.5in}%
  \setlength{\rightmargin}{0pt}%
  \setlength{\parfillskip}{0pt plus 2fil}
  }% 
  \item%
}
{\end{list}%
\endgroup}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\chapter{Introduction to Problem Solving}
\lipsum[2]
\section{The Problem-Solving Process and Strategies}
\lipsum[4-7]
\section{Three Additional Strategies}
\lipsum[5-12]
\begin{exotmp}
\setlength{\columnsep}{0.5cm}
\begin{multicols}{2}
\lipsum[2-9]
\end{multicols}
\begin{enumerate}
\item
\item
\item \lipsum[2-3]
\end{enumerate}
\end{exotmp}
\end{document}

Evidently there is something wrong as an extra page is produced. Can any one explain why this is happening and how to re-write the command so that it stops behaving in that manner?

share|improve this question
    
does this help: environment-makes-unnecessary-page-break –  cmhughes Oct 26 '12 at 19:08
    
@cmhughes Nope. Thanks for the input. –  azetina Oct 26 '12 at 19:11

2 Answers 2

up vote 4 down vote accepted

Multicol has to make a guess as to whether it should start a new page or if ther eis room on the current page. Just after \item makes that tricky as there is a lot of pending activity at that point. removing the spurious group, adding some ingorespaces and putting in an emty box to terminate the item makes things more stable.

\newenvironment{exotmp}{%
  \begin{list}{}{%
  \setlength{\leftmargin}{-1.5in}%
  \setlength{\rightmargin}{0pt}%
  \setlength{\parfillskip}{0pt plus 2fil}
  }% 
  \item\mbox{}\ignorespaces
}
{\end{list}\ignorespacesafterend}
share|improve this answer
    
Can the space created above the environment (at the beginning) be avoided. As it is, it creates an extra space right? –  azetina Oct 26 '12 at 19:42
    
yes you could \vspace*{-\baselineskip} after the item it depends a bit what the intention of the code is –  David Carlisle Oct 26 '12 at 19:50
    
As is, the geometry of the page is defined and I created this environment to leave this geometry and work temporarily on it. –  azetina Oct 26 '12 at 19:58
    
I was thinking of defining the same environment with geometry like: \newenvironment{exotmp}{% \newgeometry{bottom=1.5in} \mbox{}\ignorespaces } {\restoregeometry\ignorespacesafterend} but I can't find how to create the same effect (margin definitions) as what the given environment in my question. –  azetina Oct 26 '12 at 20:17

You can remove the group from your definition:

\documentclass{book}
\usepackage{amsmath,amssymb}
\usepackage{lipsum}
\usepackage{multicol}

%-------------------------------------------------------------------------------
\usepackage[centering,marginparwidth=2in]{geometry}
\evensidemargin 1.5in
\oddsidemargin 1.5in
\setlength{\textwidth}{5.5in}
%-------------------------------------------------------------------------------

\newenvironment{exotmp}{%
  \begin{list}{}{%
  \setlength{\leftmargin}{-1.5in}%
  \setlength{\rightmargin}{0pt}%
  \setlength{\parfillskip}{0pt plus 2fil}
  }% 
  \item%
}
{\end{list}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\chapter{Introduction to Problem Solving}
\lipsum[2]
\section{The Problem-Solving Process and Strategies}
\lipsum[4-7]
\section{Three Additional Strategies}
\lipsum[5-12]
\setlength{\columnsep}{0.5cm}
\begin{exotmp}
\begin{multicols}{2}
\lipsum[2-9]
\end{multicols}
\begin{enumerate}
\item
\item
\item \lipsum[2-3]
\end{enumerate}
\end{exotmp}
\end{document}
share|improve this answer
    
I get the same results. –  azetina Oct 26 '12 at 19:19
    
@azetina With my example code? –  Gonzalo Medina Oct 26 '12 at 19:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.