Page 1 of 1

Suppress Page Number in CrossRef

Posted: Wed Sep 28, 2022 8:39 pm
by IsleofGough
I would like to suppress the page numbering in cross-references in the HTML/CSS pdf target so that I can use these as endnotes (where more than one cross-reference may go to the same endnote). I created a custom CSS:

Code: Select all

*[class ~= "topic/xref"][href]:after,
*[class ~= "topic/link"][href]:after {
    content: none;
}
I set the target to use this custom CSS but it still generates page numbers (see attachment). What am I missing? Also, is there a way of just suppressing page numbers in some cross refs but not others, so I can use both cross refs as endnotes and as cross-references to page numbers in other topic files?
Image

Re: Suppress Page Number in CrossRef

Posted: Thu Sep 29, 2022 9:22 am
by julien_lacour
Hello,

If you want to remove the "on page X" label for all the links you can directly use the 'args.css.param.show-onpage-lbl' DITA parameter (available when editing DITA scenario).

If you want to remove the label only for a few links you can mark them with an outputclass, for example <xref keyref="genus" format="dita" outputclass="no-label">genus</xref> and then match this outputclass in the CSS, like this:

Code: Select all

/* Links. */
*[class ~= "map/map"] *[class ~= "topic/xref"][outputclass ~= "no-label"][href]:after,
*[class ~= "map/map"] *[class ~= "topic/link"][outputclass ~= "no-label"][href]:after {
  content: none;
}
You can also use any of the other attributes available in the element (like @href, @scope or @format), but in order to give you a relevant example I will need an example.

Regards,
Julien

Re: Suppress Page Number in CrossRef

Posted: Mon Oct 03, 2022 2:53 am
by IsleofGough
Perfect!