Style for following paragraph

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
tawnip
Propeller Head
Posts: 24
Joined: Sat Jan 24, 2015 10:59 am

Style for following paragraph

Post by tawnip »

Hi,

Is there a way to set a "Style for the following paragraph" as in Word. I need my H1 to automatically display a custom style "p.together" after I press Enter.

Thank you,
Tawni
Nita Beck
Senior Propellus Maximus
Posts: 3667
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Style for following paragraph

Post by Nita Beck »

This has come up on the forums before. (I'm not dinging you; the forums *are* hard to search.)

Here's the code you'd have in your stylesheet:

Code: Select all

h1{
	mc-next-tag: p;
	mc-next-class: together;
}
That said, if you're trying to keep a heading together with the next paragraph, you can probably just set the h1's page-break-after attribute to "avoid".

HTH
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
tawnip
Propeller Head
Posts: 24
Joined: Sat Jan 24, 2015 10:59 am

Re: Style for following paragraph

Post by tawnip »

Thanks so much Nita. I just spent 4 hours in the forums trying to find this!!

Happy day,
Tawni
Nita Beck
Senior Propellus Maximus
Posts: 3667
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Style for following paragraph

Post by Nita Beck »

Glad to have helped.

But keep this in mind. In you press Enter after the p.Together style, you’ll just get another p.Together paragraph.

As I said above, if what you are trying to accomplish is to have your h1 stay with the next paragraph, to not break to a new page after the h1, you’re better off (potentially) styling your h1’s page-break-after attribute to “avoid”.

Last bit, despite what Flare’s documentation says, one can’t just specify the mc-next-tag attribute; one has to also specify the mc-next-class attribute. What this means is that one can’t have the next paragraph be styled as a plain old p.

Still HTH...

Good weekend!
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
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: Style for following paragraph

Post by SteveS »

A tip for searching the forums is to use google:

Code: Select all

next paragraph format site:forums.madcapsoftware.com
This search found several topics, including some with links to other topics, about applying a format to a paragraph depending on the preceding paragraph's style.

Dave also had a plugin for firefox but I'm not sure if it is still available or works with the current version.
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
Post Reply