Page LayoutSeparate Text Parts for odd and even Pages

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
hilf
Posts: 3
Joined: Thu Jun 14, 2012 12:39 pm

Separate Text Parts for odd and even Pages

Post by hilf »

I have the task to have two separate texts, say "L.tex", "R.tex" to be combined in one book, with "L.tex" always on the left page, and "R.tex" always on a right page. Each is to have its own \newpage. Someone out there to know a solution?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Separate Text Parts for odd and even Pages

Post by Stefan Kottwitz »

Hi,

welcome to the board!

You could create a new document, which reads in the other documents and combines them, using the pdfpages package and its \includepdf command.

Stefan
LaTeX.org admin
hilf
Posts: 3
Joined: Thu Jun 14, 2012 12:39 pm

Separate Text Parts for odd and even Pages

Post by hilf »

dear Stefan, great to have your professional advice. Below is the realization. It works! Thanks
Of course, a dream remains to have the two .tex files as input, and teach latex to pick the stream of characters from the left.tex file for the left pages and from the right.tex file for the right side pages.

#test.tex

Code: Select all

\documentclass[12pt]{book}
\usepackage[final]{pdfpages}
\begin{document}
\includepdf[pages={1}]{test-right.pdf}
\includepdf[pages={2}]{test-left.pdf}
\includepdf[pages={3}]{test-right.pdf}
\includepdf[pages={4}]{test-left.pdf}
\includepdf[pages={5}]{test-right.pdf}
% and so forth
\end{document}
#test-left.tex

Code: Select all

...
\begin{document}
\newpage
this is page 1 left
\newpage
\newpage
this is page 2 left
\newpage
\newpage
this is page 3 left
..
#test-right.tex

Code: Select all

\begin{document}
this is page 1 right
\newpage
\newpage
this is page 2 right
\newpage
\newpage
this is page 3 right
\newpage
..
Last edited by Stefan Kottwitz on Sat Jun 16, 2012 12:59 pm, edited 1 time in total.
Post Reply