Forum How do I...?

How to create cross reference to figure or table number only

chris.burden
hi,

New to Prince,

I would to format my xrefs so that depending on the outputclass the links are styled differently.

Couple of issues:

How do you style the css to only show the figure or table number of the link?

How to do prevent a chapter number being included even though the h1 style does not include numbering?

I can get styles for links working for different outputclasses, for example:

a {text-decoration: none;}

a.paratext_short::after {
        content: " (Page " target-counter(attr(href), page) ")";
    }

a.paratext_long::after {
        content: " on page " target-counter(attr(href), page) ;
    }


Result:
a link with outputclass "paratext_short"
My Topic Title (Page 34)

a link with outputclass "paratext_long"
My Topic Title on page 34

But some of the paratext_long are coming out with "Chapter 4: My Topic Title on page 34"

I also need paranum_fig and paranum_tab for
Figure 34 shows this....
Table 34 list that....
mikeday
I'm not sure exactly what problem you are having, if you use CSS to add "on page N" after the link, does the link itself have the wrong text? Does it say <a href="...">Chapter 4: My Topic Title</a> and you want it to say something else?
chris.burden
Hi Mike,

Yes.

When I have an xref I want it to say "My topic title on page X"
Without the Chapter 4: part

I also need to know how to just show the figure number or table number when links to to a figure or table.
mikeday
If you represent the figure and table numbers with CSS counter then you can use target-counter() to refer to them, otherwise it may be necessary to use JavaScript.

Removing the "Chapter 4: " from the link may also require JavaScript or editing the markup.
chris.burden
ummm thanks Mike,

Not really the answer I was looking for. I will go back to the team at easyDITA for help as they are using Prince XML in their PDF gen engine.

I will update this post if I get the answers I am looking for...
mikeday
If the document is being produced from DITA then that presents other customisation options, but Prince only sees the final HTML that is produced.