The <%HMFIGURECOUNTER%> and <%HMTABLECOUNTER%> variables are special, predefined counter variables for numbering images (figures) and tables. They can be referenced in links and text like "See Fig. X" or "See table Y", provided the references are just a few pages away from the place where the figure or table are located.
Before using these special variables it's important to understand their limitations: Only refer to figures and tables that are a short distance from the reference point: You must update the references manually if you insert new figures or tables: |
You can insert a figure counter variable in the caption of an image, in the image's tooltip, in a manual caption you insert yourself outside of the image or in all of these places. If you insert the variable in more than one place for a single image you need to remember to include a minus character in the second and all following copies to prevent the variable from incrementing incorrectly. (The variable will increment every time it is used unless you do this.)
1.Insert a new image, or double-click on an image in the Help & Manual editor to open its properties dialog. 2.Type in the <%HMFIGURECOUNTER%> variable as part of the caption text and/or in the tooltip box in the place where you want the number to appear. Include the <% and %> characters before and after the variable name (see example above). Tip: If you enter the variable in the body of your text beneath or above the image you don't have to type it in manually. You can use the Insert Variable tool in Write > Insert Object. 3.If you use the variable more than once in the same image, add a minus sign to the variable name, so that it is <%HMFIGURECOUNTER-%> (see example above). This will prevent the variable from incrementing incorrectly and giving you the wrong number. If you are using the Insert Variable tool (not available in the image dialog) you can select this version of the variable directly. 4.Repeat for any additional images you want to number in your project. When you publish your project the variables will be replaced by the consecutive numbers of the images, in the order they appear in the project. |
You can insert a table counter variable either inside or outside the table you want to number. If you insert the variable in more than one place for a single table you need to remember to include a minus character in the second and all following copies to prevent the variable from incrementing incorrectly. (The variable will increment every time it is used unless you do this.)
1.Use the Insert Variable tool in Write > Insert Object to insert the <%HMTABLECOUNTER%> variable anywhere in or near the table you want to number, in the place where you want the table number to appear (you can also type the variable in manually if you want). 2.If you use the variable more than once in the same table use the minus <%HMTABLECOUNTER-%> version for all copies after the first one (see example above). This will prevent the variable from incrementing incorrectly and giving you the wrong number. 3.Repeat for any additional tables you want to number in your project. When you publish your project the variables will be replaced by the consecutive numbers of the images, in the order they appear in the project. |
To create a reference to a figure or table counter you just need to insert the plus or minus version of the figure or table counter variable in the place where you want the number reference to appear. Then you add the "distance" to the reference to after the plus or minus sign. You need to manually count the number of figures or tables between the reference and the item you are referring to to do this. This sounds more complicated than it is. Inserting text references to figures and table countersFor example, suppose there are two numbered figures between the reference and the figure you want to refer to: If the reference comes after the figures the reference to the first figure would be <%HMFIGURECOUNTER-1%>, the second would be <%HMFIGURECOUNTER-2%> and the third would be <%HMFIGURECOUNTER-3%>. If the reference comes before the figure you are referring to the reference to the first figure would be <%HMFIGURECOUNTER+1%>, the second would be <%HMFIGURECOUNTER+2%> and the third would be <%HMFIGURECOUNTER+3%>. The numbers are always the count from the reference to the figure you are referring to: plus for forward references and minus for backward references. Type the variable in or insert it with the Insert Variable tool, then type the necessary number in after the + or - character. Examples: See Fig. <%HMFIGURECOUNTER-3%>. (third numbered figure before the reference) Creating hyperlinks to numbered figures and tablesYou can't link directly to the counter variable. You need to create an anchor and link to the anchor with the reference in the link caption: 1.Create an anchor in the paragraph above the image or table you want to link to and make a note of the anchor name. Make sure there is a little space between the anchor and the image or table so that the jump does not hide part of it behind the top of the window when the user uses the link. 2.Create a topic hyperlink to the anchor and type the variable in as part of the link caption, using the +/- numbering format as described above. Tip: You can also insert the variable with the Insert Variable tool in the editor before creating the link. Then select the variable and text for the link and select the Insert Link tool or press Ctrl+L. Then you can add the necessary number in the Insert Hyperlink dialog:
|