List of Tables/Figures
To activate these:
- The map must be a DITA bookmap.
- There must be a
<figurelist>
or<tablelist>
in the frontmatter or backmatter. In the following example, both of the lists are added just after the table of contents (the<toc>
element is the placeholder where the table of contents will be created):<frontmatter> <booklists> <toc/> <figurelist/> <tablelist/> </booklists> </frontmatter>
How to Set a Header for a List of Tables/Figures
Suppose you want to set the headline "Figure List" on the second and subsequent pages associated to a list of figures and something similar for a list of tables.
Start by associating pages to the list of figures and tables from the merged
file:
*[class~="placeholder/tablelist"] {
page:tablelist;
color:green;
}
*[class~="placeholder/figurelist"]{
page:figurelist;
color:green;
}
Note: The
"placeholder/tablelist" is the class name of the output generated from the
Then define the pages:<tablelist>
bookmap element.
@page figurelist {
@top-left { content: none; }
@top-center { content: "Figure List"; }
@top-right { content: none; }
}
@page figurelist:first {
@top-left { content: none; }
@top-center { content: none; }
@top-right { content: none; }
}
@page tablelist {
@top-left { content: none; }
@top-center { content: "Table List"; }
@top-right { content: none; }
}
@page tablelist:first {
@top-left { content: none; }
@top-center { content: none; }
@top-right { content: none; }
}
How to Remove the Numbers Before a List of Tables or Figures
Suppose you need to remove the "Figure NN" prefix before each entry of a list of figures.
An entry in the generated list of figures from the merged map looks like this:
<entry class="- listentry/entry " href="#unique_6_Connect_42_fig_rjy_spn_xgb">
<prefix class="- listentry/prefix ">Figure</prefix>
<number class="- listentry/number ">4</number>
<title class="- topic/title ">This is another figure</title>
</entry>
For
the HTML merged map, the element names are all <div>
elements but they have the
same class.So, to hide the label and the number, use:
*[class~="listentry/prefix"],
*[class~="listentry/number"] {
display:none;
}
This
works for both a list of tables and list of figures since the structure of each entry is the
same. To make it more specific (for example, to apply it only for the list of figures), you can add the selector:
*[class~="placeholder/figurelist"] *[class~="listentry/prefix"],
*[class~="placeholder/figurelist"] *[class~="listentry/number"] {
display:none;
}