Guenter Milde wrote: > I suppose we can compare modification times of the corresponding *.lyx > and *aux files and regenerate them only if there are changes.
Yes, we can probably do that. But that means we need to re-generate the aux file as soon as a LyX file is modified (IOW almost always). > As changed page or section numbers affect subsequent sub-documents, *.aux > regeneration must be done for all sub-documents from the changed one to > the current one. > > Example: > > * parent.lyx includes child1.lyx, child2.lyx, ... , child5.lyx > > * child2.lyx is newer than child2.aux > > Compiling child4.lyx with "includeonly" requires update of > child2.aux and child3.aux. > -> run latex with "includeonly child2", > run latex with "includeonly child3", > run latex with "includeonly child4" (possibly several times) Changed aux file can also affect _prior_ children. Consider child1 contains a page reference to child2, where the page number was "99". Due to an update of child2, this page has become "100". This might affect the line-breaking and page breaking in child1, which itself might affect the counters of child1. This is just one example. I think the only reliable way to maintain counter correctness is to run LaTeX on the whole document again. Jürgen