xref format changes at build

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
HiyaKath
Propeller Head
Posts: 35
Joined: Thu Nov 17, 2011 12:07 pm

xref format changes at build

Post by HiyaKath »

In my stylesheet I have defined my xref formats to be:
{color blue}{paratext}{/color}

When I insert the xref it appears in the editor and the preview to be correct - heading text, blue, linked, no page references.
The text editor shows the code to be:
<MadCap:xref href="Step-1-Features.htm"><span style="color: Blue;" class="mcFormatColor">Step 1—Enable Features</span></MadCap:xref>

But when I build the PDF output, the xref changes to:
"Step 1—Enable Features" on page 4

Not even blue :(

I have searched all over the stylesheet for a rogue format that might be doing this but cannot find anything that puts a pageref in. I've checked all the mediums - they all use the same xref formats.

This is a new project, but I copied the stylesheet from an older, very stable project.

Any thoughts?

Thanks,
Kath
HiyaKath
Propeller Head
Posts: 35
Joined: Thu Nov 17, 2011 12:07 pm

Re: xref format changes at build

Post by HiyaKath »

Just to add some information:

I tried building as a Word document and the blue text is there without the page ref, however there is no link.

I never use Word outputs though so maybe this is normal?

Thanks,
Kath
Mike Kelley
Propeller Head
Posts: 68
Joined: Fri Aug 22, 2014 12:24 pm

Re: xref format changes at build

Post by Mike Kelley »

By default, xrefs add the "on page X" after every xref in PDF output. The reasoning is for people that might print the PDF - they certainly can't click the link, so the "on page X" helps them to know where the link is pointing to. As far as I know, you cannot disable the "on page X" feature of xrefs in PDF output. If you don't want that to appear in your PDF output, use regular hrefs instead.

As far as why it's not blue, the only thing I can think of is that perhaps the PDF doesn't like inline styles. I strongly recommend against using inline styles at all times anyway. Try this instead: Find your stylesheet, right-click on it, Open with --> Internal Text Editor, and add the following code somewhere:

Code: Select all

xref, a {
    color: blue;
}
HiyaKath
Propeller Head
Posts: 35
Joined: Thu Nov 17, 2011 12:07 pm

Re: xref format changes at build

Post by HiyaKath »

Thanks for the reply Mike. I can workaround by using a hyperlink instead of a cross reference.

But I don't really accept that this is default PDF behavior because I have generated many PDFs using paratext only xrefs in other projects that do not behave this way.

It is odd to me that not only does it change the color, but it adds quotation marks, as well as the the "on page X" suffix. That has to be defined somewhere.

As for the inline formatting - Flare inserted that when I created the xref. The xref itself is defined in the stylesheet as:

Code: Select all

MadCap|xref.paraxml_nopage
{
	mc-format: '{color blue}{paratext}{/color}';
}
When created, in the text editor I get this:
...see <MadCap:xref href="../Troubleshooting/Artifacts.htm" class="paraxml_nopage"><span style="color: Blue;" class="mcFormatColor">Rolling Shutter Artifacts</span></MadCap:xref>

If I define the xref color as you describe, would that mean it is unnecessary in the xref mc-format?

Thanks,
Kath
HiyaKath
Propeller Head
Posts: 35
Joined: Thu Nov 17, 2011 12:07 pm

Re: xref format changes at build

Post by HiyaKath »

Just to follow up for any future searcher -

With MadCap's help support we discovered that my target had a setting:
RemoveMadCapStyles="true"

This was a remnant from an HTML5 output prior to selecting PDF.

When this is set to false, the xrefs displays as expected per the definition in the CSS.

Thanks,
Kath
Post Reply