[திங்கள் அக்டோபர் 07, 2024] Tassilo Horn wrote: > Visuwesh writes: > >>> The patch looks good. But during testing, it seems that the index is >>> always off by one page, i.e., the index for some section brings me to >>> page 117 but the section heading is actually on page 118. >>> >>> I have that both with the Peter Atkins et al. book you suggested as >>> well as with own papers which didn't work at all previously due to >>> #nameddest references. >> >> Ugghhh, looks like the page number returned by the JS function is >> zero-indexed. Thanks for the catch (and sorry for the many mistakes >> and hence the back-and-forth). Should be corrected in the attached >> patch. > > Nope, now I get off-by-many-hundreds errors. The Imenu entries have the > page number in parens, right? If so, I have many references to pages > that are thrice as large as the actual number of pages, e.g., here some > parts of the *Completions* buffer for the Atkins book: > > FOCUS.1.The.properties.of.gases.(341) > FOCUS.10.Molecular.symmetry.(4181) > FOCUS.11.Molecular.spectroscopy.(4481) > FOCUS.12.Magnetic.resonance.(5181) > FOCUS.13.Statistical.thermodynamics.(5621) > FOCUS.14.Molecular.interactions.(6141) > FOCUS.15.Solids.(6701) > FOCUS.16.Molecules.in.motio.(7201) > FOCUS.17.Chemical.kinetics.(7521) > FOCUS.18.Reaction.dynamics.(8101) > FOCUS.19.Processes.at.solid.surfaces.(8541) > > It's large but doesn't have more than 8000 pages. I messed up by not considering the precedence of operators. :-( Fixed in the attached patch.