Changing formatting of index in DITA>PDF output

GHogarth
Posts: 26
Joined: Tue Aug 27, 2019 10:55 pm

Changing formatting of index in DITA>PDF output

Post by GHogarth » Thu Nov 14, 2019 1:13 am

Hi there.
I'd like to change how the index is laid out in a PDF file created from DITA using the DITA MAP based on HTML5 & CSS transformation.
What I want is to have the page numbers appear on the same line as the index text, rather than on the line below.
How do I achieve this?

Current:
index entry
4,7,99,123

Desired:
index entry 4,7,99,123

Costin
Posts: 715
Joined: Mon Dec 05, 2011 6:04 pm

Re: Changing formatting of index in DITA>PDF output

Post by Costin » Wed Nov 20, 2019 1:10 pm

Hello,

You should use in your CSS a rule like:

Code: Select all

*[class~="index/formatted-value"],
*[class~="index/refid"] {
    display:inline;
}
You could style the way the index terms are displayed in the PDF even further.
For more information on styling the elements in the Index section see the Index section from the DCPP User-Guide.

Also, for such situations, when you need to identify the right selectors that you should use in your own customization CSS in order to style the elements in the resulted PDF (and overwrite in your CSS the rules that come from the default CSS files used by oXygen), please see the Debugging the CSS section.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

Post Reply