GeneralUse of \includeonly for multiple input

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
AstridH
Posts: 6
Joined: Mon Dec 02, 2013 2:03 pm

Use of \includeonly for multiple input

Post by AstridH »

Hi there,
I have a rather trivial problem. I would like to only compile two of my thesis chapters and I'm using \includeonly. It works fine for only one chapter, but when I'm adding the second chapter to the command line it simply gets ignored and not included. I guess I'm missing something...a space, comma, something random...

This is my command line:

Code: Select all

\includeonly{2_current_flow/current_flow,Appendix/Appendix}
Any suggestions would be highly appreciated!!

Many thanks,
Astrid

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

tom
Posts: 73
Joined: Thu Apr 18, 2013 4:02 am

Use of \includeonly for multiple input

Post by tom »

Hi Astrid,

Command looks fine to me, just two things:
  • Don't forget to add \include in the document body
  • Be careful with underscores in filenames. You might have to specify an encoding.
The following code works for me, assuming the folder "subfolder" exists.

Code: Select all

\documentclass{report}
\usepackage{blindtext}

\begin{filecontents}{subfolder/chapter_1}\chapter{First}\blindtext\end{filecontents}

\begin{filecontents}{subfolder/chapter_2}\chapter{Second}\blindtext\end{filecontents}

\includeonly{subfolder/chapter_1,subfolder/chapter_2}

\begin{document}
\tableofcontents
\include{subfolder/chapter_1}
\include{subfolder/chapter_2}
\include{subfolder/chapter_3}
\include{subfolder/chapter_4}
\end{document}
AstridH
Posts: 6
Joined: Mon Dec 02, 2013 2:03 pm

Re: Use of \includeonly for multiple input

Post by AstridH »

Hi Tom,

thanks for the tip - I double checked my list of \include{chapter} and noted that I had commented the \include{Appendix/Appendix}, hence it didn't appear. Really silly mistake and I doubt I would have seen it without you pointing into the right direction! So, thank you very much for the hint ;)!

Cheers,
Astrid
Post Reply