[Tex/LaTex] How to do multiple calls to \includeonly


Doing multiple call to include only as:


It is only including the last file called mysecondinclude by the last \includeonly call. It is useful to do multiple calls to \includeonly when you have all your \includeonly call listed and commented out.


% How does 'filecontents' keep LaTeX parsing while temporarily stop writing output
% https://tex.stackexchange.com/questions/104159/how-does-filecontents-keep-latex




% \includeonly{myfirstinclude}
% \includeonly{mysecondinclude}
% \includeonly{mythirdinclude}




So when you want to include only one or some files, you just uncomment the desired line(s).

% \includeonly{mythirdinclude}

Related Questions

  1. What happens to a relative path in a file added with \input{}?
  2. A variant of \includeonly
  3. How to make the main file recognize relative paths used in the imported files?
  4. subimport and includeonly
  5. Using standalone to combine multiple .tex into a single file
  6. Can a file know if it has been \include'ed or \input'ed?
  7. Generate a merged LaTeX file, with \input code in place?
  8. How to merge several tex files so that they have one table of contents/List of tables & figures
  9. When should I use \input vs. \include?
  10. Options for building multiple documents from the same content with different layouts
  11. What state changes are caused by \input?

Best Answer

For your specific use case you could use just one includeonly by putting each chapter on its own line:


This way it is easy to comment out any of them, say, the second one:

Related Question