Apply a style to a Variable
Apply a style to a Variable
How do I apply a style, for example bold, (b) to a variable. If I select the variable, the b style is not available. If I select more than just the variable, like the spaces on either side, and apply the b style, the variable doesn't change. I don't want to create another style, because I want to be able to change everything I have marked with the b style in the future if necessary.
-
KevinDAmery
- Propellus Maximus
- Posts: 1985
- Joined: Tue Jan 23, 2007 8:18 am
- Location: Darn, I knew I was around here somewhere...
Re: Apply a style to a Variable
You'll need to add a Span that contains the variable then apply the formatting to the Span. This is actually what you're doing when you add the B to the spaces - odds are though that Flare is closing the Span when it encounters the variable. What you can do instead is apply the B format to one of the spaces then drag the variable tag inside the span. Clunky, I know, but it works.
Until next time....

Kevin Amery
Certified MAD for Flare
Kevin Amery
Certified MAD for Flare
Re: Apply a style to a Variable
Honestly, this seems like some kind of defect to me. If you apply the b style, you get this weird "mc-tag-and-class: b;" when you select the variable, but no bold. I'd report this:
http://www.madcapsoftware.com/bugs/submit.aspx
http://www.madcapsoftware.com/bugs/submit.aspx
Flare v6.1 | Capture 4.0.0
Re: Apply a style to a Variable
There's another bug involved with this. In Flare v4, there is a style in the Stylesheet Editor labeled "MadCap|variable" (I don't have v3 open at the moment, but in that version it was probably just called "variable"). You can select that style and set it to be bold, which should make all variables bold. However, although the bold effect appears in the XML Editor, it doesn't appear in the Preview window or in the final output (WebHelp, at least). Usually it's the other way around, and although annoying, is acceptable since the final output is correct. This bug is reversed, which isn't acceptable since the final output isn't correct.
There is a workaround, though. Create a generic class (maybe .variableStyle) and set it to bold. When you select the variable in the XML Editor, the generic class will appear and you can select it to apply it to the variable. The variable then appears bold in the XML Editor, the Preview window, and the final output (although I didn't test print output). That still leaves you only one place where you need to change the style.
There is a workaround, though. Create a generic class (maybe .variableStyle) and set it to bold. When you select the variable in the XML Editor, the generic class will appear and you can select it to apply it to the variable. The variable then appears bold in the XML Editor, the Preview window, and the final output (although I didn't test print output). That still leaves you only one place where you need to change the style.
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Re: Apply a style to a Variable... and snippets, too
I've encountered this irritation with both variables and snippets. I'm in Flare 3.1.
I hadn't thought of applying the span to a neighboring character, then dragging the snippet/variable inside the span. I had tried selecting characters before, after, or both, then applying the span to see if that worked. (It doesn't) Instead, I've been opening the text editor and entering span manually. Dragging into an existing span is quicker.
Thanks!
I hadn't thought of applying the span to a neighboring character, then dragging the snippet/variable inside the span. I had tried selecting characters before, after, or both, then applying the span to see if that worked. (It doesn't) Instead, I've been opening the text editor and entering span manually. Dragging into an existing span is quicker.
Thanks!
Tracey
-
Richard Ferrell
- Propellus Maximus
- Posts: 840
- Joined: Mon May 01, 2006 10:11 am
- Location: Inside California
Re: Apply a style to a Variable
Variables will take the style of the text around it, its not possible to assign a Style to a variable, Only with Snippets can you assign a style.
Richard Ferrell
Certified Madcap Trainer

Certified Madcap Trainer
Re: Apply a style to a Variable
So what's the MadCap|variable style for?Richard Ferrell wrote:...its not possible to assign a Style to a variable...
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Re: Apply a style to a Variable
Hmm... Richard, do you mean that you cannot apply formatting in the variable definition itself or that you cannot apply a span to a variable that is inserted into a topic?
I know that you cannot apply formatting to a variable (or associate a stylesheet with it), but that you can do both with a snippet.
You can, at least in 3.1, apply a span to either a variable or snippet that's inserted into a topic, though not the way you'd expect. Here is what I just did (thanks to Lisa for the drag method):
1. I inserted a variable into a topic and saved the topic.
2. I opened the topic in the Internal Text Editor.
3. I manually entered <span class="fieldName"> before the variable and </span> after the variable and saved.
4. I entered another variable in the topic.
5. I applied a span to adjacent characters, then dragged the variable within the span, fixed the adjacent characters, and saved.
Results:
XML Editor: the span that I entered manually into the text file is displayed properly. The one in which I dragged the variable is displayed only on the "regular" characters; the variable is not displayed with the span's formatting.
Preview: Both spans appear properly formatted.
Output: Both spans appear properly formatted in a DotNet Help output.
I know that you cannot apply formatting to a variable (or associate a stylesheet with it), but that you can do both with a snippet.
You can, at least in 3.1, apply a span to either a variable or snippet that's inserted into a topic, though not the way you'd expect. Here is what I just did (thanks to Lisa for the drag method):
1. I inserted a variable into a topic and saved the topic.
2. I opened the topic in the Internal Text Editor.
3. I manually entered <span class="fieldName"> before the variable and </span> after the variable and saved.
4. I entered another variable in the topic.
5. I applied a span to adjacent characters, then dragged the variable within the span, fixed the adjacent characters, and saved.
Results:
XML Editor: the span that I entered manually into the text file is displayed properly. The one in which I dragged the variable is displayed only on the "regular" characters; the variable is not displayed with the span's formatting.
Preview: Both spans appear properly formatted.
Output: Both spans appear properly formatted in a DotNet Help output.
Tracey
Re: Apply a style to a Variable
So there are two suggestions in this thread, so far.
1. The workaround that has everything appearing the way it should is unbelievably
labour intensive. I actually found a way to do it all in one window, but the amount of clicking is still awkward. (How hard should it be to click a location?) Anyway, here's a quick Flash movie that shows how I, working in only one window, made text bold ...when the text is/includes a variable:
In the movie, you can hear from my voice that I am sick, hence the grumpiness/sarcasm in my narration.
2. This appears to be faster, but although the XML Editor and Preview showed the bold, the compiled Help does not show the bold. I probably did it wrong, but the way I did it is useless:
Why is it so difficult to get a text variable formatted to appear bold? U s a b i l i t y, please.
1. The workaround that has everything appearing the way it should is unbelievably
2. This appears to be faster, but although the XML Editor and Preview showed the bold, the compiled Help does not show the bold. I probably did it wrong, but the way I did it is useless:
I've wasted too much time trying to get a variable to appear bold. It's absurd that Flare can't do this easily.There is a workaround, though. Create a generic class (maybe .variableStyle) and set it to bold. When you select the variable in the XML Editor, the generic class will appear and you can select it to apply it to the variable. The variable then appears bold in the XML Editor, the Preview window, and the final output (although I didn't test print output). That still leaves you only one place where you need to change the style.
Why is it so difficult to get a text variable formatted to appear bold? U s a b i l i t y, please.
-
SteveS
- Senior Propellus Maximus
- Posts: 2090
- 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: Apply a style to a Variable
Hi Jerome
Welcome to the forums.
Although the Madcap folk pop into this forum on a regular basis, it's basically peer support. If you want to lodge a bug report or enhancement request the best palce to do so is https://www.madcapsoftware.com/bugs/submit.aspx. Madcap also have a 'squeaky wheel' policy - the more people who request something, the more likely it is to be implemented. Although 1 hopes that applies to enhancements rather than bugs
Welcome to the forums.
Although the Madcap folk pop into this forum on a regular basis, it's basically peer support. If you want to lodge a bug report or enhancement request the best palce to do so is https://www.madcapsoftware.com/bugs/submit.aspx. Madcap also have a 'squeaky wheel' policy - the more people who request something, the more likely it is to be implemented. Although 1 hopes that applies to enhancements rather than bugs
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.