Autonumbering in paragraphs tracing heading number

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
daicehawk
Propeller Head
Posts: 23
Joined: Mon May 17, 2010 1:22 pm

Autonumbering in paragraphs tracing heading number

Post by daicehawk »

I am not sure if this has not been covered in existing topics, I could not find the answer at least.
I want my paragraphs to be numbered according to the heading auto-number without having to implement and apply different paragraph classes so it looks like this:

1. Heading 1st level
1.2 Heading 2nd level
1.2.1 Paragraph
1.2.2 Paragraph
1.2.3 Heading 3rd level
1.2.3.1 Paragraph

The idea is that paragraph "traces" the heading auto-number, and the next heading "traces" the previous paragraph auto-number, when an according heading style is selected.
Sorry for my English, I am not a native speaker.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Autonumbering in paragraphs tracing heading number

Post by LTinker68 »

The auto-number formats would look something like the following (only the auto-number format is shown, not the rest of the styles that you might specify for a tag). There are two sets of paragraph tags, depending on if the paragraph is following an h1 tag or an h2 tag. You could do another paragraph class if you needed to go to a fourth level following an h3 tag. The "G" means it's a global counter. The "N" is the "ID" of the number sequence that ties all the tags together.

Code: Select all

h1 {
    mc-auto-number-format: 'GN:{n+}. ';
}
h2
{
    mc-auto-number-format: 'GN:{n}.{n+} ';
}
h3
{
    mc-auto-number-format: 'GN:{n}.{n}.{n+} ';
}

p.paraSecondLevel
{
    mc-auto-number-format: 'GN:{n}.{n+} ';
}

p.paraThirdLevel
{
    mc-auto-number-format: 'GN:{n}.{n}.{n+} ';
}
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
daicehawk
Propeller Head
Posts: 23
Joined: Mon May 17, 2010 1:22 pm

Re: Autonumbering in paragraphs tracing heading number

Post by daicehawk »

This way of autonumbering I know. I meant an "automatic" autonumbering of headings and paragraphs in "interaction" so one does not have to apply corresponding paragraph level styles manually.
The idea is that:
1. <p> following the heading would check the autonumber of the heading above heading and add ".{n+}" to its auto-number;
Example
1. Heading
1.1 Paragraph
......
2.3. Heading
2.3.1. Paragraph

2. The next heading checks the previous heading level, if the previous level is higher (<h3> follows after <h2>), then the next heading "inherits" the last paragraph format.

Example
2.1 Heading
2.1.1 Paragraph
2.1.2 Paragraph
2.1.3 Heading.

It would be great to implement this to work automatically since for now any heading level change requires manual re-applying of corresponding paragraph style.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Autonumbering in paragraphs tracing heading number

Post by LTinker68 »

Best you can do is specify that StyleB always follows StyleA, similar to what you can do in Word. You'd still have to use the auto-numbering because that controls the sequence format. But you could set it up so that h2 always follows h1 and p.paraLevelThree always follows h2. You'd still be able to override the following style if it doesn't apply to a particular topic.

See this post for more info on setting up the "style after" automation: http://forums.madcapsoftware.com/viewto ... t=0#p44018
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Post Reply