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

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.:

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,

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


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