Keep text together
Keep text together
In my Flare project, whenever a product name is used in a topic - regardless of whether the topic is output to an online or pdf format - the product name has to be kept together on the same line. I have many product names defined as snippets: for example product a v2.
I haven't been able to find the correct attribute, or attribute combination, to make sure that the product name always stays together on the same line. My question is: how do I do this? I need to do it not only for snippets, but for selected chunks of text as well.
Help!?!
I haven't been able to find the correct attribute, or attribute combination, to make sure that the product name always stays together on the same line. My question is: how do I do this? I need to do it not only for snippets, but for selected chunks of text as well.
Help!?!
Re: Keep text together
Put the product name in a span class and add the attribute white-space: nowrap;
Re: Keep text together
Fabulous - thanks Alex! After my post, I was thinking that nowrap was the thing to look into, I just hadn't been able to find where it was. Thanks for your answer!
Re: Keep text together
Almost there: here's a new tidbit - this solution works great as long as there is not a period "." right after the snippet. If there is, then the snippet still wraps.
Re: Keep text together
Ahhh, a lovely Flareism. Can I ask if there's a particular reason you use a snippet over a variable here?
Re: Keep text together
Of course you may ask - I'm grateful for your help! The reason I'm using a snippet instead of a variable is because I need a portion of the text in the snippet to be bold. My understanding is that you can't apply formatting to variables.
Re: Keep text together
You can insert a Variable inline by using [%=Variableset.Variablename%] - you can use this in a span class with whatever formatting you need. Give that a try in conjunction with your white-space fix and see how that works out.
Re: Keep text together
Sounded very promising, but is working the same way: it doesn't respect the nowrap if the period is right after the [%Variableset.Variablename%] text. It does work if I put a space before the period, but of course, I can't do that.
The other complication is that "TM" is included in my product name, and needs to be superscript. So if I insert [%Variableset.Product TM%], then I select and superscript the TM, it doesn't work at all.
I think I need to contact Flare support about why neither of these options work correctly when followed by a period.
The other complication is that "TM" is included in my product name, and needs to be superscript. So if I insert [%Variableset.Product TM%], then I select and superscript the TM, it doesn't work at all.
I think I need to contact Flare support about why neither of these options work correctly when followed by a period.
Re: Keep text together
As far as the TM goes, you'd place that outside of the variable, i.e. [%=Variables.Product%]<sup>TM</sup>. I'm at a lost as to why you're having this problem, just ensure you're doing something along the lines of the following:
Code: Select all
<span class="nowrap">[%=Variables.Product%]<sup>TM</sup>.</span>
Re: Keep text together. Thank you.
Hello,
this solution was posted a while ago.
I found it this morning, used it, and it helped.
Thanks very much.
Mark
this solution was posted a while ago.
I found it this morning, used it, and it helped.
Thanks very much.
Mark
-
- Jr. Propeller Head
- Posts: 9
- Joined: Thu Jun 22, 2023 2:34 am
Re: Keep text together
The solution works-ish...
I have PDF output built from an imported HTML file with a table...
Sadly, a variable is referenced in the description of an item within the table...
I guess I'm pushing my luck ~ importing HTML files, using tables, variables inside tables, and now wanting variables inside tables to behave nicely!!!
I have PDF output built from an imported HTML file with a table...
Sadly, a variable is referenced in the description of an item within the table...
- Without the solution, the variable is shown split at the end of the column...
- When using the solution, the variable is not wrapped!
- But the column in that particular row is extended to include the variable!
- The column width is fixed...
I guess I'm pushing my luck ~ importing HTML files, using tables, variables inside tables, and now wanting variables inside tables to behave nicely!!!