3

I'm writing a class for our firm's reports. I'd like to provide an environment overview that puts a chapter heading "Overview" and then keeps the text in the environment on the one page (as best as it can).

Right now, my class essentially mimics:

\documentclass[a4paper,11pt,titlepage,headings=big,
chapterprefix=true,headsepline,parskip=half]{scrreprt}

 \usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,
   spacing=true,]{microtype}


\usepackage[all]{nowidow}
%\RequirePackage{multicol}
\usepackage{multicol}
\newenvironment{overview}%
  {\onecolumn\begin{minipage}{\textwidth}\chapter*{Overview}\begin{multicols}{2}}%
  {\end{multicols}\end{minipage}\twocolumn}

\usepackage{lipsum}

\begin{document}
\begin{overview}
\lipsum[1-5]
\end{overview}
\end{document}

But this is not what I want. The parskips are incorrect. It's fairly simple to get the look in a particular case

\begin{document}

\chapter*{Overview}
\lipsum[1-5]

\end{document}

Though I'd like to delegate some of the machinery to keep the contents of the Overview on one page to LaTeX.

I've also tried mimicking the samepage environment, though I understand that this only keeps paragraphs on the same page, which isn't sufficient.

I'm aware that no solution can solve too much text in the overview, but sometimes TeX decides to put two lines on the following page. Is there a way I can encourage TeX to not do this and instead (a) reduce the spacing between paragraphs slightly or (b) reduce the bottom margin?

Hugh
  • 2,374
  • 17
  • 30
  • What is wrong with the parskips? There are different ways to do this. But we have to know what you want to give up. Should TeX reduce the space between paragraphs? Should it reduce the bottom margin so this page is longer than other pages? Should it reduce the space left before the first paragraph? Note that loading microtype will generally make TeX more space-efficient without giving anything up. (Indeed, it will enhance the output.) – cfr Feb 27 '15 at 04:10
  • The parskips are absent. Ideally, it should reduce the space between paragraphs (but still keep a visible gap) then if that's still no good reduce the bottom margin. Thanks for the microtype hint. – Hugh Feb 27 '15 at 04:12
  • It's your minipage environment, I think. If parskip=half means half your baselineskip, then add a \parskip 6.8pt to your environment. For the other problem, look at the needspace package. – jon Feb 27 '15 at 04:38
  • if it is just 2 or 3 lines you can try \enlargethispage{2\baselineskip} or \enlargethispage{3\baselineskip} – touhami Feb 27 '15 at 07:05

1 Answers1

3

enter image description here

The official line is you should always use latex commands like minipage not underlying TeX primitives like \vbox, but sometimes...

\documentclass[a4paper,11pt,titlepage,headings=big,
chapterprefix=true,headsepline,parskip=half]{scrreprt}

 \usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,
   spacing=true,]{microtype}


\usepackage[all]{nowidow}

\usepackage{multicol}
\newenvironment{overview}%
  {\onecolumn\vtop to 0pt\bgroup\chapter*{Overview}\begin{multicols}{2}}%
  {\end{multicols}\vss\egroup\hfill\twocolumn}

\usepackage{lipsum}

\begin{document}
\begin{overview}
\lipsum[1-5]
\end{overview}
\end{document}
David Carlisle
  • 757,742