Example, Note, Caution, Related Topics, ... syles

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
rs_
Jr. Propeller Head
Posts: 4
Joined: Sat Jul 06, 2013 5:59 pm

Example, Note, Caution, Related Topics, ... syles

Post by rs_ »

I would like to add elements like Example, Note, Caution, Related Topics, ... But later I might want to add a symbol/picture or put the element in a box. Or I might want to change the picture, box, font, color, background color, indentation, etc.

How do I set up an Example "style," so that later I can make changes in one place and all my Examples change?

Thank you.
Daniel Ferguson
Propeller Head
Posts: 77
Joined: Wed Jul 10, 2013 12:34 pm
Location: Salt Lake City
Contact:

Re: Example, Note, Caution, Related Topics, ... syles

Post by Daniel Ferguson »

You'll want to set up classes in your stylesheet for each element. In your example, you may end up with classes like "p.example", "p.note", "p.caution", and "p.related" in your stylesheet. To add these classes, open your stylesheet in Flare, highlight the element to which you want to add a class (in this case, it would be the "p" tag), and then click "Add Class" in the toolbar. You can then add your classes and style them however you want.

After you've defined your style classes, you can apply them to the appropriate elements in your topic files. My preferred method of doing this is to right-click on the structure bar for that element, and then to select "Style Class > [your style]." For example, if you had a paragraph that you wanted to be a note, you would right-click the "p" structure bar for that paragraph, and then select "Style Class > p.Note."

Now, any change that you make to the p.Note class in your stylesheet will automatically apply to every paragraph with a class of Note in your project.

Hope this helps.
Daniel Ferguson
Certified Flare Trainer & Consultant
smartoutput.com
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Example, Note, Caution, Related Topics, ... syles

Post by LTinker68 »

Just to add to what Daniel wrote, depending on how you want the example, note, etc., to look, you might have to go with a div inside a div. If you can get the effect you want with a paragraph, I'd go with that, but for certain designs, you might have to get fancier.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
rs_
Jr. Propeller Head
Posts: 4
Joined: Sat Jul 06, 2013 5:59 pm

Re: Example, Note, Caution, Related Topics, ... syles

Post by rs_ »

Daniel,

Thank you.

The problem with using just styles is that it only affects the style. When if I want the word "Example" centered at the top of every example? Or I want the examples numbered?

I think the styles approach takes care of the formatting elements within the example but not elements surrounding the example.

Richard
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Example, Note, Caution, Related Topics, ... syles

Post by LTinker68 »

You can use the mc-auto-number-format attribute to add the word "Example" to a paragraph or div class (or list, etc.). It's the same as adding "Figure" before figure captions. You might need to play with the styles a bit, though, perhaps include a span class, if you want the text "Example" to hang outside the example content.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Nita Beck
Senior Propellus Maximus
Posts: 3672
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Example, Note, Caution, Related Topics, ... syles

Post by Nita Beck »

You might also find this forum post relevant to what you're trying to do: http://forums.madcapsoftware.com/viewto ... 68&p=93098
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
chunkee
Sr. Propeller Head
Posts: 121
Joined: Wed Mar 09, 2011 1:52 pm

Re: Example, Note, Caution, Related Topics, ... syles

Post by chunkee »

check out twitter's styles for these. very nice, standardized look great and free to use!
Post Reply