AutoNumbering Issue...

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
jjdave
Propeller Head
Posts: 23
Joined: Thu Nov 09, 2017 12:46 pm

AutoNumbering Issue...

Post by jjdave »

Hi All,

As shown in the image below, I have three Auto-Number Formats.
Format A: 1.1..........Format B: 1.1.1...........Format C: NOTE
Capture.PNG
After Format B: 1.1.2, I added Format C: NOTE.
Now, I like to continue with Format B again at 1.1.3, but instead my Auto Number is reset to 1.0.1


This is Nested Auto-Number problem, can anyone point to possible solution for this.
Thank You.
You do not have the required permissions to view the files attached to this post.
SteveS
Senior Propellus Maximus
Posts: 2087
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: AutoNumbering Issue...

Post by SteveS »

Are you using C as a variable in your autonumber format?

It seems as if the second level of autonumber is being reset (OK, it is). This can happen if it is a chapter level variable. It doesn't seem logical for you to have added a chapter break mid topic, so something else is resetting the counter. So I'd be looking for something setting C=0. I notice you are calling the third lot of autonumber C so it started me wondering...
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
jjdave
Propeller Head
Posts: 23
Joined: Thu Nov 09, 2017 12:46 pm

Re: AutoNumbering Issue...

Post by jjdave »

Hello Steve,

Appreciate your response. Also, your understanding is Spot On.

Here is little more detail on settings.
Chapter #:..........1......................mc-auto-number-format: '{n+}';
Format A:...........1.1...................mc-auto-number-format: '{n}.{n+}';
Format B:...........1.1.1................ mc-auto-number-format: '{n}.{n}.{n+}';
Format C:...........NOTE................mc-auto-number-format: 'NOTE:';

Easy Fix: I can easily remove Format C, and then type-in NOTE myself every time I use this Style, see image (right side).
Can you suggest an alternative where I can use Style which automatically prints word NOTE (or any other Prefix) and then I can just type-in my text?
Capture.PNG
so something else is resetting the counter. So I'd be looking for something setting C=0. I notice you are calling the third lot of autonumber C so it started me wondering...
Correct, Format C, can be used at any level (after Format A or Format B), so setting C=0 would create a problem for Auto Numbers, at any level, see image (left side).
There has to be a way to assign an Auto Number to tag such as NOTE, so it does not interfere with any Heading Levels (such as Format A or Format B, in this case).

Once again, Thank You for your Help.
You do not have the required permissions to view the files attached to this post.
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: AutoNumbering Issue...

Post by doc_guy »

I've tested this in TopNav and in PDF targets, and I think the solution is to not use mc-auto-number-format for your note text. Instead, you can use the :before pseudo-selector:

Code: Select all

p.note:before {
     content: "Note: ";
     color: #000;
     font-weight:bold;
}
I modified it to test that it was working, using this:

Code: Select all

p.note:before {
     content: "This is very important: ";
     color: blue;
     font-weight:bold;
}
And this is what I saw in the editor and the output:

PDF output:
Image

Editor/Preview:
Image
Paul Pehrson
My Blog

Image
jjdave
Propeller Head
Posts: 23
Joined: Thu Nov 09, 2017 12:46 pm

Re: AutoNumbering Issue...

Post by jjdave »

Hello Doc Guy,

Appreciate your response.
I think the solution is to not use mc-auto-number-format for your note text. Instead, you can use the :before pseudo-selector
This will definitely solve my problem. Thanks so much for this solution.

One more question, looking at images in my previous post:
I have Style for NOTE (Format C) which is set to align Left side of the page, at Left-align = 0px.
Is there a way to use my NOTE style and indent it at 50px, 100px or do I need to create a new style for every indentation?

Thanks so much, your suggestion along with help from Steve have definitely solved my problem.
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: AutoNumbering Issue...

Post by doc_guy »

Typically I recommend to people that they create a generic div.indent style. and have that style have a margin-left of 100px (or 50px) or whatever you want the indent to be.

Then, to indent multiple times, you just layer multiple divs.

Code: Select all

<div class="indent">
   <p class="note">This is indented one time</p>
</div>

Code: Select all

<div class="indent">
    <div class="indent">
       <p class="note">This is indented two times</p>
    </div>
</div>
This is especially helpful because you can use it it indent tables, paragraphs of all styles, etc - all with one style -- and you can do it for any number of nested levels.

If you later decide you want to change the amount of indent, you just change the one style, rather than finding all the different note styles, paragraph styles, table styles, etc.

It's rather an elegant solution that works for all output types.
Paul Pehrson
My Blog

Image
jjdave
Propeller Head
Posts: 23
Joined: Thu Nov 09, 2017 12:46 pm

Re: AutoNumbering Issue...

Post by jjdave »

Hi Doc Guy,

Appreciate your help.

The generic div.indent will help with many different styles for indentation which would be great.
Also, not mixing NOTE Style (as I had done in my example) with Auto-Number would make sure of functionality of Auto-Number as it meant to be.


Thank you all for your help.
One again, Appreciate it very much.
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: AutoNumbering Issue...

Post by doc_guy »

Happy to have been able to help! In the forums, we love to help. Let us know if we can help in the future.
Paul Pehrson
My Blog

Image
jjdave
Propeller Head
Posts: 23
Joined: Thu Nov 09, 2017 12:46 pm

Re: AutoNumbering Issue...

Post by jjdave »

Hi Doc_Guy,

I added Indent Style to Stylesheet (see image below-right)
Then I added Div & Double-Div tag in the text editor (see image below-center)
..........By the way, how do you add Div Tag around Text in XML Editor Mode?
..........I can select style from Style Window but I do not see Div option???


However, my XML Editor displays both Indent at the same level (see image below-left).
Please help...
Untitled.png
You do not have the required permissions to view the files attached to this post.
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: AutoNumbering Issue...

Post by doc_guy »

Make sure the style declaration is div.indent, not just indent.

Either of the following will work:

Code: Select all

div.indent {
     margin-left:100px;
}

Code: Select all

.indent {
     margin-left:100px;
}
According to your screen shot, your style declaration is just this:

Code: Select all

indent {
     margin-left:100px;
}
That would apply to an element named "indent"; like this: <indent>Some content</indent>

Instead, you need the period/dot to show it is a CLASS of something else.
Paul Pehrson
My Blog

Image
jjdave
Propeller Head
Posts: 23
Joined: Thu Nov 09, 2017 12:46 pm

Re: AutoNumbering Issue...

Post by jjdave »

Appreciate your quick response. I did create a div.intent and it works now.

I can select a Text or Paragraph and apply any style from Styles list.
But how do I wrap (or apply) the div.indent style around another style?

At the moment, I go into Coding and manually add <div class="indent">.....</div> around any paragraph or list style.

Thanks so much for your help.
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: AutoNumbering Issue...

Post by doc_guy »

I click on the blocks in the xml editor, and then click the group button:
https://www.screencast.com/t/6xkOz48KG
Image
Paul Pehrson
My Blog

Image
jjdave
Propeller Head
Posts: 23
Joined: Thu Nov 09, 2017 12:46 pm

Re: AutoNumbering Issue...

Post by jjdave »

Thank You, Doc Guy.

That worked out very well. With all the help provided, my work is a lot more efficient.
Also, learning a lot of capabilities of the Madcap Flare Software, while I am still scratching the surface of it.

Once again, thank you.
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: AutoNumbering Issue...

Post by doc_guy »

:) Glad you found it helpful!
Paul Pehrson
My Blog

Image
Post Reply