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:
![enter image description here](https://i.stack.imgur.com/goWGn.png)
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).
Although there was indeed a bug in my patch to the parcolumns
package in the thread about alternating columns, it turned out that the wrapfigure
problem here is an incompatibility between the parcolumns
and wrapfig
packages. You can see that from the following example
\documentclass{article}
\usepackage{parcolumns}
\usepackage{wrapfig}
\usepackage{lipsum}
\newcommand*{\dummypic}[1][dummy picture]{%
\setlength{\fboxsep}{0pt}%
\fbox{\begin{minipage}[t][2cm][c]{2cm}
\centering #1
\end{minipage}}%
}
\begin{document}
\begin{parcolumns}{2}
\colchunk[1]{%
\begin{wrapfigure}{l}{22mm}
\dummypic[\emph{left}]
\end{wrapfigure}\par
\lipsum[4]\par
\begin{wrapfigure}{r}{22mm}
\dummypic[\emph{right}]
\end{wrapfigure}\par
\lipsum[5]
}
\colchunk[2]{%
\begin{wrapfigure}{l}{22mm}
\dummypic[\emph{left}]
\end{wrapfigure}\par
\lipsum[7]\par
\begin{wrapfigure}{r}{22mm}
\dummypic[\emph{right}]
\end{wrapfigure}\par
\unskip\lipsum[8]
}
\end{parcolumns}
\end{document}
which compiles to:
![wrapfig problem](https://i.stack.imgur.com/Wqva2.png)
The reason is that parcolumns
inserts an \hfill
between the two columns. wrapfigure
, on the other hand, works by changing the width of the paragraph next to the figure. The \hfill
will always shift the narrowed paragraph to the page margin.
The problem can be fixed by restricting the columns to their natural width, for example using an \hbox to <column width> {...}
. I have implemented this into the small patch package parcolsx
provided in the answer to the question about alternating columns. I do not know if that is the most elegant way to solve the problem, but it works.
![enter image description here](https://i.stack.imgur.com/45olW.png)
I will for now not re-post the code here. If that is desired I (or someone else) can do it later.
Best Answer
The important issues to handle for such a project would be the handling of floats. Normally photo books or similar documents do not have a large amount of words and if you use floats and marginpars, the text will certainly end up in the wrong place.
I would first choose a few page designs and then use
minipages
or better TeXvbox
andhbox
primitives to position them and work macros around them. Martin'sadjustbox
package might also come handy here, i.e., you need to build the two columns, rather than use themarginpar
area or a two-column layout.The layout above was achieved using such a macro:
I haven't used your dimensions for the page geometry but you can vary the sizes in the minimal that follows. Add fonts and style to suit your requirements.
See also Template for a book for children