Hi,
Newbie here. I've managed to get autonumbering right for my chapter numbers (in PDF). What I need to be able to do is refer to the chapter number. {chapnum} refers to the current (source) chapter as opposed to the destination. Flare has {pagenum} (analogous to {chapnum} but no "[chap} analogous to {page}.
What I need is this
"Chapter 1, Chapter_Title_here"
How do I grab the chapter number from the destination topic? I searched the board and couldn't find a thread on this subject.
TIA,
Bill
How to display chapter number in an x-ref
Re: How to display chapter number in an x-ref
Well done for getting your head round auto-numbering. I've just had a look at my stylesheet, and I've got this for my chapter xrefs:
This will show as, for example,
Chapter 6 "Generating Reports"
Note that my section reference is almost identical at
The only difference is "section" instead of "Chapter".
The relevant bits of my heading style for the chapter are:
The text-decoration: none is needed because by default, xrefs are displayed as hyperlinks, and in the print document, I didn't want them underlined.
When you want to insert an xref to a destination, do Insert > Cross reference, make sure that "Link to" is Topic in Project, select the topic (and, if for some odd reason, the level 1 heading isn't at the very start of the topic, click on the bookmark symbol to view the locations in the topic that you can select).
Don't forget to select an Xref class of MadCap:xref.Chapter. I'm always forgetting to set the class, and if you do, the xref is inserted with the default xref style. You can change the style (technically actually a class in XML-speak!) after you have inserted it, but in the Flare XML editor, the display of the Xref won't actually be updated unless you do Tools >Update Cross-References.
Code: Select all
MadCap|xref.Chapter
{
text-decoration: none;
mc-format: 'Chapter {paranum}"{paratext}"';
}
Chapter 6 "Generating Reports"
Note that my section reference is almost identical at
Code: Select all
MadCap|xref.Section
{
text-decoration: none;
mc-format: 'section {paranum} "{paratext}"';
}
The relevant bits of my heading style for the chapter are:
Code: Select all
h1
{
. . .
page-break-before: always;
mc-heading-level: 1;
mc-next-tag: h2;
mc-auto-number-format: '{chapnum} ';
}
When you want to insert an xref to a destination, do Insert > Cross reference, make sure that "Link to" is Topic in Project, select the topic (and, if for some odd reason, the level 1 heading isn't at the very start of the topic, click on the bookmark symbol to view the locations in the topic that you can select).
Don't forget to select an Xref class of MadCap:xref.Chapter. I'm always forgetting to set the class, and if you do, the xref is inserted with the default xref style. You can change the style (technically actually a class in XML-speak!) after you have inserted it, but in the Flare XML editor, the display of the Xref won't actually be updated unless you do Tools >Update Cross-References.
Marjorie
My goal in life is to be as good a person as my dogs already think I am.
My goal in life is to be as good a person as my dogs already think I am.
Re: How to display chapter number in an x-ref
Thanks. This looks nice and logical. I'll give it a try!
Maybe you'll be promoted to Senior Propeller Head now
Bill
Maybe you'll be promoted to Senior Propeller Head now
Bill
Re: How to display chapter number in an x-ref
Thanks for the nice comments. No chance of a "promotion" for me though. You have no idea how little I know.
Although I think you get promotions by making lots of posts. In my case, they are more questions than answers.
Although I think you get promotions by making lots of posts. In my case, they are more questions than answers.
Marjorie
My goal in life is to be as good a person as my dogs already think I am.
My goal in life is to be as good a person as my dogs already think I am.