How to make "zero indent" for List of Tables and List of Figures in the table of contents?

Having trouble installing Oxygen? Got a bug to report? Post it all here.
DAN SEA
Posts: 59
Joined: Tue Sep 13, 2022 4:13 pm

How to make "zero indent" for List of Tables and List of Figures in the table of contents?

Post by DAN SEA »

In general, friends, the question is in the title. I'm only asking because I've tried everything and can't seem to find a solution.

The point here is this:
Usually there is no problem with this (unless you are trying to adjust the indentation for subsections in the table of contents). If you try to set it up, lists of tables and figures are automatically indented.

I set the indents like this:

Code: Select all

*[class ~= "map/topicref"] *[class ~= "map/topicref"] {
margin-left: 1em;
}
*[class ~= "map/topicref"] *[class ~= "map/topicref"] *[class ~= "map/topicref"] {
margin-left: 1em;
}
*[class ~= "map/topicref"] *[class ~= "map/topicref"] *[class ~= "map/topicref"] *[class ~= "map/topicref"]{
margin-left: 1em;
}
However, I can’t find a way - how to remove the indents (automatically occurring) - before the List of Tables and List of Figures in TOC ...

I will be grateful for any advice!
julien_lacour
Posts: 495
Joined: Wed Oct 16, 2019 3:47 pm

Re: How to make "zero indent" for List of Tables and List of Figures in the table of contents?

Post by julien_lacour »

Hello,

This happens because figurelist and tablelist inherit from topicref (see DITA specs for figurelist and tablelist).
You can override this by adding this rule to your CSS customization:

Code: Select all

*[class ~= "bookmap/figurelist"],
*[class ~= "bookmap/tablelist"] {
  margin-left: 0 !important;
}
Or if you don't want to use the !important annotation you can modify the following rule in your CSS:

Code: Select all

*[class ~= "map/topicref"] *[class ~= "map/topicref"]:not([class ~= "bookmap/booklists"]) *[class ~= "map/topicref"] {
  margin-left: 1em;
}
You can debug the CSS to see all the rules applied to a given element and modify them (no need to transform again the document, just refresh the page).

Regards,
Julien
DAN SEA
Posts: 59
Joined: Tue Sep 13, 2022 4:13 pm

Re: How to make "zero indent" for List of Tables and List of Figures in the table of contents?

Post by DAN SEA »

Thank you, Julien, - for such full answer!
Post Reply