Is there a way to automate the mirroring of parboxes every time a new page occurs?

I have a \documentclass{book} that consists of two side-by-side \parbox. I would like one of the \parbox to always remain the "outer" and the other to always remain the "inner". The pages should essentially mirror each other.

In this example, I would like the skinny column to always be the inner column: enter image description here







  • 2
    Does your document only contain these \parboxes? Do you always insert these the same way? Is there any flow from one page to the next? – Werner Mar 7 '17 at 4:06
  • You can also do this using paracol. See tex.stackexchange.com/questions/320065/… for example. – John Kormylo Mar 7 '17 at 4:31
  • @Werner, yes, let's assume that the document contains only the \parboxes, the content within them will be of different lengths, and there is flow from one page to the next. – AML Mar 7 '17 at 10:46
  • @John, do you think paracol is a better solution here? Would you please propose an example solution? – AML Mar 7 '17 at 11:12
  • @JohnKormylo I figured out what you meant: \twosided[pc]% swap margins and columns under \usepackage{paracol}. Does anyone know how to achieve the same thing but with \parbox? – AML Mar 7 '17 at 13:18

The \parbox macros are optional. Their only effect here is to force a \newpage if there is not enough space for the whole thing. Alignment is handled by \switchcolumn*. (Without the \parbox you should use \sloppy.)


\twosided[pc]% swap margins and columns



Here is a solution using the ifoddpage package. It takes two runs, since \checkoddpage stores the page number in the aux file. The \makebox is used to force the page change before testing.


\newcommand{\swapboxes}[2]% #1 = wide text, #2 = narrow text





Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.