Equation-Figure in Output

dgallo
Posts: 89
Joined: Tue Mar 31, 2015 10:43 pm

Equation-Figure in Output

Post by dgallo » Thu Feb 23, 2017 6:57 pm

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?

alin
Site Admin
Posts: 139
Joined: Thu Dec 24, 2009 11:21 am

Re: Equation-Figure in Output

Post by alin » Tue Feb 28, 2017 10:00 am

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
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com

dgallo
Posts: 89
Joined: Tue Mar 31, 2015 10:43 pm

Re: Equation-Figure in Output

Post by dgallo » Thu Mar 30, 2017 5:00 pm

.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.

dgallo
Posts: 89
Joined: Tue Mar 31, 2015 10:43 pm

Re: Equation-Figure in Output

Post by dgallo » Thu Mar 30, 2017 6:17 pm

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.");
});

Post Reply