pelegs / maths_book

Planning for an entire maths LaTeX book

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`\input` vs. `\include`

Cube707 opened this issue · comments

Hello, I found your project through reddit and its a super cool idea. Here is something I thought about while browsing your code that may be an interesting topic:

LaTex offers a more advanced option when including subfiles. The command is fittingly named \include. It has the benifit of allowing you to define a list of subfiles you are currently working on and LaTex will skip all other files, bringing compile time down while working on some part of the document and not needing to see the rest. The comand for that is \includeonly{file1,file2,ect..}. If you omit it, everything will be included.
The cherry on top is, that it keeps the temporary files from the previos (full) run and that way can keep the correct numberings and references, even when half your document is missing.

This comes with some drawbacks however:

  • include always starts a new page. So you usually can only use it for full chapters.
  • you can not nest \include, so no inludes inside included files. (But you van use \input inside inlcuded files)
  • your current system of redefining the includepath will still work when using \include but it will probably break the \includeonly command. So you might have to ditch that.

I hope this interests you. Keep up the good work

It is! I will look into that. Thanks!

I just realised that I forgot one drawback to keep in mind. I edited the original post.