0

I would like to create a document/book/memoir (haven't chosen a class yet) that has completely different content on all the left-hand side pages and different content on all the right-hand side pages.

Ultimately, what I am trying to achieve is to have the actual text on the left-hand side pages and then commentary about the text on the right-hand side pages.

I can also see a similar use if creating a book with dual languages with each language on their own side of the book.

How can I go about setting this up?

PS. I wasn't sure of a proper tag to use for my question.

kojow7
  • 325
  • 2
    Take a look at the eledpar or pdfcolparallel packages. (Disclaimer: No personal experience with either.) Some helpful discussion and examples to be found here: https://tex.stackexchange.com/questions/86366/syncing-text-on-bilingual-pages – Ingmar Nov 21 '20 at 06:34
  • Thank you. I will take a look into both of those. Also, when looking up eledpar I noticed that the reledpar package is now a replacement for it. – kojow7 Nov 21 '20 at 06:45
  • 1
    The best solution could be very different ( afterpage, flowfram, pdfpages, etc.) depending on what you want to do exactly. You should clarify what with a minimal example all the possible constraints and requirements, e.g., if the comments are interspersed in the source text or in another files, if the right and/or left parts should be in parallel in each at paragraphs, or they can/must have independent text flow within the pages or even between several pages, if the right and/or right parts can have floats, or they are only plain text, etc. – Fran Nov 21 '20 at 10:24
  • Someone should also mention paracol, which also supports two page layouts (page 12). – John Kormylo Nov 21 '20 at 15:10
  • @Fran Perhaps it is a bit hard to answer as I do not 100% know what I am after either. However, for the most part I do want to make sure that the commentary on the right matches the text on the left. With that, there might be only a small portion of text to a lot of commentary or a large portion of text to a small bit of commentary. Based on those constraints there may not be a perfect answer. For the most part I am wanting the commentary and the text to line up. I am more okay with having more empty space in the text side than the commentary side. – kojow7 Nov 21 '20 at 20:15
  • @JohnKormylo What exactly do you mean by "page 12"? – kojow7 Nov 21 '20 at 20:16
  • Page 12 of the paracol manual. The two page option is about the last thing the manual covers. – John Kormylo Nov 22 '20 at 02:57

1 Answers1

2

The example below uses a custom macro, that I called \xxxx in a display of imagination (I left as exercise find a better name), using afterpage.

Usage:

\xxxx{text in left page}{comment in right page}

The comments are conditionally colored to check easily when the comment are shorter that the original text and thus they should not stretch the commented text (always a good idea).

Note that when there are not enough space for the text and/or the comment you should add \newpage twice.

Example:

mwe

\documentclass{article}
\usepackage{geometry}
\usepackage{lipsum,xcolor}
\usepackage{afterpage}
\parindent0pt\parskip 2em   
\newsavebox\mytext
\newsavebox\mycomment
\newcommand\xxxx[2]{
\savebox\mytext{\parbox[t]{\linewidth}{#1}}
\savebox\mycomment{\parbox[t]{\linewidth}{#2}}
\ifdim\dp\mytext>\dp\mycomment
\noindent\begin{minipage}[t][\dp\mytext][t]{\linewidth}#1\end{minipage}
\afterpage{% shorter comment in blue
\savebox\mytext{\parbox[t]{\linewidth}{#1}}
\noindent\begin{minipage}[t][\dp\mytext][t]{\linewidth}
\color{blue!50!black}#2\end{minipage}}
\else
\noindent\begin{minipage}[t][\dp\mycomment][t]{\linewidth}#1\end{minipage}
\afterpage{% longer comment in red
\savebox\mycomment{\parbox[t]{\linewidth}{#2}}
\noindent\begin{minipage}[t][\dp\mycomment][t]{\linewidth}
\color{red!50!black}#2\end{minipage}}
\fi}

\begin{document} ~\newpage % first odd page \xxxx{\lipsum[1][1-10]}{Brief comments in blue} \xxxx{\lipsum[2][1-4]}{Boring comments in red. \lipsum[3]} \xxxx{\lipsum[4][1-6]}{Another boring comment \lipsum[5][1-12]} \xxxx{\lipsum[6]}{There are a hidden cat here.}

\newpage % Blank page for comments \newpage

\xxxx{\lipsum[7]}{\lipsum[8]} \xxxx{\lipsum[9]}{\lipsum[10]} \xxxx{\lipsum[11]}{\lipsum[12]} \xxxx{\lipsum[13]}{\lipsum[14]} \xxxx{\lipsum[15]}{\lipsum[16]}

\newpage % Blank page for comments \newpage

\xxxx{\lipsum[17]}{\lipsum[18]} \xxxx{\lipsum[19]}{xxxx\lipsum[20]} \xxxx{\lipsum[21]}{xxxx\lipsum[22]} \xxxx{\lipsum[23]}{xxxx\lipsum[24]} \xxxx{\lipsum[25]}{xxxx\lipsum[26]}

\end{document}

But without reinvent the wheel, as commented John Kormylo, paracol is another (better) option:

\documentclass{article}
\usepackage{geometry,parskip}
\usepackage{lipsum}
\usepackage{paracol}
\begin{document}
~ \newpage
\begin{paracol}[1]{2}
\begin{leftcolumn} \lipsum[1][1-2] \end{leftcolumn}
\begin{rightcolumn} \lipsum[2] \end{rightcolumn}
\end{paracol}
\begin{paracol}[1]{2}
\begin{leftcolumn} \lipsum[3] \end{leftcolumn}
\begin{rightcolumn} \lipsum[4] \end{rightcolumn}
\end{paracol}
\begin{paracol}[1]{2}
\begin{leftcolumn} \lipsum[5] \end{leftcolumn}
\begin{rightcolumn} \lipsum[6] \end{rightcolumn}
\end{paracol}
\end{document}
Fran
  • 80,769
  • You mention that paracol is a better option. Is there anything about your method that would be preferred to paracol's method? – kojow7 Nov 23 '20 at 15:03
  • Hmm, paracol seems to also repeat the page number twice. – kojow7 Nov 23 '20 at 15:33
  • @kojow The paracol environment can start and end at any vertical position in a page, is ready to use also in a single page with two columns, take care automatically of the page breaks, can be enclosed in list, tale into accpunt floats, counters, etc., as you can see in the manual of 64 pages, whereas the macro could produce unexpected results in many not tested situations. Repeat the page number is a feature, not bug. Use \begin{paracol}[1]*{2} at least in the last case in the example and you will see pages 1,2,3 instead of 1,2,2. – Fran Nov 23 '20 at 21:17