Nested Topic Autonumbers

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
rjn572
Propeller Head
Posts: 59
Joined: Mon Jun 02, 2014 9:22 am
Location: UK

Nested Topic Autonumbers

Post by rjn572 »

I have several Flare projects that use basic Topic = Chapter etc for printed output.

For the first time I tried nesting some topics within another topic (in the TOC).

e.g. I have:
Topic 1 (chapter Break) H1, H2
Topic a (none) H2
Topic b (none) H2

In my PDF output the H2s in the nested topics are not following on from Topic 1

e.g

Topic 1
2. Introduction
2.1 Scope
2.2 Purpose

Topic a
2.1 Test (this should of course be 2.3)

I've tried everything I can think of to get the auto numbers in the nested topics to continue and I'm sure it's something simple!

Thanks for any pointers.
SteveS
Senior Propellus Maximus
Posts: 2090
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
Contact:

Re: Nested Topic Autonumbers

Post by SteveS »

There are a lot of topics on the forum relating to multilevel autonumbering...

However, to get the ball rolling:

You can create geneic styles for .NewList, .FirstLevel, .NextLevel and so on.

Code: Select all

.NewList
{
    mc-auto-number-format: 'A:{n=1}.0 ';
} 
.FirstLevel
{
    mc-auto-number-format: 'A:{n+}.0 ';
}
.NextLevel
{
    margin-left: 5em;
    mc-auto-number-format: 'A:{n}.{n+} ';
}
Applying the appropriate styles will produce the following:
MultiLevelAutoNumber.png
HTH
You do not have the required permissions to view the files attached to this post.
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
Nita Beck
Senior Propellus Maximus
Posts: 3672
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Nested Topic Autonumbers

Post by Nita Beck »

Is the original poster asking about lists or headings? Seems to me he/she is asking about auto-numbered headings...
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
rjn572
Propeller Head
Posts: 59
Joined: Mon Jun 02, 2014 9:22 am
Location: UK

Re: Nested Topic Autonumbers

Post by rjn572 »

I'm talking about Headings Lisa (H1, H2). This may explain things a little simpler:

My headings are configured:
H1: {chapnum}
H2: {chapnum}.{n+}

Up to now all of my Topics have started with a H1 and Chapter Break in TOC with no problems.
The problem occurs when a new topic doesn't contain a H1 and starts with a H2. The H2 in the new topic picks up the previous H1 but restarts the H2 sequence:

e.g. In the PDF I am getting:

Topic 1
2. Introduction
2.1 Scope
2.2 Purpose

Topic 2 (no H1)
2.1 Test (this should of course be 2.3)
SteveS
Senior Propellus Maximus
Posts: 2090
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
Contact:

Re: Nested Topic Autonumbers

Post by SteveS »

Nita Beck wrote:Is the original poster asking about lists or headings? Seems to me he/she is asking about auto-numbered headings...
That's the beauty of generic styles.

In this case you can assign your heading level, than use the generic autonumber style to apply the numbering:
MultiLevelAutoNumberHeadings (1).png
HTH
You do not have the required permissions to view the files attached to this post.
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
rjn572
Propeller Head
Posts: 59
Joined: Mon Jun 02, 2014 9:22 am
Location: UK

Re: Nested Topic Autonumbers

Post by rjn572 »

So for example if I have a project with 500 topics and I have 20 TOCS that I want to include a multitude of the 500 topics, each one starting with a H1:
H1: {chapnum}
and the remaining topics following on with H2s:
H2: {chapnum}.{n+}

Can you tell me how I'd configure these styles please?

I'd like to end up with:

Topic 1
H1 "Section 1 - Introduction
H2 1.1 ...
H2 1.2 ...

Topic 2
H2 1.3 ...

Topic 3
H2 1.4 ...

Many thanks.
SteveS
Senior Propellus Maximus
Posts: 2090
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
Contact:

Re: Nested Topic Autonumbers

Post by SteveS »

rjn572 wrote:I'm talking about Headings Lisa (H1, H2). This may explain things a little simpler:

My headings are configured:
H1: {chapnum}
H2: {chapnum}.{n+}

Up to now all of my Topics have started with a H1 and Chapter Break in TOC with no problems.
The problem occurs when a new topic doesn't contain a H1 and starts with a H2. The H2 in the new topic picks up the previous H1 but restarts the H2 sequence:

e.g. In the PDF I am getting:

Topic 1
2. Introduction
2.1 Scope
2.2 Purpose

Topic 2 (no H1)
2.1 Test (this should of course be 2.3)
Do you have a chapter break between Topic 1 and Topic 2? Is your example correct - should topic 1 have the number 2 for the chapter number? I'm trying to get my head around what you're getting at the moment...
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
rjn572
Propeller Head
Posts: 59
Joined: Mon Jun 02, 2014 9:22 am
Location: UK

Re: Nested Topic Autonumbers

Post by rjn572 »

Hi Steve,
I don't have a Chapter break set on the Topics.
The H2s are using the same stream as the H1.

As a background, this project will contain hundreds of small topics.
I'd like to be able to quickly create a TOC, pull in say 10 topics, Give the first topic a H1 heading and the remaining topics will have H2 headings that should flow (pdf output).

The problem I have is that the H2 resets on every new topic. I understand I may have to use a separate stream on the H2s, eg "CA", I've tried playing around but cannot get it to work.
emsachs
Propeller Head
Posts: 91
Joined: Wed Nov 19, 2014 12:49 pm

Re: Nested Topic Autonumbers

Post by emsachs »

Actually your numbers should be in the same stream.
You have:
H1: {chapnum}
H2: {chapnum}.{n+}

The H1 and H2 tell them they are in different numbering streams and shouldn't be paying attention to each other.

You want something like:
CH: {chapnum}
CH: {chapnum}.{n+}

Where the prefix is the same for both. then they know they are related.
SteveS
Senior Propellus Maximus
Posts: 2090
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
Contact:

Re: Nested Topic Autonumbers

Post by SteveS »

OK.

You need to have a trigger for restarting the top level of numbering, the nested level is triggered by the upper level. If you are using chapnum you will need to use the TOC properties to set the start of each chapter.

The other issue is autonumbers are topic based by default. If you want to number across multiple topics you will need to set the number as global {Gn}.

This stylesheet works, and doesn't rely on chapters (I think chapters might become confusing in the scenario you provided):

Code: Select all

.NewList
{
    mc-auto-number-format: 'A:{Gn=1}.0 ';
} 
.FirstLevel
{
    mc-auto-number-format: 'A:{Gn+}.0 ';
}
.NextLevel
{
    margin-left: 5em;
    mc-auto-number-format: 'A:{Gn}.{Gn+} ';
}
The A is the number series. You could create multiple autonumber sequences by using a different identifier. This helps if you have numbered figures, illustrations, tables etc. Because I've used a generic style for the number it can be applied to any element. If, for example, you wanted a paragraph included in the sequence you can just apply the .FirstLevel or .NextLevel to add it to the sequence.

HTH
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
rjn572
Propeller Head
Posts: 59
Joined: Mon Jun 02, 2014 9:22 am
Location: UK

Re: Nested Topic Autonumbers

Post by rjn572 »

Sorry emachs, I added a bit of confusion in my last post.

I am actually using the same stream as you suggest:
CH:{chapnum} = H1.Heading1
CH:{chapnum}.{n+} = H2.Heading2

In the stylesheet they are setup as as H1.Heading1 and H2.Heading2

All work fine in my current projects where each topic starts with a Heading 1 and Heading 2s flow as expected.
It's only when I have a new topic starting with a Heading 2 that it doesn't flow from the previous Heading 2 in the previous topic.

I will have another play around and see if I get any further.
Thanks for all your help to date.
rjn572
Propeller Head
Posts: 59
Joined: Mon Jun 02, 2014 9:22 am
Location: UK

Re: Nested Topic Autonumbers

Post by rjn572 »

Finally solved.
Have to hold my head down in shame and say that I was inserting the CH: stream into the non-print medium!
I discovered that:

Using
{chapnum} for Heading 1
{chapnum}.{n+} Heading 2
The Heading 2's would not increment in following topics (that start with an Heading 2)

Using
CH:{chapnum} for Heading 1
CH:{chapnum}.{n+} Heading 2
The Heading 2's DO increment in following topics (that start with an Heading 2)

Many thanks for your help.
SteveS
Senior Propellus Maximus
Posts: 2090
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
Contact:

Re: Nested Topic Autonumbers

Post by SteveS »

Dam you, non-print medium!

I always check the stylesheet in a text editor if something doesn't seem to be working. That quickly identifies styles assigned to specific media :wink:
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
Post Reply