Forum How do I...?

Table of Figures, Table of Tables

mikeosbornma
Is there any way to take an HTML input that has both figures and tables and generate a PDF output that has a table of figures (TOF) and table of tables (TOT)?

Thanks,

-Mike

mikeday
You can do this by writing JavaScript to go through the DOM, find the figures and tables, and generate new HTML elements at the start of the document that link to them.
mikeosbornma
I'm not against writing some scripts, but has anyone already solved this problem....and maybe has a working example? Thanks, Mike.
mikeday
I'm sure we have an example around here somewhere, I will try and find it. :)
howcome
Here's a quick modification to a document which has both figures (several) and tables (only one).

http://css4.pub/2015/textbook/figures-tables.html
http://css4.pub/2015/textbook/figures-tables.pdf

The script at the end of the HTML file will traverse the tree and inject a hyperlinked list of figures and tables.
mikeosbornma
Great! I'll take a look.

Thanks, Mike