h2 heading style not overriding body properly (print output)

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Liz Gregory
Propeller Head
Posts: 11
Joined: Fri Jan 03, 2014 3:14 am

h2 heading style not overriding body properly (print output)

Post by Liz Gregory »

Hi all. I'm quite new to Flare so apologies if this is a rookie question. I'm working in Flare 9, Windows 7.

I'm building a project starting from a Flare template, following the online help instructions for starting a new project. My primary output is to PDF. I have set a style for h2 heading in the print medium part of the css that is in Candara, is green, and is 30 pt high. However, when I output to PDF, the h2 heading is in Arial and only about 14-16 pt high (I'm not sure exactly). The strange thing is that the colour is correct for the h2 heading. I also have a span that I'm using inside the h2 heading to make a section of the text only 12 pt high. I've tried outputting both with and without the span. I've done some digging and eliminated some possibilities. I was hoping to add some screenshots but I just can't see how to do this right now, sorry.


1. The problem is not the font (have seen elsewhere in the forums that opentype fonts can be an issue) - I ended up changing the body style to Candara and it will now print the h2 heading in the correct font, but still at the wrong size, but in the right colour.

2. When I choose preview as primary target I see the h2 heading rendered correctly, and the span rendered correctly as well. The problem only occurs when I choose view primary and then pick my primary output, PDF.

3. I'm familiar with XML from using structured FrameMaker and I have had a look at the text editor view, I can't see anything wrong but I will copy it here so you can see:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:lastBlockDepth="6" MadCap:lastHeight="489" MadCap:lastWidth="576" MadCap:conditions="PrintGuides.GPD">
    <head>
        <link href="../Resources/TableStyles/Ingredients.css" rel="stylesheet" MadCap:stylesheetType="table" />
    </head>
    <body>
        <h2>Scotch Eggs <span class="Serves">Serves 4</span></h2>
        <p class="IngredientsHeader">Ingredients</p>
        <table style="width: 100%;margin-left: auto;margin-right: auto;mc-table-style: url('../Resources/TableStyles/Ingredients.css');" class="TableStyle-Ingredients" cellspacing="0">
            <col MadCap:pattern="0" style="width: 4em;" />
            <col />
            <col style="width: 4em;" />
            <col />
4. I've tried setting my h2 print style as the h2 default style, still the same problem.

So it seems to me that my h2 heading is not overriding the body style correctly but I don't know why. Any ideas or suggestions gratefully appreciated! Happy new year!
jasonsmith
Sr. Propeller Head
Posts: 205
Joined: Wed Apr 28, 2010 2:51 am

Re: h2 heading style not overriding body properly (print output)

Post by jasonsmith »

Happy new year! Have you linked your PDF target file to the print medium? To check, open the PDF target file, click Advanced and make sure stylesheet medium is set to print. Oh, and check that the correct Master stylesheet is chosen in the General section.
Liz Gregory
Propeller Head
Posts: 11
Joined: Fri Jan 03, 2014 3:14 am

Re: h2 heading style not overriding body properly (print output)

Post by Liz Gregory »

Hi Jason, thanks for the reply. I have checked that the target is set to print medium (it is) and that the master stylesheet is set to the correct css (it is).

I reset both just in case but the PDF is still showing the body font with the h2 colouring :(

Any other ideas?
ChoccieMuffin
Senior Propellus Maximus
Posts: 2650
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: h2 heading style not overriding body properly (print output)

Post by ChoccieMuffin »

I have often found that the Preview feature in the XML Editor is frustratingly inaccurate, so I don't trust its output. Unfortunately it's not "WYSIWIG", but "WYSI almost WYG but not quite".

I suggest you create a new PDF target (copy your existing PDF target), in the new PDF target add a new TOC and JUST include the topic you want to view, then BUILD this new target rather than a full build. That way you'll get an accurate representation of your final output.

If there are still problems, you might want to look at the attributes you've set for <body> and <h2> in your Print medium and post those on here, that might be where the problem is.
Started as a newbie with Flare 6.1, now using Flare 2024r2.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Liz Gregory
Propeller Head
Posts: 11
Joined: Fri Jan 03, 2014 3:14 am

Re: h2 heading style not overriding body properly (print output)

Post by Liz Gregory »

Ermergerd, that totally worked! Thankyou! I built a new target and put a single topic in a new TOC and the new PDF has the correct header style! :o :D

Now for the big question - why did that work? The more I know about what is going on under the hood, the more I can figure out for myself in future.
Nita Beck
Senior Propellus Maximus
Posts: 3672
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: h2 heading style not overriding body properly (print output)

Post by Nita Beck »

I suspect that the issue is that, in your original PDF target (not the one you just created as an experiment), on the Target Editor's Advanced tab, the "TOC depth" option has been selected.

If so, then Flare will override a topic's heading style with the heading style that corresponds to the topic's "depth" in the TOC. So, say there is a topic whose heading is set to H2, but that topic is at the third-level down in the TOC. Flare will change that H2 to an H3 in the generated PDF (but not in the topic itself).

And in this regard, the XML Editor and the preview will ONLY ever show the topic's heading as an H2, but in the generated PDF it'll be whatever corresponds to the "TOC depth".

Regarding your CSS, you probably need to adjust the H3, H4 etc. styles to achieve the right look in the generated PDF.

You can read more about "TOC depth" here: http://webhelp.madcapsoftware.com/flare ... nt_TOC.htm

Hope this helps.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Liz Gregory
Propeller Head
Posts: 11
Joined: Fri Jan 03, 2014 3:14 am

Re: h2 heading style not overriding body properly (print output)

Post by Liz Gregory »

That is brilliant! Yes, I went back and checked and the old target did indeed have TOC depth selected. I will have to be extra-vigilant in future when using templates.

Thanks for the explanation, I feel like I've learned a lot about Flare today trying to fix this.
Post Reply