Any ideas how I could re-use the book's text that I have written (it's in
chapter2.tex, etc.) in various document formats (a4, letter, mobile device format, etc). The problem I am facing is that I have placed various
\newpages in the chapters so they looked ok for
a4 format. But now when I tried to compile the book for
\newpages are in the wrong places, so I have to have a different copy of text with
\newpages in the right places. What's the general strategy for re-using the text for various formats?
The reason why I am using
\newpage throughout my book is that
\sections sometimes appear at the bottom of the page, and I want to force them into the new page, so I use
\newpage just before that
\section that was at the bottom of current page.
Here is a screenshot example:
4.12 is at very bottom and the code example is cut in half? That's why I insert these
\newpages to force it on a new page so it looked ok!
I am using
memoir document class and the code boxes are done via