When I'm debugging a big multifile project, it's often useful to make extensive use of \includeonly to narrow down where the problem is. but today I found myself using: \includeonly{chap1,chap2,chap4,chap5}. Surely \exclude{chap3} would be a simpler way to achieve this functionality? But that particular command doesn't seem to exist. Is there a command with this functionality?
- 73,242
2 Answers
The excludeonly package defines an \excludeonly command that does what you want. Package description:
The package defines an
\excludeonlycommand, which is (in effect) the opposite of\includeonly. If both\includeonlyand\excludeonlyexist in a document, only files "allowed" by both will be included.The package redefines the internal
\@includecommand, so it conflicts with packages that do the same. Examples are the classespaper.cls(paper) andthesis.cls(thesis).
- 250,273
Just comment out \include{chap3}. The way I understand it, the purpose of \includeonly is when you'd like to include just one or two things, it's simpler to use \includeonly than to comment out a bunch of lines. But if you're keeping everything and just including one thing, why use a special command just to exclude something?
-
11That's a bad idea, Aaron, the
\include{chap3}is needed! Otherwise LaTeX doesn't includechap3.aux, and you get lots of undefined references. That's what\includeonlyis all about: to get the correct references. – Hendrik Vogt Mar 17 '11 at 09:50
\includeonlyis... – Seamus Sep 07 '10 at 14:10\@addtoresetis part of the LaTeX kernel,\@removefromresetneeds (e.g.) the remreset package. – lockstep Sep 07 '10 at 14:17