Glossary content control

Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
dbutch
Posts: 41
Joined: Wed Aug 14, 2019 9:16 am

Glossary content control

Post by dbutch »

Hi,
I would like to control the content that is included in my glossary. I have managed to set a glossary up satisfactorily using keyrefs, which are used to reference the <glossentry> topics. Provided the glossentry is referenced in the <glossarylist> in the same bookmap where the key is referenced, it includes the <glossentry> in the text (as abbreviated-form) and in the glossary at the back of the PDF. It looks like this in a bookmap using the 'HMI' <glossentry>:

Code: Select all

<backmatter>
        <booklists>
            <glossarylist>
                <topicref href="Reuseable%20content/glossary/H/hmi.dita" keys="gloss_HMI"/>
I'm not sure if this is the recommended/most efficient way, but it seems to work.
At the moment, for each term in the glossary of the PDF, the following elements are shown:

<glossterm>, <glossdef>, <glosssurfaceform>, <glossacronym>.

Is there a way to control what elements are shown for all the referenced <glossentry> topics in the PDF glossary?
The <glossterm> and the <glosssurfaceform> are almost identical, so they both don't need to be visible. The <glossacronym> could also be removed, leaving only the <glossterm> and the <glossdef> in the PDF glossary, for each entry.

Thanks.
julien_lacour
Posts: 495
Joined: Wed Oct 16, 2019 3:47 pm

Re: Glossary content control

Post by julien_lacour »

Hello

Of course you can control this display for example by using:

Code: Select all

*[class~="glossentry/glossSurfaceForm"] {
    display: none;
}
For more filtering, you can debug your CSS using your favorite browser: Debugging the CSS

Regards,
Julien
dbutch
Posts: 41
Joined: Wed Aug 14, 2019 9:16 am

Re: Glossary content control

Post by dbutch »

Great, thanks Julien, that works.

For some reason when I add:

Code: Select all

*[class~="glossentry/glossAlt"] {
	display: none;
}
below your suggestion, the glossary does not recognise page boundaries and will put all the glossary entries on a single page, spilling beyond the page bottom (it does remove the glossAlt element, as intended). This doesn't occur if I only use the CSS you suggest. Do you know why this may occur?
julien_lacour
Posts: 495
Joined: Wed Oct 16, 2019 3:47 pm

Re: Glossary content control

Post by julien_lacour »

Hello,

As far as I know, glossentries are always displayed on the same page, if you need to change this behavior you can simply do the following:

Code: Select all

* [class ~= 'glossentry/glossentry'] {
    page-break-after: always;
}
Regards,
Julien
dbutch
Posts: 41
Joined: Wed Aug 14, 2019 9:16 am

Re: Glossary content control

Post by dbutch »

Apologies, Julien, I perhaps didn't explain myself clearly. Attached is a screenshot showing the bottom of the page with the contents of the glossary spilling over the footer and beyond the page. There is only the single page for all the glossary items, instead of the three required to fit the contents for all glossary items.
This only occurs if I try to filter out more than one of the glossary elements, like <glossAlt> and <glossSurfaceForm>.

Glossary page extents
Glossary page extents
image.png (30.56 KiB) Viewed 3450 times
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Re: Glossary content control

Post by Dan »

Hello Duncan,

I think the problem comes from the usage of "page-break-before:avoid" property on "glossentry/glossterm" elements. Do you have something like this in your customization CSS?

Please note that "glossentry/glossterm" elements are also inheriting the "topic/title" class, so another rule from the built-in CSS applies:

Code: Select all

*[class ~= "topic/title"] {
    page-break-after:avoid;
}
So the result is that the page cannot break before or after the glossterms, so it start bleeding. I recommend removing the page-break-avoid property from the customization CSS.
Many regards,
Dan
dbutch
Posts: 41
Joined: Wed Aug 14, 2019 9:16 am

Re: Glossary content control

Post by dbutch »

Hi Dan,

Thanks for the information - you were correct. I had a number of 'page-break-before:avoid' properties set on topictitle elements.

Code: Select all

.topictitle {
    font-family: IBMPlexSans-Medium;
	font-size: 18pt;
	margin-bottom: 0.5em;
	margin-top: 0.7em;
	border-bottom: 0.75pt solid red;
	page-break-after:avoid;
	page-break-before:avoid;
}

.topictitle1 {
    font-family: IBMPlexSans-Medium;
	font-size: 18pt;
	margin-bottom: 0.5em;
	margin-top: 0.7em;
	border-bottom: 0.75pt solid red;
	page-break-after:avoid;
	page-break-before:avoid;
}
As so on for the topictitle2, 3, 4.

When I remove the property for topictitle, topictitle1, topictitle2, it resolves the issue; topictitle3 & 4 have no effect.
I have removed them now, and there don't seem to be any negative impacts.

Thanks!
Post Reply