Page 1 of 1

Equation-Figure in Output

Posted: Thu Feb 23, 2017 6:57 pm
by dgallo
We wrap our equations in the <equation-figure> element, and assign it a title. By default, in the responsive webhelp output, <equation-figure> title's appear as Figure 1: equation title. We instead need equation titles to start with Equation 1: equation title.

Also, when cross-referencing an <equation-figure>, we would want the link text to start with "Equation 1: equation title".

How do we make this happen?

Re: Equation-Figure in Output

Posted: Tue Feb 28, 2017 10:00 am
by alin
Hello,

We have reported this issue to the DITA-OT development team. Until a fix is available you can use a custom CSS that hides the "Figure" static text and displays "Equation" instead.

This procedure in our User Manual describes how the WebHelp output can be customized using an additional CSS: https://www.oxygenxml.com/doc/versions/ ... n-css.html

You can use the following CSS fragment as a starting point:

Code: Select all

.equation-figure .figtitleprefix {
display: none;
}

.equation-figure > .figcap:before {
content: "Equation:";
display: inline-block;
padding-right: 5px;
}
Regards,
Alin

Re: Equation-Figure in Output

Posted: Thu Mar 30, 2017 5:00 pm
by dgallo
.equation-figure .figtitleprefix {
display: none;
}

does not remove Figure. I tried:

.equation-figure .fig--title-label {
display: none;
}

but that remove the number, which is pretty important.

Re: Equation-Figure in Output

Posted: Thu Mar 30, 2017 6:17 pm
by dgallo
I was able to successfully use JS to make these changes.

To change the figure title prefix from "Figure" to "EQ." I added the following JS:

Code: Select all

$(".equation-figure .figcap span").text(function (_, ctx) {
return ctx.replace("Figure", "EQ.");
});


To change the cross reference prefix from "Figure" to "EQ." I first assigned the <xref> element the outputclass="equ", and then added the following JS:

Code: Select all

$("a.equ").text(function (_, ctx) {
return ctx.replace("Figure", "EQ.");
});