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.

I have a two column latex document and at the beginning of each chapter, I want to manually insert a minipage which spans the two columns. Unfortunately, the text in the right column will always overlay with the minipage. How can I prevent that from happening?

\documentclass[twocolumn]{memoir}
\usepackage{lipsum} 

\begin{document}

\chapter{test}

% minipage spanning entire width.
% how do I prevent the text below from overlaying into the minipage?
\begin{minipage}[t]{\textwidth}
STARTMINIPAGE \lipsum[1] ENDMINIPAGE
\end{minipage}

% text across two columns. the right column wraps into the minipage.
\lipsum[1-20]

\end{document}
share|improve this question

3 Answers 3

up vote 2 down vote accepted

Put this in your preamble:

\makeatletter
\let\memoir@makechapterhead\@makechapterhead
\def\@makechapterhead#1{\memoir@makechapterhead{#1}\dochapterprolog}
\makeatother

\def\chapterprolog#1{\gdef\dochapterprolog{%
  \if\relax\detokenize{#1}\relax\else
    \noindent\begin{minipage}{\textwidth}#1\end{minipage}\vspace{3\baselineskip}
  \fi\chapterprolog{}}}

You'll start a chapter by

\chapterprolog{What we want in the full width minipage}
\chapter{Chapter title}

The contents of the chapter prolog is reset to empty after usage, so if a chapter has no prolog nothing particular has to be done.

Adjust the 3\baselineskip to what suits you.

(Note: this new version will work also in one column mode)

share|improve this answer
    
Can this be done without memoir? –  isomorphismes Jun 3 at 9:18
    
@isomorphismes Yes, of course; I used memoir as a prefix just because the post was about this class. It should work also with report and book. –  egreg Jun 3 at 9:43

You want to switch between onecolumn and twocolumn modes without ejecting the page. I'd suggest using multicol package written specifically for this.

share|improve this answer
    
I don't want to keep switching back and forth. All of the text is two columns, I really only want one minipage at the beginning of each chapter which spans both columns. –  memyself Nov 1 '11 at 13:24

The \multicol package has a second optional parameter for text that you want to span over all the columns before the multi columns begin.

Note that there seems to be some problem with using \lipsum here, but adding real text it seems to work.

\documentclass{memoir}
\usepackage{lipsum} 
\usepackage{multicol} 

\begin{document}
\begin{multicols}{2}[%
    \chapter{test}
    \hrule
    Place your single column text here. 
    It will go across the page and the two column 
    text will begin after this.
    \hrule
]

% text across two columns.
\lipsum[1-20]

\end{multicols}
\end{document}
share|improve this answer

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.
http://tex.stackexchange.com/questions/33307/how-to-prevent-two-column-text-to-overlay-with-minipage-of-entire-pagewidth
tex.stackexchange.com
crawl=CC-MAIN-2014-49
78768
application/http; msgtype=response
sha1:7N5VLHUIMSJSTOJXDUIRR6ASFTQ7VWAW
<urn:uuid:a4a4d51e-1eb9-4584-8c7a-e2d0562bee3c>
2014-11-26T11:34:59Z
198.252.206.16
sha1:O52IPYQBDHTBXQCWMO2VIV5KLTBKL4AY
<urn:uuid:d05b64be-bbf2-4037-8c09-904fcf25c0c2>
http://tex.stackexchange.com/questions/33307/how-to-prevent-two-column-text-to-overlay-with-minipage-of-entire-pagewidth
response
<urn:uuid:3ae98650-a37c-4aca-b4c9-1a0b3ae446f6>
robots: classic
hostname: ip-10-235-23-156.ec2.internal
software: Nutch 1.6 (CC)/CC WarcExport 1.0
isPartOf: CC-MAIN-2014-49
operator: CommonCrawl Admin
description: Wide crawl of the web with URLs provided by Blekko for November 2014
publisher: CommonCrawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf