New Following Style

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
EricS
Propeller Head
Posts: 39
Joined: Tue Sep 01, 2015 12:00 pm

New Following Style

Post by EricS »

Hello All,

Forgive me if this has been addressed. I am a relatively new Flare user. I am creating "Caution", "Note", and "Warning" styles for use in a pdf document. What I can not seem to do is set the styles so that the following style (when enter is hit) is the "normal" p style.

Hope the question makes sense. :shock: :lol:

Thanks in advance,

Eric
Eric S.
Image
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: New Following Style

Post by doc_guy »

Welcome to the forums!

Yes, your request makes sense, but there isn't an easy way to do it. Basically the settings you are using allow you to pick a specific class of P, but don't let you select NO class of p.

I've seen people do a work around where they put the following in the text of the style sheet:

Code: Select all

p.warning {
        mc-next-class: " ";
}
Don't forget the space!

This will make the next paragraph have the following

Code: Select all

<p class=" ">
This isn't ideal, since you'd prefer to have paragraphs with no class. However, you can do periodic clean up by searching your project for class=" " and replacing it with nothing. That cleans up the extra, unnecessary classes.

Hope this helps.
Paul Pehrson
My Blog

Image
EricS
Propeller Head
Posts: 39
Joined: Tue Sep 01, 2015 12:00 pm

Re: New Following Style

Post by EricS »

Thanks, Paul.

No, for my purposes going right to the main 'p' class will work fine. Appreciate the help!

Eric
Eric S.
Image
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: New Following Style

Post by LTinker68 »

Actually, the following works without leaving an empty class. Tested it both with a next tag of <h2> and a next tag of <p>.

Code: Select all

h1 {
     mc-next-tag: h2;
}
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: New Following Style

Post by LTinker68 »

LTinker68 wrote:Actually, the following works without leaving an empty class. Tested it both with a next tag of <h2> and a next tag of <p>.

Code: Select all

h1 {
     mc-next-tag: h2;
}
Nope, sorry. Turns out it doesn't work going from a paragraph with a class to a plain paragraph. The following paragraph inherited the previous paragraph's class. It works in my example where you're switching between different types of tags, but not when you're trying to switch back to the standard tag.

Sorry about that.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2632
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: New Following Style

Post by ChoccieMuffin »

My "hack" is to set the following style as p.none, but don't define the "none" class in my stylesheet. To tidy up at the end I change <p class="none" to <p.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
BrianBXYPRO
Propeller Head
Posts: 23
Joined: Tue May 03, 2016 12:04 pm
Location: Simi Valley, CA

Re: New Following Style

Post by BrianBXYPRO »

I created an indented note class (p.NoteIndented) where I want the next paragraph to be a normal <p> paragraph so I tried this:
doc_guy wrote:Basically the settings you are using allow you to pick a specific class of P, but don't let you select NO class of p.

I've seen people do a work around where they put the following in the text of the style sheet:

Code: Select all

p.warning {
        mc-next-class: " ";
}
but it doesn't work at all. The next paragraph is always the p.NoteIndented style. Here's how I defined it:

Code: Select all

	p.NoteIndented
	{
		mc-auto-number-format: 'Note: ';
		margin-bottom: 12px;
		mc-next-tag: p;
		mc-next-class: " ";
	}
I tried removing the "mc-next-tag" line but it made no difference. I even tried making it a different tag (e.g., "h1") but the next paragraph still was always the p.NoteIndented style. Any ideas why it doesn't work?

Brian

ETA:

Solved it! For some reason it was defined twice in my stylesheet. I removed the first one in the "@media print" section (where I had added the code) and then added the code in the remaining definition.
Flare ( :flare: ) v12, Windows 10
dogsma
Propeller Head
Posts: 18
Joined: Sat May 05, 2018 6:27 am

Re: New Following Style

Post by dogsma »

I cannot get this to work no how. My stylesheet keeps reverting the class to "inherit".
Post Reply