Autonumbering - Confused

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
helen
Sr. Propeller Head
Posts: 276
Joined: Thu Oct 25, 2007 5:57 am
Location: Manchester, UK

Autonumbering - Confused

Post by helen »

Morning

I'm having a few problems with autonumbering - how I think it should work isn't how it's working and whilst I accept I'm probably wrong, I'm can't solve the problem. I'm using a Word target and I would like H1-4 for this document. The topics and the headings are mirrored in the TOC layout although I don't have the option to use the TOC levels for my headings switched on (although I think I'll try that too).

Here's what I have currently:
H1 Chapter {Gn+}
H2 {Gn}.{Cn+}
H3 (Gn}.{Cn}.{n+}

What this is doing in my printed TOC is:

Chapter 1
1.1
1.1.1
1.1.1
1.1.1
1.2
1.2.1
1.2.1
1.2.1
1.3

You get the idea. Obviously my {n+} isn't doing what I want it to do - but if I put my H3 topics into the same topic as the H2 topics, it works as intented. However as I want my project topic-centric, I like my individual topics and would prefer to keep them.

I would also like a H4 style - but I'm not even going to attempt that until my H3 is working. It's user error, but I'm currently clicking buttons, trying to start new chapters, new sections without being entirely sure what does what - hence I've got to this place of confusion.

Can someone put me on the path to enlightenment please? I've tried the help but I've ended up even more confused because I'm missing something blindingly obvious :)
helen
Sr. Propeller Head
Posts: 276
Joined: Thu Oct 25, 2007 5:57 am
Location: Manchester, UK

Re: Autonumbering - Confused

Post by helen »

Okay I got it working by setting my H3 style to "{Gn}.{Cn}.{Gn+}"

Why does that work? :(
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Autonumbering - Confused

Post by KevinDAmery »

I think it's because of the number sequence definitions. Since you've defined those inside the number selector, you need one in all of them.

Also, I think you're going to get into a confused situation with the second number, since it's not using the same number sequence as the others (it's using C instead of G like the others). You could end up with a number sequence like this:

Chapter 1
1.1
1.1.1
1.2
Chapter 2
2.3
2.3.1

Here's the way I have mine set up:

Code: Select all

h1
{
	mc-auto-number-format: 'a:{n+}.{ =0}0 { =0}{ =0}';
}

h2
{
	mc-auto-number-format: 'a:{n}.{n+} { =0}{ =0}';
}
h3
{
	mc-auto-number-format: 'a:{n}.{n}.{n}.{n+} ';
}
The { =0} entries reset the numbering for subordinate headings. The a: defines the number sequence.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
helen
Sr. Propeller Head
Posts: 276
Joined: Thu Oct 25, 2007 5:57 am
Location: Manchester, UK

Re: Autonumbering - Confused

Post by helen »

KevinDAmery wrote:Also, I think you're going to get into a confused situation with the second number, since it's not using the same number sequence as the others
I think I have some kind of inbuilt mechanism to be utterly confused by autonumbering numbering due to the years of pain from Word that I haven't been able to shake off yet. Hence I'm definitely making this far more complicated than it actually needs to be. Thanks for the code snippet, I'm going to insert that into my project today and have a play with it. I got mine working in the end for H1-4 but I've used Gn, secnum, n and all sorts. :roll:

Thanks :D
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Autonumbering - Confused

Post by KevinDAmery »

Just as a clarification on the code snippet, for my purposes I have my H1s appearing a 1.0, 2.0, etc. Since you want Chapter 1 (without a following 0) you would want the H1 style to look like this:

Code: Select all

mc-auto-number-format: 'a:{n+}{ =0}{ =0}{ =0}';


HTH.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
siskamoens
Propeller Head
Posts: 85
Joined: Wed Mar 21, 2007 3:01 am
Location: Belgium
Contact:

Re: Autonumbering - Confused

Post by siskamoens »

What does the a: stand for?
helen
Sr. Propeller Head
Posts: 276
Joined: Thu Oct 25, 2007 5:57 am
Location: Manchester, UK

Re: Autonumbering - Confused

Post by helen »

Hey, I've not been "playing" with autonumbering for a while but I've just had a chance to try the above set up but it didn't work. I got this:

1.0
0.1
0.1
0.1
1.0
0.1
0.0.0.1
0.0.0.1

I then tweaked my H3 so it had 3 numbers in and messed it up even further.

I've tried the examples in the online help that claim to give me the output I want and they don't work either. My headings 2 never count up and my headings 3 just don't want to know. (You are here: Features > Auto-Numbers > Auto-Number Format Examples)

I appear to be able to get different results depending on which checkboxes I set on the property of my TOC items (sections and chapters) which I mostly understand (but not in relation to automnumbering) - however the only way I can currently get my numbering to behave involves {Gn}, {Cn} and {n} in various combinations. This obviously is far from ideal. Sorry, I just don't seem to grasp this, can anyone help me please? (again) :roll:
siskamoens
Propeller Head
Posts: 85
Joined: Wed Mar 21, 2007 3:01 am
Location: Belgium
Contact:

Re: Autonumbering - Confused

Post by siskamoens »

Hi Helen,

I am confused too, trust me :-)

The styles I'm using now are:
H1: mc-auto-number-format: 'a:{secnum}. { =0}{ =0}{ =0}';
H2: mc-auto-number-format: 'a:{secnum}.{chapnum}. { =0}{ =0}';
H3: mc-auto-number-format: 'a:{secnum}.{chapnum}.{n+}. ';

with section breaks on every H1 and chapter breaks on every H2 topic plus the section numbering format set to capitals (A,B,C,...),

and this is what I get in Word:

A. References
A.1. Working with References
A.1.1. Reference Attributes
A.2. Reference Types
A.2.1. Catch references
A.2.1. Code References

As you can see the numbering done with secnum and chapnum works fine, but the incremental "N+" does NOT increment at all.
I tried the above styles without the "a:" addition, and without the { =0}{ =0} suffixes, but that gave me exactly the same result.

Madcap guys: I think this is an area in the documentation that really needs more detail, and more examples. Seems like a lot of people are not grasping the way you intended this feature to be used...

Siska
helen
Sr. Propeller Head
Posts: 276
Joined: Thu Oct 25, 2007 5:57 am
Location: Manchester, UK

Re: Autonumbering - Confused

Post by helen »

That's comforting to know (although perhaps not for you)!

I too can get the results I want if I use the chapter and section options on the Properties of my TOC entries but the {n+} just won't do what I think it should do. I've made a tiny Project now to play with; hopefully when the USA wakes up someone will be along with the missing jigsaw pieces (or at least get them from under the sofa). :wink:
helen
Sr. Propeller Head
Posts: 276
Joined: Thu Oct 25, 2007 5:57 am
Location: Manchester, UK

Re: Autonumbering - Confused

Post by helen »

If it helps, I used these from the online Help as it appeared to be what I wanted to do:

A:{n+}.{ =0}
A:{n}.{n+}
A:{n}.{n}.{n+}

And I got this.. :!:

1.
0.1
0.1
0.1
1.
0.1
0.0.1
0.0.1
0.1
0.0.1
0.0.1


Edit: This topic is sounding very familiar to me http://forums.madcapsoftware.com/viewto ... umbering+n

I've got exactely the same symptoms. I have H1 - H5 header declarations in my @media with no autonumber formatting and in my @print with the following autonumbering declarations (stolen from the other post):

h1 { mc-auto-number-format: 'a:{n}. {=0} {=0} {=0} {=0}';}
h2 { mc-auto-number-format: 'a:{n}.{n+}. {=0} {=0} {=0}';}
h3 { mc-auto-number-format: 'a:{n}.{n}.{n+} {=0} {=0}';}
h4 { mc-auto-number-format: 'a:{n}.{n}.{n}.{n+} {=0}';}
h5 { mc-auto-number-format: 'a:{n}.{n}.{n}.{n}.{n+}';}

That is my only H1-H5 declarations and my Word Output is set to Print media. I'm going to try with a blank project now to see what I get.... None of my print master pages are doing anything with the "H1" either. Back to the drawing board.

In my test Project I have the same problem. No master pages, nothing clever, just that H1-5 declaration in @print. In my main project I'm using the TOC level to define my headings, I think I've eliminated this as being the cause as it doesn't make any difference in my test project. I think hunting down user error is far harder than hunting down bugs! :(
Last edited by helen on Wed May 21, 2008 3:49 am, edited 1 time in total.
helen
Sr. Propeller Head
Posts: 276
Joined: Thu Oct 25, 2007 5:57 am
Location: Manchester, UK

Re: Autonumbering - Confused

Post by helen »

This is what I thought it would do too. Perhaps that's the problem, it's just not how it's supposed to be used. As I want to use the TOC to generate my Word documentation, what would be the best way to proceed? All my stuff is topic-centric and depending on the output type (print or chm) I want to have different headers, hence I use the stylesheet for my non-print and the TOC for my print.

I need the autonumbering to reflect the levels in my TOC when publishing to Word. I rarely have multiple Headings (at the higher levels) in the same topic so I need a way for the Headings to behave as Jason has stated below.

Can this be done? Can anyone tell me what my options are please? I'm feeling a little lost if it doesn't behave like this :(

From: http://forums.madcapsoftware.com/viewto ... f=6&t=5971

If you don't have multiple headings in the same topic it is not irrelevant, not to me anyhow!
wvnomad wrote: Maybe it is irrelevant without the multiple H tags in one topic. In my help system, each topic has its own H tag, so my TOC would look like this:

Top level Book - H1
Book - H2
Topic - H3
Topic - H3
Book - H3
Topic - H4
Topic - H4
Book - H4
Topic - H5

I thought that the autonumbering would "roll up" to the previous heading level even if it was not in the same topic. Apparently, this is not the case.
Jason
wclass
Propellus Maximus
Posts: 1238
Joined: Mon Feb 27, 2006 5:56 am
Location: Melbourne, Australia

Re: Autonumbering - Confused

Post by wclass »

Autonumbering - one more view

The thing that confused me for a while was what is a label and what is a counter. When I sorted that I got stuff to work. Here is my scenario:
  • I want heading levels 1-3 to have numbers (1., 1.1, 1.1.1)
  • I don't have any special sections or chapters or volumes, or appendices, so I don't have to set anything in the TOC.
  • I want each new H1 starting a new number, I DON'T want to restart at 1 for each topic in the output.
This means I want a "global" counting system (as opposed to chapter, section counting).

So I set my heading styles, for my print medium as follows:

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

The "GH" is the label I made up to represent Global Headings, and it ties the h1, h2, h3 together.
The "n" is used as the counter. The default value of "n" is 0, so I start in h1 by incrementing it "{n+}" every time I encounter a h1 style. I don't need a Gn counter unless I want to do some fancy numbering and resetting.
The "=0" resets the counter at that position.

My output, which is generated from many different topics, looks like:

1. This is the first heading
1.1 And a sub-heading

2. And a new major heading
2.1 With several sub-heads
2.2 Like This
2.2.1 And a level 3 heading just for good luck.

Come back next week and we'll do Chapters!
Margaret Hassall - Melbourne
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Autonumbering - Confused

Post by KevinDAmery »

Ok, the 'a' basically names the numbering sequence. You could have multiple sequences running at the same time if you wanted, and as long as each sequence had a different letter name they would not conflict with one another. Having said that, I honestly don't know how that works with Secnum and Chapnum, so that may be part of why the results are wonky.

Other than that, not sure what to suggest: what I have in my @print is as posted earlier, and it's working according to plan. I start each topic with an H1, and the rest of the headings in the topic follow their numbering along accordingly.

(For the record, I'm not attempting to make my documentation look like a traditional manual, so each topic essentially is a chapter. I can do this because the print output is really only for the owner to do show-and-tell when he visits customers: end users receive our documentation purely as online help. Since our product is hosted by us rather than installed on an end user's system, this makes the most sense.)
Until next time....
Image
Kevin Amery
Certified MAD for Flare
helen
Sr. Propeller Head
Posts: 276
Joined: Thu Oct 25, 2007 5:57 am
Location: Manchester, UK

Re: Autonumbering - Confused

Post by helen »

Awesome!! Thank you Margaret! :D

That works, and so my understanding improves - Global, never thought of that :oops: . I'll just go and remove all my fudged attempts now and tidy up my poor abused stylesheet. :lol:

*makes a note in her diary to be back next week for Chapters* :P
helen
Sr. Propeller Head
Posts: 276
Joined: Thu Oct 25, 2007 5:57 am
Location: Manchester, UK

Re: Autonumbering - Confused

Post by helen »

KevinDAmery wrote:Ok, the 'a' basically names the numbering sequence. You could have multiple sequences running at the same time if you wanted, and as long as each sequence had a different letter name they would not conflict with one another. Having said that, I honestly don't know how that works with Secnum and Chapnum, so that may be part of why the results are wonky.

Other than that, not sure what to suggest: what I have in my @print is as posted earlier, and it's working according to plan. I start each topic with an H1, and the rest of the headings in the topic follow their numbering along accordingly.

(For the record, I'm not attempting to make my documentation look like a traditional manual, so each topic essentially is a chapter. I can do this because the print output is really only for the owner to do show-and-tell when he visits customers: end users receive our documentation purely as online help. Since our product is hosted by us rather than installed on an end user's system, this makes the most sense.)
Thanks for your reply Kevin. I've learnt an aweful lot today and the use of the Global numbering sequence has fixed my TOC numbering perfectly. I understand why it wasn't working before now too. Strangely the only reason I wanted to get all the content in a Word document is I'm out of the office for 2 weeks and I'd like to proof read it for a break! Thanks again :D
siskamoens
Propeller Head
Posts: 85
Joined: Wed Mar 21, 2007 3:01 am
Location: Belgium
Contact:

Re: Autonumbering - Confused

Post by siskamoens »

Woohoo, it finally works!

Apparently the n+ and Cn+ increments fail when you combine them with the secnum and chapnum arguments. It seems to be better to leave those out of autonumbering schemes for headings and go for the (much simpler) global numbering scheme instead.

I'm using the same autonumbering strings as Margaret now, and my heading numbers are fine. Thanks!
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Autonumbering - Confused

Post by KevinDAmery »

Glad it's working.

If you could report your findings regarding chapnum and secnum when used with global numbering schemes, that'd be great (maybe Madcap will fix it....)

http://www.madcapsoftware.com/bugs/submit.aspx
Until next time....
Image
Kevin Amery
Certified MAD for Flare
siskamoens
Propeller Head
Posts: 85
Joined: Wed Mar 21, 2007 3:01 am
Location: Belgium
Contact:

Re: Autonumbering - Confused

Post by siskamoens »

Don't worry, I already did :-)
hemalpatel19
Jr. Propeller Head
Posts: 4
Joined: Fri Nov 14, 2008 5:52 am

Re: Autonumbering - Confused

Post by hemalpatel19 »

Hi,

I am looking for a very simple output in my word document.

It is something like this.

1. XYZ
2. ABC
2.1 abcdefg
2.2 abcdefg
2.3 abcdefg
3. sdfsd
4. dsfdsf

I tried both i.e. auto number feature as well as Format - List - NumberedList menu option. None of it works.

How do i get this? I read entire replies posted in this section, but all dealt only with headings i.e. H1,2,3 etc., i am not looking for this headings. I want to implement this only within the document content.

Please help as i am completely bugged by now with this auto-number as well as a menu of Format - List - NumberedList option.
Hemal Patel
Technical Writer
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Autonumbering - Confused

Post by KevinDAmery »

You would use exactly the same methods as described in the other threads for headings, only instead you would do it to classes of either the li or p tags (depending on how you want to handle it). The methods for auto numbering don't change from one tag type to another.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
hemalpatel19
Jr. Propeller Head
Posts: 4
Joined: Fri Nov 14, 2008 5:52 am

Re: Autonumbering - Confused

Post by hemalpatel19 »

Thanks Kevin.
Hemal Patel
Technical Writer
wclass
Propellus Maximus
Posts: 1238
Joined: Mon Feb 27, 2006 5:56 am
Location: Melbourne, Australia

Re: Autonumbering - Confused

Post by wclass »

If you want to have nested numbering just within a topic, I do it almost the same but not quite. For the heading numbering, we set it to "gloabal" so that it would continue across the final output no matter what topic is was in. For paragraph level numbering you probably don't need the "global" approach. Have a look at this code:

Code: Select all

p.nums1 { 
	mc-auto-number-format: 'P:{n+}.{ =0}{ =0} ';
	margin-left: 10px; }
p.nums2 { 
	mc-auto-number-format: 'P:{n}.{n+} { =0} ';
	margin-left: 30px; }
p.nums3 { 
	mc-auto-number-format: 'P:{n}.{n}.{n+} ';
	margin-left: 50px; }
	
p.nums1restart { 
	mc-auto-number-format: 'P:{n=1}.{ =0}{ =0} ';
	margin-left: 10px; }
I used the tag "P" here to link all the paragraph numbers together. If you do want it continue across topics, you'll need to put a "G" in front of every "P".
If you have more than one nested list in a topic, you might need to "restart" it.

I've included indentation in the styles (margin-left) to make it more obvious, but you might want to change this yourself. I apply the styles to ordinary paragraphs in a topic - there are no "lists" used.
Margaret Hassall - Melbourne
Post Reply