How to disable table and figure title auto caption labeling

mstrubberg
Posts: 48
Joined: Sat Jan 26, 2013 6:07 pm

How to disable table and figure title auto caption labeling

Post by mstrubberg » Tue Sep 24, 2013 10:18 pm

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?

mstrubberg
Posts: 48
Joined: Sat Jan 26, 2013 6:07 pm

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

Post by mstrubberg » Tue Sep 24, 2013 10:19 pm

Is this done in the strings files?

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

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

Post by sorin_ristache » Thu Sep 26, 2013 4:02 pm

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

mstrubberg
Posts: 48
Joined: Sat Jan 26, 2013 6:07 pm

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

Post by mstrubberg » Fri Sep 27, 2013 6:56 pm

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!

JasonDavis
Posts: 1
Joined: Wed Nov 20, 2013 10:26 pm

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

Post by JasonDavis » Wed Nov 20, 2013 10:31 pm

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

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

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

Post by sorin_ristache » Thu Nov 21, 2013 4:40 pm

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

kbentley
Posts: 2
Joined: Tue Sep 27, 2016 8:25 pm

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

Post by kbentley » Tue Sep 27, 2016 8:28 pm

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.

radu_pisoi
Posts: 377
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

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

Post by radu_pisoi » Wed Sep 28, 2016 10:33 am

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.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

GHogarth
Posts: 26
Joined: Tue Aug 27, 2019 10:55 pm

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

Post by GHogarth » Tue Feb 25, 2020 4:39 am

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

Radu
Posts: 7201
Joined: Fri Jul 09, 2004 5:18 pm

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

Post by Radu » Thu Mar 26, 2020 12:00 pm

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply