I'm going to be writing my dissertation in LaTeX quite soon.
Whenever I've done work in the past in LaTeX, I've always just used \documentclass[twocolumn]{article}
but I've heard about multicol
. What are the main advantages to the latter?
multicoltwo-column
I'm going to be writing my dissertation in LaTeX quite soon.
Whenever I've done work in the past in LaTeX, I've always just used \documentclass[twocolumn]{article}
but I've heard about multicol
. What are the main advantages to the latter?
Use \setlength{\columnsep}{<width>}
in the preamble of your document, i.e. before \begin{document}.
Changing \columnsep
also works if you use the multicol
package.
EDIT (July 25, 2012)
There is a small bug concerning the column separating space in the version below. I fixed that and wrapped up the whole parcolumns
patch in a tiny package named parcolsx
, so that you can do something like:
\documentclass{book}
\usepackage{geometry}
\usepackage{parcolumns}
\usepackage{parcolsx}
\usepackage{lipsum}
\begin{document}
\chapter{Chapter heading}
\begin{parcolumns}[%
sloppy = true,
sloppyspaces = true,
nofirstindent = true,
colwidths = {1=0.43\textwidth, 2=0.53\textwidth}
]{2}
\colchunk[1]{\small\indent%
\lipsum[14]
\lipsum[15]
\lipsum[16]
\lipsum[17]
}
\colchunk[2]{\Large\indent%
\lipsum[10]
\lipsum[11]
\lipsum[12]
\lipsum[13]
}
\end{parcolumns}
\end{document}
Note the additional key/value pair alternate = true
in the arguments of the parcolumns
environment. This way the alternating columns can be activated at will.
The package parcolsx
to be saved in a file named parcolsx.sty
:
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{parcolsx}
\RequirePackage{changepage}
\strictpagecheck
% add the additional boolean key `alternate'
% to the `parcolumns' environment
\newif\ifpc@alternate
\define@key{parcolumns}{alternate}[true]{%
\pc@boolkey{pc@alternate}{#1}%
}
% slightly modify the `\pc@placeboxes' macro to distinguish between odd
% and even pages, if the option `alternate=true' was passed to the
% `parcolumns' environment
\def\pc@placeboxes{%
\global\let\@tempa\relax%
\hb@xt@\linewidth{%
\vfuzz30ex %
\vbadness\@M%
\splittopskip\z@skip%
% odd is the default
\ifpc@alternate \checkoddpage \else \oddpagetrue \fi%
\ifoddpage
% count up from 1 to N_col
\count@\z@%
\loop\ifnum\count@<\pc@columncount%
\advance\count@\@ne%
\pcx@placeboxes@body%
\ifnum\count@<\pc@columncount%
\strut\hfill\ifpc@rulebetween\vrule\hfill\fi%
\fi%
\repeat%
\else
% count down from N_col to 1
\count@\pc@columncount%
\loop\ifnum\count@>\z@%
\pcx@placeboxes@body%
\advance\count@\m@ne%
\ifnum\count@>\z@%
\strut\hfill\ifpc@rulebetween\vrule\hfill\fi%
\fi%
\repeat%
\fi
}%
\@tempa%
}
% the fraction of `\pc@placeboxes' that does not depend on the page
% parity
\def\pcx@placeboxes@body{%
\expandafter\ifvoid\csname pc@column@\number\count@\endcsname%
\hskip\csname pc@column@width@\number\count@\endcsname%
\else%
\expandafter\setbox\expandafter\@tempboxa%
\expandafter\vsplit\csname pc@column@\number\count@\endcsname%
to \dp\strutbox%
\expandafter\@tempdimb\csname pc@column@width@\number\count@\endcsname%
\hbox to \@tempdimb {\vbox{\unvbox\@tempboxa}\hfill}%
\fi%
\expandafter\ifvoid\csname pc@column@\number\count@\endcsname%
\else%
\global\let\@tempa\pc@placeboxes%
\fi%
}
On a side note: that patch also fixes the incompatibility of the parcolumns
with the wrapfigure
package. I will comment on this in the other thread: Wrapfigure-Minipage Woes
Original answer (including column separator bug)
You ask for many different things and your sample document contains a lot of stuff that might not be helpful here. However, I might have found a solution for your column switching problem.
Please see this more minimalistic example:
\documentclass{book}
\usepackage{geometry}
\usepackage{parcolumns}
\usepackage{changepage}
\strictpagecheck
\usepackage{lipsum}
\makeatletter
\def\pc@placeboxes{%
\global\let\@tempa\relax%
\hb@xt@\linewidth{%
\vfuzz30ex %
\vbadness\@M%
\splittopskip\z@skip%
\checkoddpage\ifoddpage
\count@\z@%
\loop\ifnum\count@<\pc@columncount%
\advance\count@\@ne%
\my@placeboxes@body%
\repeat%
\else
\count@\pc@columncount%
\loop\ifnum\count@>\z@%
\my@placeboxes@body%
\advance\count@\m@ne%
\repeat%
\fi
}%
\@tempa%
}
\def\my@placeboxes@body{%
\expandafter\ifvoid\csname pc@column@\number\count@\endcsname%
\hskip\csname pc@column@width@\number\count@\endcsname%
\else%
\expandafter\setbox\expandafter\@tempboxa%
\expandafter\vsplit\csname pc@column@\number\count@\endcsname%
to \dp\strutbox%
\vbox{\unvbox\@tempboxa}%
\fi%
\expandafter\ifvoid\csname pc@column@\number\count@\endcsname%
\else%
\global\let\@tempa\pc@placeboxes%
\fi%
\ifnum\count@>\z@%
\strut%
\hfill%
\ifpc@rulebetween%
\vrule%
\hfill%
\fi%
\fi%
}
\makeatother
\begin{document}
\chapter{Chapter heading}
\begin{parcolumns}[%
sloppy = true,
sloppyspaces = true,
nofirstindent = true,
colwidths = {1=0.43\textwidth, 2=0.53\textwidth}
]{2}
\colchunk[1]{\small\indent%
\lipsum[14]
\lipsum[15]
\lipsum[16]
\lipsum[17]
}
\colchunk[2]{\Large\indent%
\lipsum[10]
\lipsum[11]
\lipsum[12]
\lipsum[13]
}
\end{parcolumns}
\end{document}
I slightly modified the macro \pc@placeboxes
from the parcolumns package, so that it distinguishes between odd and even pages. The actual check is done using macros from the changepage
package, which is why it is loaded in the preamble. You will have to compile at least twice, since this relies on page lables.
The resulting output is, I think, what you desire, i.e. the columns interchange at every page break:
I have not bothered about the margin notes and you might experience side effects. If that is the case you should better open a new question and tackle one problem at a time.
EDIT (July 22, 2012)
The parcolumns package works in two steps: first, the contents of each
column is typeset in a box. This is done by the \colchunk
command.
Second, for every line on the output page one line from each column box
is extracted and placed on the page. That is done by the
\pc@placeboxes
macro.
So, assuming N
columns, the original \pc@placeboxes
in principle
does the following: For colums i=1
up to i=N
the first line of the
i
-th column box is cut and pasted on the page. If i<N
a column
separating space is inserted.
I simply hooked into this macro and inverted the order on every second
page: the modified \pc@placeboxes
does exactly the same as the
original one for odd pages. However, for even pages it loops from i=N
down to i=1
when cutting and pasting the lines from the column boxes.
The problem with the wrapfig
stuff very likely stems from this
two-step approach. Having not looked into the wrapfig
package I can
just guess that it uses \parshape
to modify the shape of the typeset
paragraph. This will influence what is typeset into the column boxes.
Apparently, things go wrong when the lines of the column boxes are
distributed on the page. I can not, unfortunately, offer a solution for
this issue at the moment (actually I hoped that some of the TeX gurus
here would have a suggestion for you).
Best Answer
The
multicol
package has not been developed as a replacement for thetwocolumn
option of standard classes. It has been developed for more specialized scenarios and therefore shows some restrictions in general purpose documents.Purpose of the
multicol
package isTypical use cases are medium length lists, e.g., index, glossaries, short articles with varying number of columns, balanced boxed text in two or more columns, etc.
Because of the requirement to auto-balance material and the use of columns with different width there are some restrictions with respect to floats: it is only possible to use full-width floats as the notion of a general column width doesn't exist and the balancing would make float placements very complicated. For the same reason, only page-wide footnotes are supported.
The license of this package is LPPL, i.e., it can be generally used for any purpose, despite the statement in one of the comments above. It is true, that multicol has an additional "moral obligation" clause, but it is clearly stated that this is a request not a legal requirement that is part of the license. This is a somewhat historical accident and anybody interested is invited to read the article on LPPL which gives some background.
From a practical point of view I don't think that it is advisable to use multicol for something like a dissertation unless balancing of columns is important (say at end of sections) and column-wide floats are not really necessary (as they would need to be placed by hand). But for part of a document it may make sense.