With the manual .... what had been done, was to take several files in a directory, and merge them together. Originally each chapter was separated. I suspect they used any of a number of automated tools to combine the separate chapter files into one bigger file.
The tool would take a directory listing, with names like "chapter 1" and "chapter 2" as we would ... naturally 2 after 1 ... but once the tool was given files for chapters 1 through 12, it started showing a well known dos type file sort ... similar to the Dewey Decimal System .. Number <dot> Number
In this case, it does a column sort
chapter 1
chapter 11
chapter 12
chapter 2
All four have "chapter" a "space" and then 1 1 1 2. The first pass of sorting moved the names to that order. it then compared the next character ... the last "1" in chapter 11 and the "2" in chapter 12 ...
so it saw them like
chapter 1.
chapter 1.1
chapter 1.2
chapter 2.
and not as whole numbers.
The "easy" way around this would be to know how many chapters you have .. and name them 01, 02, 03 etc.. or if you had up to 999 ... 001, 002, 003 ... that way the sort doesn't have to think about it.
Its also like the trick for keeping items by date .. say folders with pictures in them on your drive ... rather than name them for Month, Day, Year .... you name them for Year, Month, Day.
The logic there ... the year is the most significant "bit" ... there is only one 2011 ... only one 2010 ... but there are 12 months and 28 to 31 days... given dates like Jan 1 2010, Feb 1 2010, Jan 2 2011 ...you'd get an order like this:
1-1-2010
1-2-2011
2-1-2010
but using year first, then month, day ... you'd get this
2010-1-1
2010-2-1
2011-1-1
which would again break if you didn't use 01 ~ 09, as soon as you'd reach 10, it would still sort those wrong. So the final way it should be (with leading 0's)
2010-01-01
2010-02-01
2011-01-01