Xrefs appearing incorrectly in PDF output

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
mel_w
Propeller Head
Posts: 33
Joined: Wed Oct 19, 2011 2:05 pm

Xrefs appearing incorrectly in PDF output

Post by mel_w »

Hi,
I have a number of cross-references to figures, which I would like to appear as follows "See Figure 1: Figure caption."

The figures have autonumbering applied to them, so when I created my xref class, I used "{color blue}See {paranum} {paratext} {/color}".

The figures consist of the figure itself, a bookmark, and a caption with a p.fig style applied to it. The p.fig style has an auto-number format applied to it: "GH: Figure {n+}".

To insert the xref, I open the topic, click where I want the xref inserted, and choose Insert > Cross-Reference. I select the bookmark to which I want to link, select my xref class from the lists of xref classes, and click OK.

The only thing that gets inserted, both in the Flare topic and in the PDF output, is "See" (in blue).

I suppose the trouble is with my xref class. Any tips?

Thank you!
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Xrefs appearing incorrectly in PDF output

Post by LTinker68 »

Can you open the stylesheet in the Internal Text Editor, scroll to where your xref appears, and copy-and-paste its style definition into this forum? The xref style block may appear twice -- once inside the @media print block and once outside, depending on how, when, and where you edited the style. Post both blocks, just indicate which is within the @media print and which is not. And if you have other mediums in the stylesheet, check them for the code blocks, too. It's possible that you thought you were modifying the style in the print medium but were in a different medium by mistake.

Could you also open one of the topics that contains the xref and copy-and-paste the code of the entire paragraph or list item or whatever that contains the xref? For example, "<p>Some text <MadCap:xref.... </p>", but with everything between the opening <p> and closing </p> tags, or list tags, whatever. The idea is so we can see if there's a bookend problem with the tags in the xref, although that's not something you'd see in every topic, but it's something to check.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
mel_w
Propeller Head
Posts: 33
Joined: Wed Oct 19, 2011 2:05 pm

Re: Xrefs appearing incorrectly in PDF output

Post by mel_w »

Hi,
Thanks for taking a look!

Here is my xref definition:

Code: Select all

MadCap|xref.Figure_cross_ref
{
	mc-format: '{color blue}See {paranum} {paratext} {/color}';
}
I don't see any references in the stylesheet to @media. I'm not sure I'm even using mediums ;) When I look at the styles.css stylesheet in Advance view, it shows as Medium (default).

Here is code from one of the topics that contains an xref:

Code: Select all

<ol style="list-style-type: decimal;">
            <li>Blah Blah Blah. <MadCap:xref href="#Attach_bracket_product" target="" title="" alt="" class="Figure_cross_ref"><span style="color: Blue;" class="mcFormatColor">See   </span></MadCap:xref><br /></li>
        </ol>
Last edited by mel_w on Tue Nov 01, 2011 3:31 pm, edited 1 time in total.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Xrefs appearing incorrectly in PDF output

Post by LTinker68 »

mel_w wrote:When I look at the styles.css stylesheet in Advance view, it shows as Medium (default).
That medium drop-down in the Stylesheet Editor is a filter view; it doesn't indicate whether or not you've specified any styles in the print medium or any other medium. In fact, when you switch to the print view, everything will look identical to the default medium or will show as "not set", because the print medium will inherit from the default medium, unless you specifically override a style in the print medium. If you've never switched to the print medium, then you're probably fine. If you ever have, though, then it's quite easy to overlook which medium you're in and modify a style in the wrong medium. The easiest way to tell if you've specified any styles in the print medium is to open the Styles.css file in the Internal Text Editor and look for a block of styles that begin with @media print.


However, I tried your styles and they work in my test project. The only other thing I can think of (if you don't have a conflict in styles in the mediums) is how you've marked the item you're xref-ing to. I didn't ask you to post that code. If you open the topic in the Internal Text Editor, then it should look somewhat similar to the following:

Code: Select all

<p class="fig" MadCap:autonum=" Figure 1 "><a name="Attach_bracket_product"></a>Attach bracket product</p>
I'm assuming you have it set up right because your #Attach_bracket_product part of the xref tag indicates you're pointing to a bookmark, but perhaps you inserted the bookmark at the end of the caption instead of before your text and after the auto-number. You might want to check the location of your bookmark to make sure it's in front of the text you want to reference and not after, or not on a different line altogether.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
mel_w
Propeller Head
Posts: 33
Joined: Wed Oct 19, 2011 2:05 pm

Re: Xrefs appearing incorrectly in PDF output

Post by mel_w »

Hi Lisa-
Thanks for the explanations of mediums. I searched my stylesheet in the Internal Text Editor for @media--nothing.

Here's the code you asked for (I changed some of the text and figure names)...does this sequence look right? I think it's showing the graphic, the anchor/bookmark, and the autonumbered caption, in that order.

<p>
<img src="../Resources/Images/image.wmf" MadCap:conditions="Default.condition" />
</p>
<p><a name="Attach_bracket_product"></a>
</p>
<p class="fig" MadCap:autonum=" Figure 2 ">Attach first bracket (product)</p>
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Xrefs appearing incorrectly in PDF output

Post by LTinker68 »

mel_w wrote:<p>
<img src="../Resources/Images/image.wmf" MadCap:conditions="Default.condition" />
</p>
<p><a name="Attach_bracket_product"></a>
</p>
<p class="fig" MadCap:autonum=" Figure 2 ">Attach first bracket (product)</p>
Yep, that's your problem. Your bookmark (<a name="Attach_bracket_product"></a>) is in a paragraph separate from the figure you're trying to xref, so you're essentially xref-ing to a blank space. Delete that bookmark (if you have the appropriate options enabled you'll see a flag icon, otherwise, delete the <a> tag block). Place your cursor just in front of the word "Attach" (you won't be able to put it in front of "Figure 2"), then insert the bookmark (make sure there are no spaces in the bookmark name). You might have to delete the xref and re-add it -- I'm not sure if it will be ok with the bookmark disappearing then reappearing.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
mel_w
Propeller Head
Posts: 33
Joined: Wed Oct 19, 2011 2:05 pm

Re: Xrefs appearing incorrectly in PDF output

Post by mel_w »

Brilliant. Thank you so much!
Post Reply