[Tex/LaTex] How to remove blank page without modifying book, chapter, or other package specifications

blank-pagedocument-classes

I am creating a TeX document to be distributed to a class and it must use a style file, es150.sty, provided by the professor. For reasons too verbose to get into here, let's assume that es150.sty is a black box which I cannot have access into in order to change the various spacing settings. I've created a document with this style file and everything compiles just fine. However, all of the text, headers, etc., that I need appear only on pages 1 and 2 (as desired), but TeX is generating a totally extraneous, blank page 3 at the end of the document.

I have read many message board posts about tinkering with the book class, the chapter class, and using things like the \part environment in order to remove blank pages and spaces that appear between chapters, or at the end of these types of documents. However, my question is specifically how to remove a single extraneous blank page from a document that's not of any of these types.

What I can say about es150.sty: It defines an environment called "handout" and another called "exercise" for creating homework exercises on a handout to give to students. This style file derives from some others and has been used for dozens of courses. It's a cut-and-dry template file with nothing fancy in it and it's been used consistently without problems like this in the past.

So, to summarize: is there a sane, practical, short way (preferably just by issuing some kind of \ignorepage{} command or something) to chop off the extraneous whitespace at the end of my document without tinkering with the .sty file?

Best Answer

is there a … way … to chop off the extraneous whitespace at the end of my document without tinkering with the .sty file?

You can always just override the macros of the .sty file by redefining them in your actual document. This may not always be pretty but it’s absolutely possible. In the simplest case, if we assume that some command \foo is responsible for the blank page by issuing a command \clearpage, you can just copy that out of the .sty file and redefine it in your main document.

Given:

\newcommand\foo{…something…\clearpage…something else…}

Just put this into your document:

\renewcommand\foo{…somethign……something else…}

Of course, this needs to be adjusted for parameters etc. and it’s probably not as simple as removing a redundant \clearpage but the principle still applies.

Related Question