TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have written dozens of exercises as LyX documents in separate files. Each of them has its own unique number. For example: 1013, 2053 etc. I would like to create a booklet with all the exercises, arranged by their exercise number. Is there a good way to combine them without inserting files manually one after the other? and also is there a way to arrange their order ascending by exercise number?

Thanks in advance!

share|improve this question

It is not exactly clear what you want to achive. The following code includes all files <num>.pdf where <num> goes from start to end value, these values can be easily modified in the code. For details about how \loop...\repeat works, see Teach me how to use \loop...\repeat constructs, etc .




\x=3 % start value
\ifnum\x<10 % end value

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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