27

I am considering learning Latex in order to more easily maintain a bunch of manuals for my company. One of the requirements is to have a "List of Effective Pages" towards the beginning of the document which is a list of every page in the document and the revision level and date for that page. (Note that this is a requirement of our regulatory oversight so is not optional.) Optionally, I would (really) like to combine pages with the same revision level into one line like in the example below.

For instance:

PAGE NUMBER      REVISION NUMBER     REVISION DATE
  i - ix              2                03/23/10
   1-1                2                03/23/10
1-2 - 1-10            1                06/15/09
2-1 - 2-19            0                01/31/09 

While I have searched this site and Google, I have not found a solution to this particular aspect of our manuals. Can anyone point towards a way to accomplish a List of Effective Pages?

EDIT
For a little more background and to respond to some of the comments, this is indeed for required manuals in the aviation industry. Also, we do typically use chapter specific page numbers to help minimize the impact of adding a new page. (I have updated the example above to reflect this.) Also, the table of contents, list of effective pages, etc are all in the introduction section of the document, and start with roman numeral page numbers so that adding an additional page does not impact the rest of the document.

I am a programmer (very active on SO) so when I say that I am considering learning Latex, I don't have an issue with learning the macro programming aspects as well, and would happily give my code back to the community. I'm just trying to determine if it is even feasible with the limitations of the system and, if it is, I would like some guidance from more experienced individuals to get headed down the right path.

lnafziger
  • 321
  • 8
    How do you connect up the dates/revisions with pages? This seems like an odd concept, since a page is not a logical part of a document. For example, if revision 1 of page 1 adds a page, and now the old page 2 begins on page 3, does the revision number of the old page 2 (and its associate date) have to change as well? If not, how does this work? – Alan Munn Aug 07 '13 at 18:51
  • @AlanMunn: Yes, ANY change to a page means that it has been revised (even if just the page number changed). Right now, we manually add the revision level/date to the bottom of each page whenever we make a change, and then update the LEP at the same time. Obviously, this is error-prone.... Since Latex source doesn't really seem to use the concept of pages, I'm not sure how I would connect up the dates/revisions with the pages, hence my question. – lnafziger Aug 07 '13 at 18:53
  • So if you add one longer paragraph on page 3 then all pages after that are marked as modified? This is a strange concept but if that is the case one could get something such as latexdiff and modify it a bit to write to a variable where the first change happened. – Alexander Aug 07 '13 at 22:34
  • 2
    @Alexander Unfortunately this won't work, since the source document (which latexdiff would operate on) has no concept of the page. – Alan Munn Aug 07 '13 at 23:01
  • While I don't have much experience with this, I was thinking something along the lines of the changebar or chbar packages which compare two versions of the same document and mark changed portions. A similar approach could possibly find changed content and use the new revision number/date for the changed pages? Or, possibly mark each paragraph/section/something with the revision date/number? – lnafziger Aug 08 '13 at 03:57
  • 3
    @Alexander I've seen this before, and essentially enough blank space is added at the end of a section/chapter that for a reasonable document lifetime, addition will be swallowed there. Also chapter-wise page number can be used, so adding a lot of text to page 1-11 would create a new page 1-12, the next page would still be 2-1 and unchanged. As the change log is at the beginning of the document, and can only ever grow, it will have this effect itself, so may start on page 0-2 after a page 0-1 title page, for example. – Chris H Aug 08 '13 at 08:01
  • @ChrisH: Yes, I was thinking of purely consecutive page numbers. If the page numbers represent the structure of the document this makes much more sense. Tying a change to a page number is still strange in 2013 when even pilots replace their reference books with ipads. – Alexander Aug 08 '13 at 08:54
  • @AlanMunn: I was thinking of something very rudimentary such as latexdiff writing a command that writes during shipout xxx changed to yyy on page 3. For anything fancier you are completely right and a more involved procedure is required. – Alexander Aug 08 '13 at 09:00
  • @Alexander - not many pilots are allowed to yet, and I suspect there's some form of legacy page numbering in use rather than (as well as) decent section referencing - at least until the whole system is electronic. It was actually aviation-related when I did this many years ago. – Chris H Aug 08 '13 at 09:11
  • @Alexander ChrisH is correct, this is for aviation and many companies are not approved for the use of iPads, and even if they were this is still an FAA requirement. (See updated question above.) – lnafziger Aug 09 '13 at 17:53
  • 3
    Would it be feasible to mark changes in the document with macros like \change{<rev>}{<date>}...\endchange? This way it would be quite feasible to calculate the "most recent change" for any page. – Stephan Lehmke Dec 11 '13 at 11:18
  • @StephanLehmke: Absolutely! However, keep in mind that it would be possible for changes to span more than one page AND to have nested changes as well. Note also, that although I didn't say this in the original question, I would also like to have the revision number and date included in the footer of each page. (I was assuming that if it were possible to create the list of effective pages, that this would be possible as well, but any solution should keep both in mind.) – lnafziger Dec 11 '13 at 17:28
  • The "span more than one page" is of course implicit as one basic assumption would be that you don't really know in advance what page the change markers are placed on. Concerning the nesting, I guess they wouldn't even need to be nested properly, so it's probably better to use \endchange{<rev>}{<date>} to make sure to match the correct begin- and end-marks. – Stephan Lehmke Dec 11 '13 at 17:33
  • @StephanLehmke: Correct on the nesting. That was probably the wrong term, as they could be either nested or over-lapping as well as independent. – lnafziger Dec 11 '13 at 22:18
  • Are the "pages" logically distinct e.g. separate documents? – cfr Dec 11 '13 at 23:58
  • @cfr: No, each page is not but each section could be if needed. – lnafziger Dec 12 '13 at 03:13
  • @StephanLehmke: Did you have something in mind for this? – lnafziger Dec 26 '13 at 03:57
  • 1
    Yes, I'll try to make a suggestion during my christmas holidays ;-) Sorry for not answering earlier. – Stephan Lehmke Dec 27 '13 at 04:26
  • 21 up-votes, 9 stars, and an expired bounty. Does this mean that it isn't possible?? – lnafziger Jan 19 '14 at 23:27

2 Answers2

1

It sounds like you're going to have to be nearly as attentive of page breaks as Knuth has been of line breaks in updating the TeXbook.

However, since you actually have things to track about each page, I think you may want to use a macro like \pagerevision{<rev>} for each page break, and set things up so that pages won't break anywhere else without a warning. You might also want to include the date there, though that would mean duplication, and it wouldn't be a terrible idea to include the full intended page number there either (so you can compare it with the actual page number later).

You'll probably want to read up on at least these:

  • how TeX builds pages: see chapters 15 and 23 of the TeXbook

  • LaTeX's output routine

  • \addcontentsline, which will show you how to store the information you need for the next pass through the document.

SamB
  • 2,837
0

I think the easiest solution would be to couple the compilation of the latex file with an external program. I would do this:

  • separate the file in different files (as many as you want to track separately), join them in the main tex file (the include command is optimal for chapters, while input can be used recursively).
  • use the fancyhdr package to get the numbers with the chapter number included.
  • get the "last modified date", you can run an external script, or in latex itself (see here) but I think is better to handle it externally, because eventually you can get information from some other revision control system, like git.
  • add the annotation of the date to the toc (see here).
chuse
  • 163
  • 5