Skip to main content
April 12, 2011
Answered

Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?

  • April 12, 2011
  • 3 replies
  • 4990 views

I'm creating a template using FrameMaker 7.2.

US MIL-STD dictates work package (like chapters) page numbers in the format: 0001-1, 0001-2, 0002-1, 0002-2, etc.

The problem I'm encountering is pulling in that page number format into the generated TOC.

I used a variable on Master Page, and page numbers in each work package generate properly.

I know that in FM 7.2, you can't include a variable in a generated TOC.

So I tried changing the variable on Master Page to text and using a paragraph tag (WPnumber), but haven't gotten that to work either.

Tried all the other tricks I could think of, also.

I believe part of the problem is that FM doesn't allow leading zeroes when setting the page number or chapter number (understandable 99.9% of the time).

If anyone has any suggestions or solutions, I'm very interested to hear them.

Thanks.

1Editor - and stumped

    This topic has been closed for replies.
    Correct answer Van Kurtz

    Thank you for your suggestion.

    I'm already manually setting the leading zeroes. In each chapter.

    I'm going to try adding the <$chapnum> to chapter and TOC Reference page and see if that gets me closer to result I'm looking for.

    Appreciate your comments.


    I'm already manually setting the leading zeroes.

    I just want to be clear that typing the leading zeroes directly on the master page does NOT cause them to be included in the TOC. You would have to type then as part of the TOC reference also. Furthermore, you would have to have separate master pages and reference pages for chapters 10, 11, etc, in order to get the number of leading zeroes correctly.

    In my method, the leading zeroes are entered as part of the chapternumber itself, in the TEXT chapter number. You still have to type them but only once for each file.

    3 replies

    April 27, 2011

    Thank you to everyone who responded to my question. Your answers were very helpful.
    The last piece of the puzzle was setting the Numbering property to Text.

    I'm happy to answer any questions about my solution.


    I've come up with a solution that works for my situation, and the TOC generates perfectly without any manual changes required.
    Here's what I've done.

    On the Master pages:
    1. Create a text block on Master pages, upper right corner with a right-justified, right tab.
    2. Create a paragraph tag, WPnumber, for the page number in upper right corner of page.
    3. Insert the <$chapnum> variable in the WPnumber paragraph tag.
    4. Before the chapter number, insert a cross-reference marker with the chapter number.

         This provides a cross-reference marker for adding cross-references in the text.

    5. Add page number at foot of Right and Left Master pages: add zzFooter paragraph tag centered, with Autonumber Format <$chapnum>. Define page number, using FM default variable Current Page Number: <$chapnum>-<$curpagenum>.


    6. Add LastOddBlank Master page, with page number set using zzFooter paragraph tag, and FM default variables Current Page Number and Last Page Number: <$chapnum>-<$curpagenum>/<$lastpagenum> blank.

    In generated TOC:
    1. On Reference page, set the WPTitleTOC paragraph tag to include leader dots with the right tab:
        <$paratext> >..............WP <$chapnum>-<$pagenum>

    In book file:
    1. Right click each chapter file (but don't open the file), and set the Numbering Properties: Chapter: 0001, Format: Text

    Note: If you have a fluid book with changing chapter order, wait until the order of the chapters is final, and then set the Chapter Numbering property format to Text.

    Van Kurtz
    Inspiring
    April 27, 2011

    I am glad you got it to work for you; however, you state:

    Before the chapter number, insert a cross-reference marker with the chapter number.

         This provides a cross-reference marker for adding cross-references in the text.

    I do not understand the necessity for including a cross-reference marker on the master page. If you add them, I would think they should be in the body text.

    Van

    April 27, 2011

    You have a great observation.

    Normally, I add cross-reference markers in the text.

    However, in the MIL-STD formatted document, the work package (i.e., chapter number) designation appears only in the running headers and footers, and as cross-references in the text.

    There isn't the usual chapter number and chapter title on the opening page.

    Rather than include "invisible" text in the text somewhere, I decided to add the cross-reference marker on the Master page for the first page in the chapter.

    The MIL-STD docs are different from the usual software and hardware documentation that I've worked on.

    Inspiring
    April 14, 2011

    Some time back I read about how to create leading zeros using tab leaders. I'm afraid I cannot recall the source, maybe even on this forum.

    Anyway, for the page number format you're trying to achieve, you can modify the footer paragraph format like this:

    - Delete all existing tab stops in the paragraph.
    - Towards the right end of the footer frame, add a new tab stop with decimal alignment to the hyphen character and "0" as the custom leader.
    - A bit (ca 0.7 cm) further left, add a new tab stop with left alignment and no leader.
    - In the paragraph, insert two tab characters, the <$chapnum> variable, a hyphen character, and the <$pagenum> variable.

    The tab with custom leaders fills in the leading zeros. All you need to do now is tweak the position of the tab stops to get the correct number of digits and an even character spacing.

    For example, the following did work for me:
    A4 page with 2.5cm left indent
    Times New Roman Regular 10pt
    Tabs at 14.31 cm (left) and 15.14 cm (decimal)

    Johannes

    April 14, 2011

    Thanks very much for this info -- I'll give it a try.

    Bob_Niland
    Community Expert
    Community Expert
    April 12, 2011

    I used a variable on Master Page, and page numbers in each work package generate properly.

    So your 00nn-0n numbers do appear correctly on each page via Master Pages?

    What variable construct are you using?

    Can you get the formatted numbers to appear correctly as body page text, or as Xrefs?

    If so, I may have a solution.

    _______

    I've never needed to do this, but got curious.

    April 12, 2011

    The variable format for the page numbers is: 0001-<$curpagenum>.

    WPnumber variable is defined as 0001. I couldn't figure out how to get this variable to increment automatically from one chapter to the next.

    I'm setting the WPnumber variable once per chapter on the master page; e.g., changing to 0002. So the page numbers in each chapter are correct.

    The page numbers are incrementing properly, and display correctly in the TOC.

    It's the precedent numbering - 0001 - that isn't getting pulled from the chapter into the TOC.

    So in the TOC I get 0001-6, for example, regardless of the chapter number. 
    I haven't tried to use a cross-reference for the page numbers.

    When I made the number plain text, it still didn't get pulled into the TOC. I tried making the number text and using the paragraph tag WPnumber too. But that didn't work; maybe the format I used on the TOC Reference page wasn't correct?

    Thanks for your response.

    Any ideas?

    Bob_Niland
    Community Expert
    Community Expert
    April 12, 2011

    I've got a hack, but you need to treat the page display and the TOC display as separate problems.

    The variable format for the page numbers is: 0001-<$curpagenum>.

    You could make that 000<$chapnum>-<$curpagenum>

    That sort of fixes the page display.

    Aside: The "Current Page #" system variable seems pretty useless, as the re-defined variable appears correctly only on the MPs. Xrefs to any page using <$pagenum> still only get the basic page number.

    The hack:

    I created a special Heading for headings intended for TOC.

    For example, Heading2MIL

    It has a large right-justified tab defined with dot leaders just for offset.

    I also created a an Xref format: PageNumOnly, defined as

    <$pagenum>

    I also created a color "Invisible Text", which has an obvious non-text color that is set to pure white for final publication (and optionally bulk-redacted in Acrobat Pro using "Examine Document").

    The body text entered in Heading2MIL is:

    My Topic[tab]000[variable <$chapnum>]-[Xref-to-self, format PageNumOnly]

    This might appear as:

    My Topic ................................0001-1

    Highlight the leaders and page number.

    Apply color "Invisible Text".

    In the TOC file, Reference Page TOC, instead of the typical definition:

    <$paratext>>.............................<$pagenum>

    We just have:
    <$paratext>

    (because it now includes it's own tab and our fully formatted page number).

    Be sure to set tabs/leaders in the Heading2MILTOC paragraph format.

    In the generated TOC body pages, I now see:

    My Topic ................................0001-1

    Downside:

    The PDF bookmarks will contain the page numbers for the included headings. This could be worked around by making the "MIL" headings complete phantom clones of real headings (small point size - entire paragraph Don't Print).

    ________

    If MIL docs commonly have this requirement, I have to imagine that there is an aftermarket solution. And if this requirement has been around a long time, I'm surprised that FM hasn't picked it up as an enhancement.

    Color "Don't Print" didn't work as expected when tested.