1

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 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?

Community
  • 1
  • 1
vo1stv
  • 55
  • 2
  • 17
  • 1. I would hardly call it a 'bug' as all the documentation says that \includeonly works by going \clearpage \input \clearpage. Clearly this is how the package is supposed to work. 2. It's VERY HARD to troubleshoot a latex question without some sort of example code to illustrate the problem. – Mica Nov 09 '09 at 17:34
  • No.. certainly it's not a bug in LaTeX... it's introduced by the newclude package. What I need is something like (in pseudoTeX): IfIncluded{technicalsection.tex}{ \input{technicalsection.tex} } – vo1stv Nov 10 '09 at 18:32
  • I've changed bug to *quirk* as suggested. – vo1stv Nov 12 '09 at 13:09

2 Answers2

1

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}.

vo1stv
  • 55
  • 2
  • 17
0

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

  • \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. – vo1stv Nov 10 '09 at 18:29