tags:

views:

131

answers:

2

In LaTeX, the \includeonly statement exists to selectively add or exclude sub-documents.

One quirk in the whole process is that when sections are excluded, LaTeX decides to insert a page-break. The article at http://stackoverflow.com/questions/1209065/to-have-no-pagebreak-after-include-in-latex recommends using newclude to avoid this issue. This package defines \include* which provides a work-around by omitting the implied \clearpage.

I am occasionally seeing the behaviour where if I comment out lines of my \includeonly statement the sub-document still gets included. Has anyone else seen this behaviour?

A: 

It's not a bug, it's a feature. Really. Does \input do what you need, rather than \include?

Yuri gagarian
\input would work fine, except that \input generates an error if the file doesn't exist (as in I haven't written it yet). Also, after I've written a complete document, it's sometimes nice to remove the technical sections if asked to produce a management-level version. \includeonly should do exactly that, but NOT if I \usepackage{newclude}.Getting rid of the \clearpage is a nice feature, but not if it breaks \includeonly.
SmileAndNod
A: 

For whatever reason, everything is now working as it should.

Just in case the order of the \usepackage directives is important, in the working version \usepackage{newclude} is the first command after \documentclass{article}.

SmileAndNod