FIXED: Variables in PDFs - how they look

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
ajpeck123
Propeller Head
Posts: 37
Joined: Tue Mar 07, 2017 6:01 am

FIXED: Variables in PDFs - how they look

Post by ajpeck123 »

Hi. I use a variable called prodname to hold the product name - needed because the same topics are used by the product (one of many) that the document is for but also OTHER component products are mentioned so we can't get away with not using the product name.

Some of the product names aren't great in the middle of a sentence... they don't read well in English without some way of identifying that they are names. There are lots of ways of doing this - I know - but regardless, I want to do it as automatically as I can.

In the stylesheet, I created a class of the MadCap |Variable called prodname. I coloured it purple. Inserting a variable and applying the class colours it purple in the editor...but it's plain in the PDF output.

Any ideas? (I know I can surround it with a span... I'm just trying to do it in one step instead of two...)

Alison
Last edited by ajpeck123 on Thu Mar 29, 2018 1:04 am, edited 1 time in total.
Alison
Lone technical author - Flare user since March 2017
Currently using Flare 2020
ChoccieMuffin
Senior Propellus Maximus
Posts: 2632
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Variables in PDFs - how they look

Post by ChoccieMuffin »

I never did manage to achieve this, so I'm looking forward to seeing if anyone else has. I had to do what you said, and wrap the variable in a span. Tedious.

Just a thought, I haven't tried this. Could you insert your variable into a snippet, wrap the variable in a span in the snippet, and then include the snippet in your text whenever you need it? That way you'd only need to apply the span once (in the snippet) rather than everywhere. Caveat: I have no idea if this would work but it seems like it ought to.
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
AlexFox
Sr. Propeller Head
Posts: 162
Joined: Thu Oct 19, 2017 1:56 am

Re: Variables in PDFs - how they look

Post by AlexFox »

Without testing I'd suggest this is just one of those CSS things that gets lost in translation when building a PDF. I'd personally set a class of .VariablesetVariable name rather than MadCap|Variable.customclass if you know it's always going to be the product variable you want to colour purple. You won't see this apply in the editor, but it *should* work in PDF.
ajpeck123
Propeller Head
Posts: 37
Joined: Tue Mar 07, 2017 6:01 am

Re: Variables in PDFs - how they look

Post by ajpeck123 »

@ChoccieMuffin - the big problem for me with using a snippet instead of a variable is that there would be a lot of very careful conditional text going on in said snippet. Using a variable means I can set the values in the target. This is pretty much essential, as I only work sporadically for this client, and need to get Flare set up for them so that when I'm not there they can correct (for example) a file path and rebuild the PDF. Even if they weren't making changes, the release engineer likes to get the source from me, check it into source control, check it out and build the PDF himself. Again, having everything in the targets means it's a lot easier - they used to use a (very old) version of FM and the steps to build the PDF included importing condition settings and variable settings across all chapters in the book, updating, building...

@AlexFox - brilliant, thank you! Class created called simply .productname and coloured purple. Applied to the variable. Variable is purple in the editor and in the PDF. Just need to check the online help, but see no reason it won't work there. Added advantage is that I can do a sweeping find/replace to make the change throughout.

Alison
Alison
Lone technical author - Flare user since March 2017
Currently using Flare 2020
AlexFox
Sr. Propeller Head
Posts: 162
Joined: Thu Oct 19, 2017 1:56 am

Re: FIXED: Variables in PDFs - how they look

Post by AlexFox »

Slightly different than what I was getting at, but if you've solved your problem then great :)
ajpeck123
Propeller Head
Posts: 37
Joined: Tue Mar 07, 2017 6:01 am

Re: FIXED: Variables in PDFs - how they look

Post by ajpeck123 »

@ AlexFox... Probably just showing my ignorance of CSS here... are you talking about something that would automatically be applied to the variable without having to physically apply the class each time? If so, that would be even better. I will investigate further.
Alison
Lone technical author - Flare user since March 2017
Currently using Flare 2020
AlexFox
Sr. Propeller Head
Posts: 162
Joined: Thu Oct 19, 2017 1:56 am

Re: FIXED: Variables in PDFs - how they look

Post by AlexFox »

The method I posted earlier is targeting the class that madcap converts variables to at build time, hence you wouldn't see it in the XML viewer as the class wouldn't exist yet. I see no reason why you couldn't create a snippet that simply contains the product name variable formatted as you like though.

Code: Select all

<span style="color: your-color">[%=Variables.Product%]</span>
ajpeck123
Propeller Head
Posts: 37
Joined: Tue Mar 07, 2017 6:01 am

Re: FIXED: Variables in PDFs - how they look

Post by ajpeck123 »

OK, thank you. I understand know.

Yes, it would work... but (I forgot to say this) the product names are NOT purple on the odd occasion they pop up in headings. So I'd end up with having to insert the variable when plain, insert the snippet when purple. I'd remember, but I think insert the variable and either apply the class or not is more intuitive for the developers I work with.

Alison
Alison
Lone technical author - Flare user since March 2017
Currently using Flare 2020
Post Reply