Page 1 of 1

How to disable table and figure title auto caption labeling

Posted: Tue Sep 24, 2013 10:18 pm
by mstrubberg
How can I disable the auto caption labeling in a table to prevent the html output from applying Table (number) on each table <title> element?

How can I disable the auto caption labeling in a figure to prevent the html output from apply Figure (number) on each figure <title> element?

Re: How to disable table and figure title auto caption label

Posted: Tue Sep 24, 2013 10:19 pm
by mstrubberg
Is this done in the strings files?

Re: How to disable table and figure title auto caption label

Posted: Thu Sep 26, 2013 4:02 pm
by sorin_ristache
Hi,

There is no parameter in the transformation for that. To disable the static label that precedes a table title please remove or comment out the entire element xsl:choose that starts at line 3724 in file [Oxygen-install-dir]\frameworks\dita\DITA-OT\xsl\xslhtml\dita2htmlImpl.xsl.

Disabling the static label for the figure titles is already implemented in Oxygen. I checked in the installation directory of Oxygen 15.0 and 14.2. The entire xsl:choose element at line 3805 in the same file dita2htmlImpl.xsl is already comment out, so you should not get a label like Figure 1. in a figure title in the DITA XHTML transformation, or the DITA Webhelp one, or the DITA Windows Help (CHM) one. Do you get a label like Figure 1. in a figure title in Oxygen 15.0 or in Oxygen 14.2?


Regards,
Sorin

Re: How to disable table and figure title auto caption label

Posted: Fri Sep 27, 2013 6:56 pm
by mstrubberg
Sorin, The xsl:choose you indicated was not already commented out in our download of 14.2 but we see that it is already commented out in 15.0. After commenting out the xsl:choose in 14.2 in dita2htmlImpl.xsl, on compose to webhelp and xhtml, the table and figure caption no longer contains the auto generated Table 1 or Figure 1 caption text and only the <title> text displays.

Many thanks!

Re: How to disable table and figure title auto caption label

Posted: Wed Nov 20, 2013 10:31 pm
by JasonDavis
Hi Sorin,

Can you provide guidance on how to do this for a PDF transform? I was looking through the templates for tables as that seemed like the right place to address this. While it's easy to remove the autonumbering, removing the label all together without deleting the title was a bit more complicated.

Thanks,
Jason

Re: How to disable table and figure title auto caption label

Posted: Thu Nov 21, 2013 4:40 pm
by sorin_ristache
Hi Jason,

For PDF output you have to customize the template that creates the tables in the XSLT stylesheets for PDF output. You should look in the template:

Code: Select all

<xsl:template match="*[contains(@class, ' topic/table ')]/*[contains(@class, ' topic/title ')]">
in the file:

Code: Select all

[Oxygen-install-dir]\frameworks\dita\DITA-OT\plugins\org.dita.pdf2\xsl\fo\tables.xsl

Regards,
Sorin

Re: How to disable table and figure title auto caption labeling

Posted: Tue Sep 27, 2016 8:28 pm
by kbentley
Hello,

An old thread, but I've the current issue. How would I disable the auto caption/label for table titles in Oxygen 18? Apparently the path to the XSL has changed.

Thanks.

Re: How to disable table and figure title auto caption labeling

Posted: Wed Sep 28, 2016 10:33 am
by radu_pisoi
Hi,

oXygen 18 comes bundled with two versions of DITA-OT: 1.8.5 and 2.2.3. The path for DITA-OT 1.8.5 is [Oxygen-install-dir]\frameworks\dita\DITA-OT while the path for DITA-OT 2.2.3 is [Oxygen-install-dir]\frameworks\dita\DITA-OT2.x. The default DITA-OT used by oXygen is DITA-OT 2.3.2.

However, the XSLT stylesheet used to handle the tables is in the same location: {DITA-OT folder}/plugins/org.dita.pdf2/xsl/fo/tables.xsl.

Another option to change the text generated for table title is to redefine the 'Table.title' variable. By default its value is:

Code: Select all

<variable id="Table.title">Table <param ref-name="number"/>: <param ref-name="title"/></variable>
For instance, to display only the table title you can redefine it to the value:

Code: Select all

<variable id="Table.title"><param ref-name="title"/></variable>
The PDF plugin variables are declared in the '{DITA-OT folder}/plugins/org.dita.pdf2/cfg/common/vars/en.xml'. You need to create a PDF customization plugin that overrides the above variable. You can read about how to create a PDF customization plugin here:
http://www.dita-ot.org/dev/dev_ref/pdf- ... ample.html

Please note that I've tested this solution only with DITA-OT 2.2.3.

Re: How to disable table and figure title auto caption labeling

Posted: Tue Feb 25, 2020 4:39 am
by GHogarth
Hrrumph! For Oxygen 22 (and probably 21), I thought that the file is:
{DITA-OT}\dita-ot-3.4\plugins\org.dita.html5\xsl\tables.xsl
and the "xsl:choose" section to comment out is lines 376-424
But commenting out those lines doesn't change the behaviour. :(

Re: How to disable table and figure title auto caption labeling

Posted: Thu Mar 26, 2020 12:00 pm
by Radu
Hi,

The thread above is for the PDF output. You seem to be making changes to the HTML5 XSLT stylesheets.
Could you maybe tell us again what behavior you want to change and for what output format?

Regards,
Radu