Figure and table caption formatting

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

Figure and table caption formatting

Post by dbutch »

I am having some issues getting the captions for tables and figures to behave as I would like in the PDF output.
I have tried a few different approaches but have now adopted the 'deep-chapter-scope-no-page-reset' parameter for numbering tables and figures (which is a welcome recent update).

At present, my table captions are styled as I would like but are separated over two lines, i.e. the figure number is sitting above (or in some cases on a different page) to the caption.
image.png
image.png (1.54 KiB) Viewed 3039 times
My CSS for this is:

Code: Select all

*[class ~= "table"] span[class ~= "title"] {
	font-family: 'IBM Plex Sans Condensed Text';
	font-size: 9pt;  
	display: block;	
	text-align: center;
}

.table--title-label {
	display:block;
	text-align: center;
	font-family: 'IBM Plex Sans Condensed Text';
	font-size: 9pt;	
	break-after: avoid;
	break-before: avoid;
}

My figure captions are behaving slightly differently: the figure number is centred and in the correct style; however, the caption is using the default style and is left aligned. They are also on separate lines.
image.png
image.png (2.1 KiB) Viewed 3039 times
My CSS is:

Code: Select all

*[class~= "topic/fig"] > *['topic/title'] {
	font-family: 'IBM Plex Sans Condensed Text';
	font-size: 9pt;	
	display: block;
	text-align: center; 	
}

.fig--title-label {
	display:block;
	text-align: center;
	font-family: 'IBM Plex Sans Condensed Text';
	font-size: 9pt;	
}
I have also tried a similar approaches using .figcapcenter and .figtitleprefix

Any suggestions as to how I can style the whole caption consistently, and on the same line for both tables and figures?

Thanks.
Costin
Posts: 828
Joined: Mon Dec 05, 2011 6:04 pm

Re: Figure and table caption formatting

Post by Costin »

Hello,

Please note that, even if CSS customization falls outside of the technical support that we offer (software functionality issues, feature requests and punctual questions related to specific features of our software), we could also try to see if we could find something for you, withing the time and human resources available.
However, to help us see exactly for which table/figure titles the title is on a separate line (or separate page) in your document, you should send us (on support@oxygenxml.com) a small sample DITA Map hierarchy of files in an as minimal form as possible (with just a few topics), that you can use to reproduce the reported situation, altogether with the entire specific customization .css file.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
dbutch
Posts: 41
Joined: Wed Aug 14, 2019 9:16 am

Re: Figure and table caption formatting

Post by dbutch »

Hi Costin,
However, to help us see exactly for which table/figure titles the title is on a separate line (or separate page) in your document, you should send us (on support@oxygenxml.com) a small sample DITA Map hierarchy of files in an as minimal form as possible (with just a few topics), that you can use to reproduce the reported situation, altogether with the entire specific customization .css file.
I have sent the files to the support address.

Thanks.
dbutch
Posts: 41
Joined: Wed Aug 14, 2019 9:16 am

Re: Figure and table caption formatting

Post by dbutch »

Thanks for the support Julien.

For reference, the following resolved the issue with the captions:

Figure captions

Code: Select all

figcaption {
	display:block;
	text-align: center;
	font-family: 'IBM Plex Sans Condensed Text';
	font-size: 9pt;	
}
Table captions

Code: Select all

table > caption {
	text-align: center;
	font-family: 'IBM Plex Sans Condensed Text';
	font-size: 9pt;
}
All parts of the captions are now in the same font, centred, and on a single line.
Post Reply