I have to type many books in Latex, where some chapters are quite similar to each other. My idea was to do one chapter in a directory and outsource the differences in a subdirectory where the main file is.

like this:


The several book files would include the content file, while the content file includes the differences file.

My question now is: is it possible to NOT include the whole differences file? so I could say in the contents file:

 ...some text...
 \include code-fragment 1 from differences
...some other common text
\include code-fragment 2 from differences

so I would not have to make plenty differences files for everything that is not common.

I hope my question is clear :) Many thanks


Thanks for the idea, WillAdams, it didn't work at first (maybe I made a mistake?), but if I put it the other way around it works:

The main file then looks like this:


  .1. ..some text...\\


  2. ...some other common text\\



and the file code-fragment:

  different text to appear under `1'

  different text to appear under `2'
  • I always manage to mess up the simple binary stuff --- pasted stuff in the wrong order I guess --- glad you got it working. – WillAdams Aug 19 '13 at 1:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.