I recently completed a project where I needed to build in auto-numbering for figures and then cross-references to those figures in preceding paragraphs. I’ve built many an auto-numbered figures, and had inserted many cross-references but never both in the same project. This was just my kind of challenge.

The parts to this task are:

  • Creating the auto-numbering style class
  • Assigning that style class to your figures
  • Creating book-marks
  • Editing cross-reference style
  • Creating cross-references

It sounds like a lot but it isn’t.

Before I go any further with instructions, please be sure that you are working in your Print medium. I cannot stress this enough.

Creating an Auto-Numbering Style

Let’s create a new style class in the <p> tag called caption. We will be applying the auto-numbering to that class.

Open your stylesheet and go to the <p> tag and create a new class called ‘caption’ and set the properties as shown:

 

This is standard format for numbering figures. In this document, I didn’t need to add chapter numbers or anything else to the caption – just the figure number. I added the H to separate this style from all other auto-numbering that I had established in the project. If you don’t do this, then Flare won’t know to separate numbering chapters from numbering figures and you’ll have a big mess:

Chapter 1

Figure 2

Figure 3

Chapter 4

etc.

That would be bad.

Applying That Style to P Tags

Apply that new p.caption style class to all captions that need a figure number. Where ever you’ve applied the style, this is what you’ll see in your XML Editor:

 Note that in each topic, the figures will start at number 1, regardless of that topic’s location in the document. The auto-numbering will not be sorted out until you build the output.

Creating Bookmarks

While you’re applying the style to the <p> tags that are captions,  go ahead and create bookmarks. This step will allow you to create cross-references in a few more steps.

To create a bookmark, click at the beginning of the caption name (note that you won’t be able to click in front of  ‘Figure.’) and go to Insert > Bookmark and, when the bookmark window opens, name the bookmark. For this project, I just used the first word of the caption.

Here’s an example of one of the bookmarks.

Now that you’ve applied the caption style to all the <p> tags that need it and you’ve created bookmarks as well, you are ready to work with the cross-references.

Editing Cross-References Style

Now to tell Flare how to refer to those figures in the preceding paragraph. For this project, I only want to show the figure number, not the caption too. I’ll save you the trouble and tell you that there isn’t a pre-made style for this. SO, we get to make a new xref style.

Go to your stylesheet and look for MadCap|Xref and create a new style. I called mine fig_ref.

In the Unclassified section of Properties, find mc-format and edit it to look like this:

You’ll see in the preview that only the caption number will appear.

Adding Cr0ss-References to Your Document

We’re almost done!

Now go to where ever you want to add a cross-reference to your figure. Click Insert > Cross-Reference.

(Here’s where your bookmarks come in!)

When the window opens, select:

  • Link to: Place in this Document
  • The correct bookmark
  • The new xref class

You’ll see a preview of what you’ll get in the lower right hand corner of this window. If it looks good, click OK.

Here’s what I see in my XML Editor:

Using this method, when you build your PDF output, your figures will be numbered correctly and your figure references in preceding paragraphs will be correct as well.

In my next post, I’ll show you how to create and format a List of Figures based on what you’ve done above.

I’ve decided that I need to learn JavaScript because I’m tired of having to ask other developers for help with something that I feel I should know. Additionally, a number of my clients have asked me to do more than just build help for them so I need to know more. And finally, I firmly believe that I have to keep learning all the time.

Thus, the effort to learn JavaScript.

I actually started to learn JavaScript several months ago when I began a new help project and wanted to do some fancy image changes on the Welcome page. It frustrated me that I couldn’t do what I wanted so I ordered HeadStart JavaScript. I’d had experience with HeadStart HTML & CSS. I can’t say I learned HTML and CSS via the book – but it’s been helpful when I need to refresh my memory on something. So, I got the JavaScript book from the same line of books.

I can’t say it was a rousing success. I don’t think the book was at fault…I think it was me. I don’t know that I was ready to take on a completely new language. So I put the book away and focused on other things, like my client work, the holidays, more client work. And now it’s the new year and I have some time to commit to something….and it might as well be JavaScript.

So, instead of pulling out the book, I decided to try out Codecademy. I’d heard about it from some colleagues and then heard that NYC Mayor Bloomberg was going to use it to learn to code (why, I have no earthly idea).

AND, it was the magic price of FREE.

Given that I’m learning this on my own and don’t have the bandwidth (being a mom, and a consultant, and a director of a non-profit) to actually go to a class at night…and my current employer doesn’t have a training budget…

I finished the first group of lessons yesterday and I can say that, while I didn’t go completely batty, it was a challenge:

Notice, my super awesome 100% complete on the first series of lessons!

Anyway, the biggest issue I have with JavaScript is that it is very case-sensitive. I spent 10 minutes trying to figure why the simplest line of code wouldn’t work – it turns out that I had capitalized the F in function when that’s, obvious to me now, a no-no. Here’s the culprit:

Figuring out that that can’t be capitalized = 10 minutes of my life that I won’t get back.

Codecademy does the whole points, achievements, badges thing that’s all the rage among sites now. I have no idea what the points are for, and while I like the little badges, I won’t be posting them to Facebook, which they encourage you to do.

So, I’m chugging along, trying to remember what it was like learning HTML and CSS way back when. I keeping picturing myself as a JavaScript Ninja…someday.

Are you taking on new languages while building help? If so, which ones?

 

Page 3 of 26123451020...Last →

Recent Posts