Internal links to ids with the same name (but in different pages) get conflated in PDF export


#1

Hi,
In each chapter, I use the same ids to link to figures (i.e. “fig1”, “fig2”, …), so each chapter has an id=“fig1”, e.g.:

https://wisc.pb.unizin.org/agent-based-evolutionary-game-dynamics/chapter/0-1/#fig1
https://wisc.pb.unizin.org/agent-based-evolutionary-game-dynamics/chapter/0-2/#fig1

It seems that all these get conflated in the PDF export, so all internal links to “fig1” point to the very first “fig1” in the book, rather than to the one in the corresponding chapter.

This is not the case in the EPUB export, which behaves as expected. I wonder whether this is something that should ideally be fixed in the future, or users should use unique ids in the whole book.
Thanks a lot,
Luis


#2

Hi Luis,

This isn’t something we support right now; the best approach would be to add chapter identifiers to the links you are generating, so #01-02-fig1 etc. Please open an issue at https://github.com/pressbooks/ideas.

NZ


#3

Thanks a lot Ned. I’ve opened an issue, but I fully understand if you Guys decide that this is not priority.