Best practice for print figures with fig captions

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
ajolson
Jr. Propeller Head
Posts: 3
Joined: Tue Sep 20, 2016 10:43 am

Best practice for print figures with fig captions

Post by ajolson »

I'm new to flare, and wondering about best practice for out-putting print figures with figure captions, and particularly when one may want the text to wrap around the figures.

To get figure captions, I followed the advice of creating a figure DIV class, and then a figurecaption paragraph class.

So each fig looks like:

Code: Select all

        
<div class="figure">
            <img src="../../imagepath.jpg" style="visibility: visible;width: 266px;height: 86px;border-top-style: solid;border-top-width: 1pt;border-bottom-style: solid;border-bottom-width: 1pt;border-left-style: solid;border-left-width: 1pt;border-right-style: solid;border-right-width: 1pt;" alt="RackConfig">
            </img>
            <p class="FigureCaption" MadCap:autonum="Figure 1-1 ">figure caption text goes here</p>
        </div>
with this CSS

Code: Select all

div.figure
{
	text-align: center;
	margin: 10px;
}

p.FigureCaption
{
	mc-auto-number-class: FigureNum;
	mc-auto-number-format: 'CF:Figure {chapnum}-{n+} ';
	padding-bottom: 10px;
	font-weight: lighter;
	color: #0e0000;
	text-align: center;
	font-family: 'Lucida Sans';
	font-size: 8pt;
}
This all is working fine as is. There is no styling attached to the img tag.

However, it has the limitation that I can't wrap text around it. For smaller figures, I'd like to wrap text. So I've defined a "half width" figure div in hopes having the text wrap around it.

Code: Select all

div.figure-half {
	text-align: center;
	clear: none;
	float: right;
	margin: 0px;
	width: 50%;
	display: block;
}
But this results in a mess of images and text when there's two images next to each other.
2figsTextugly.PNG
It also seems to messing up the caption centering.
captionOffset.PNG
Any suggestions of how to resolve these issues?

Or is there a better practice for doing half-width images?
You do not have the required permissions to view the files attached to this post.
BedfordWriter
Sr. Propeller Head
Posts: 231
Joined: Wed Jun 23, 2010 10:13 am
Location: Nova Scotia

Re: Best practice for print figures with fig captions

Post by BedfordWriter »

I know that there's a tutorial for that somewhere, but I can't find it now. Closest I could find is a tip in this topic:
http://help.madcapsoftware.com/flare12/ ... TopNav.htm

Anyway, from that elusive tutorial, I built the following styles for my print images:

Code: Select all

div.ImagesFloatLeft
{
	margin-right: 10px;
	float: left;
	clear: both;
}

div.ImagesFloatRight
{
	float: right;
	clear: both;
	margin-left: 10px;
}

div.ImagesNoFloat
{
	orphans: 2;
}
The captions use the following style:

Code: Select all

	p.Figure
	{
		font-size: 0.90em;
		font-weight: normal;
		font-style: italic;
		color: #696969;
		mc-auto-number-class: SeeAlsoIndex;
		mc-auto-number-format: 'CH:Figure {chapnum}-{n+} ';
	}
Putting it all together in a topic, an image would look like the following in the text editor. The key bit is that the caption is placed in the div with the image. It's probably not necessary to put <p> tags around the image.

Code: Select all

   <div class="ImagesFloatLeft">
       <p>
           <img src="../Resources/Images/SomeImage.png" />
       </p>
       <p class="Figure" MadCap:autonum="Figure 1-1 ">Caption for the image</p>
   </div>
Post Reply