CSS autonumbering

This forum is for all Flare issues not related to any of the other categories.
Post Reply
DoTheWriteThing
Propeller Head
Posts: 27
Joined: Mon May 14, 2018 6:21 am

CSS autonumbering

Post by DoTheWriteThing »

Hi everyone, I'm using CSS to automatically number my images (see below) but some of the images have links wrapped around them, so actually I want the Figure + number inserted after the link, in those cases, is there any way to do this?
body
{

counter-reset: figure; /* set a counter called figure to autonumber figures */

}
img::after {
counter-increment: figure;
content: "Figure " counter(figure) ": ";
}
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: CSS autonumbering

Post by Nita Beck »

I'm sorry that I actually don't have an answer for your specific question, given how you've crafted your CSS for figure titles.

In case you're interested, many of us use Flare auto-numbers for our figure (and table) title numbering, defined as part of a p.FigureTitle style. Yes, one has to manually enter a new paragraph after the image and then apply the p.FigureTitle style to it, but I still think it's an easier solution. Plus, if one wants to be able to cross-reference to a figure (or table) title, the way to do that is to insert a bookmark in the p.FigureTitle block to which one can then point an xref. Not sure how you'd accomplish xrefs to fig titles with your CSS solution.

Anyway, here are examples of various kinds of auto-number formats, including for figure titles: https://help.madcapsoftware.com/flare20 ... amples.htm.

An overview on xref-ing to figure titles is included in this topic: https://help.madcapsoftware.com/flare20 ... rences.htm

If none of these ideas appeal to you, sorry that I took you down the garden path, and sorry that I don't know how to get you where you want to go purely through your CSS solution.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
DoTheWriteThing
Propeller Head
Posts: 27
Joined: Mon May 14, 2018 6:21 am

Re: CSS autonumbering

Post by DoTheWriteThing »

Thank you Nita this is very helpful.
SandraF
Propeller Head
Posts: 11
Joined: Mon May 06, 2019 1:55 pm

CSS autonumbering with cross-references

Post by SandraF »

Hello, I realize this isn't the original purpose of the thread but it seemed closely related, so I thought it might be better than starting a new one. My apologies if it wasn't.

I have been using the figure autonumbering formula provided by Flare that Nita refers to here, CF: FIGURE {chapnum}-{n+}:.

The auto-numbering works fine, but I'm finding, naturally, that when I insert a cross-reference to a figure, it includes the colon. Is there a way to get it to just include the autonumber?
(With or without the word Figure - I can adjust either way; it's the colon that bothers me because it seems like a workaround for that would be more trouble than simply adding or deleting a word . . . In other words I'd be fine with solutions that stripped out the autonumber formatting from the cross-reference. I think. :) )

I realize I could solve my problem by removing the colon from the original formula, but I was hoping that wasn't my only option because I do like it in the actual figure number, just not in the cross references!
Thank you very much in advance,
Sandy
Post Reply