Auto-Numbering for figures using {Gn+} or {n+} fails.

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
Eric Lachance
Sr. Propeller Head
Posts: 127
Joined: Thu May 13, 2010 11:51 am
Location: Montreal, Quebec, Canada
Contact:

Auto-Numbering for figures using {Gn+} or {n+} fails.

Post by Eric Lachance »

I really don't know why everything that should be so simple becomes a battle that really is starting to get on my nerves.

I looked up autonumbering and it seemed straightforward - you just plug in the variables and it works. For example, using "Figure {chapnum}-{n+}:" should show figure 1-1, 1-2, 1-3, 2-1, 2-2, 3-1, etc. But no, it has to screw up and keep {chapnum} at 1 throughout my outgoing PDF, even though the "autonumbers" tab Chapter Number section says "continue from previous" and I have checked "Start a new chapter document" set to "continue from previous" also.

So I threw that idea overboard and though "hey let's just use Figure X instead of Figure X-Y, using a global variable", and I tried using both {n+} and {Gn+}. Both start at 1, and are reset to 1 at each chapter start!

I mean... Whiskey, Tango, Foxtrot, over? Anyone have a clue why Flare is p*ssing me off so much?

In the meantime, I removed all the "start a new chapter" checkmarks and the numbering using {Gn+} works - thank the gods I'm not actually using any other chapter numbering at the moment!
Eric Lachance
Technical Trainer
Objectif Lune Inc.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Auto-Numbering for figures using {Gn+} or {n+} fails.

Post by LTinker68 »

Eric Lachance wrote:So I threw that idea overboard and though "hey let's just use Figure X instead of Figure X-Y, using a global variable", and I tried using both {n+} and {Gn+}. Both start at 1, and are reset to 1 at each chapter start!
Did you also give the variable an ID? For instance, the auto-number format for my figures is:

Code: Select all

p.captionFig
{
	margin-bottom: 12pt;
	page-break-before: avoid;
	mc-auto-number-format: 'GF:Figure {n+}: ';
	font-size: 9pt;
	margin-top: 3pt;
}
The "G" sets it to be a global counter, the "F" is the ID for this sequence, "Figure" is the text that's automatically inserted before the auto-number, and "{n+}" is the incremental numbering, and I have a colon and a space being added automatically after the numbering. So my results will be Figure 1: Text, Figure 2: More Text, etc. (coloring added for emphasis).

If you don't use the "G" then it'll reset to 1 every time you use the sequence, and if you don't give it an ID, then it doesn't realize that it's the same sequence. The class name (p.captionFig) isn't what tells it that it's part of the same sequence -- the ID (in this case, F) is what identifies it as the same sequence. The reason why it does that is that you might want to have a p.captionFigCntr that centers the caption and a p.captionFigRight that aligns the caption to the right. So you have two different classes but they both have the same mc-auto-number-format, so the numbers will be sequential, regardless of which paragraph class you use.

Long story short, I think you were leaving off the ID character in your format (and the G for global counter). Just make sure your ID isn't a G or a C, since those are the characters reserved for indicating a global counter and a chapter counter, respectively. (Although that's an assumption on my part that you shouldn't use those characters for the ID, but it seems logical.) So you could have 24 different formatting sequences in your project (26 minus 2 reserved characters).
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Eric Lachance
Sr. Propeller Head
Posts: 127
Joined: Thu May 13, 2010 11:51 am
Location: Montreal, Quebec, Canada
Contact:

Re: Auto-Numbering for figures using {Gn+} or {n+} fails.

Post by Eric Lachance »

Hmn .

That didn't seem to work. I just added GF: at the beginning:

Code: Select all

	p.screenshot span
	{
		mc-auto-number-format: 'GF:Figure {n+} : ';
	}
And it didn't work after putting back the new chapter checkmark.

Here's the HTML (perhaps putting this inside a <span> which is inside a <p> causes this? I hope not!)

Code: Select all

        <p class="screenshot">
            <img src="Resources/Images/Screenshots/Screen_Part_Printing_ChooseProject.png" />
            <br /><span>Choose a project file from your existing projects.</span>
        </p>
Eric Lachance
Technical Trainer
Objectif Lune Inc.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Auto-Numbering for figures using {Gn+} or {n+} fails.

Post by LTinker68 »

Apparently it doesn't like anything between the parent tag and the start of the auto-number tag. If you remove the image and the soft line break then it'll work. Try putting the auto-number style into its own paragraph. I have a p.screenshots and a p.captionFig in my stylesheet. My normal paragraph tag has a margin-bottom of 12pt but the p.screenshots class has a margin-bottom of 0, so the p.screenshots is the container tag for the image and it's followed by p.captionFig, which is the container tag for the auto-number format. The page-break-before:avoid on the p.captionFig keeps it from being separated from the screenshot in the preceding paragraph, but you could put the two paragraphs in a div class with page-break-inside set to avoid, if you prefer.

So my topic code may look something like:

Code: Select all

<p class="screenshots">
     <img src="../../Resources/Images/cables.png" title="Bottom (left) and Top (right) View of Connector" />
</p>
<p class="captionFig" MadCap:autonum="Figure 1: ">Bottom (left) and Top (right) View of Connector</p>
Note that the Figure 1 shown above is a temporary placeholder in the authoring environment -- when the output is built, the appropriate figure number is inserted.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Eric Lachance
Sr. Propeller Head
Posts: 127
Joined: Thu May 13, 2010 11:51 am
Location: Montreal, Quebec, Canada
Contact:

Re: Auto-Numbering for figures using {Gn+} or {n+} fails.

Post by Eric Lachance »

Thanks Lisa,

I'll report this as a bug I guess. In the meantime your code works, so I'll use that.

:)
Eric Lachance
Technical Trainer
Objectif Lune Inc.
wbrisett
Sr. Propeller Head
Posts: 216
Joined: Mon Oct 05, 2009 3:29 pm
Location: Austin, TX

Re: Auto-Numbering for figures using {Gn+} or {n+} fails.

Post by wbrisett »

I'll have to play with this a bit today. I suspect this may be what's causing my autonumber format not to work correctly. MadCap has some samples I gave them a few days ago, but I haven't heard back yet.

Wayne
Post Reply