I have two side document(so I use twoside option) in latex. I need to keep some material(text, pictures...) on one double page. In another words I want to allow page break from odd to even page but I want to prohibit breaks from even to odd page.
I tried to write macro:
\newcommand{\nl}{
\\ \ifodd\c@page
\relax
\else
\nopagebreak
\fi}
and use it instead of \ (I don't use any other line breaks commands in my document) but it does not work. Thanks for all answers.
EDIT: Thanks but Steves environment does not quite work for me. I tried to put my material into it but it does not cause it to fit on 2 pages, instead it says "Overflow in twopage environment".
I will try to formulate exactly what I need to do:
- Preferable an environment or a macro.
- If the current page is even it must prevent latex from breaking the page(it may break if it is absolutely impossible to keep the material on even page, but I need it to try hard). This may by done by setting penalty to 20000 or by anything else - please suggest as dirty tricks as you can make up.
- If the current page is odd then the page break is allowed but not necessary.
- The code that will make use of this environment or macro will be generated by java program so there is no point in generating errors if the material just can't fit into page or double page. Java have no way to know about latex error.
Thanks for all ideas