26 Replies Latest reply: Jul 30, 2012 8:03 AM by David_Coe RSS

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

    1Editor

      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

        • 1. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
          Bob Niland (Error 7103) Community Member

          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.

          • 2. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
            1Editor Community Member

            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?

            • 3. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
              Bob Niland (Error 7103) Community Member

              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.

              • 4. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                1Editor Community Member

                Thank you VERY much for all this work!! And the explanations.

                 

                I'll have to digest it, and give it a try.

                 

                I really appreciate your help.

                 

                Thanks,

                Linda

                • 5. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                  Bob Niland (Error 7103) Community Member

                  I'll have to digest it, and give it a try.

                   

                  If you get it working, I can offer some tweaks to address the PDF bookmark issue.

                   

                  Basically, what we are doing is generating fully formatted but largely invisible TOC entries in the main document file, then gathering them by generation in the TOC file.

                   

                  Since you have to hand-hack the leading zeros anyway, this puts the formatted page number string right in your face, so if an incorrect number of zeros show up, they are apparent while you are working on the page.

                  ________

                  By the way, what exact MIL spec is involved here?

                  • 6. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                    1Editor Community Member

                    Thanks again...

                     

                    This is for MIL-STD 40051-2 with change 3.

                    • 7. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                      Reviewer1066 Community Member

                      Linda and Error,

                       

                      One problem I see in Error's method is when you have more than 9 chapters. The tenth chapter should be 0010, not 00010, the latter being what I think Error's method creates. The problem is that anything you type directly in the field, as in 000<$chapnum>-<$pagenum>, is not pulled into the TOC, unless one makes it part of the TOC reference.

                       

                      My suggestion would be to use the standard <$chapnum>-<$pagenum> on the master page AND on the TOC reference page. Then in the book file, set the chapter numbering for EACH file as text. Then enter the chapter number TEXT to be 0001, 0002, 0003, etc. The downside is that the numbering does not increment through the book; you have to set it for each file in the book, in the desired order. Moving files around the book requires changing the chapter numbering. I do this for index and glossary chapters, which use Index and Glossary as the chapter numbers. In addition, typical xref formats, such as "See Chapter <$chapnum> on page <$pagenum>", still work.

                       

                      Van

                      • 8. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                        1Editor Community Member

                        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.

                        • 9. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                          Reviewer1066 Community Member
                          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.

                          • 10. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                            1Editor Community Member

                            Thanks for the clarification.

                             

                            Yes, I know that anything typed doesn't get included in the TOC.

                            • 11. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                              1Editor Community Member

                              Thanks to you both.

                               

                              It turns out that by just adding <$chapnum> to my TOC reference page, I got the desired results. I already had the page numbers set up as variables on Master Pages.

                              So the page number on the Reference page looks like this:

                               

                              00<$chapnum>-<$pagenum>

                               

                              I have to adjust the number of leading zeroes for chapters under 10, but that's not bad at all.

                               

                              Appreciate your help very much!

                              • 12. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                                Arnis Gubins ACP/MVPs

                                Late to the party, but just a comment about trying to create invisible text. NEVER, ever use white! FrameMaker has color views that let you turn off a color (i.e. it actually sets it to be invisible).

                                 

                                So the correct first step was taken by creating the "Invisible Text", but use something that really stands out, like a magenta. Then set up your color views (View > Color > Views...) so that the "Invisible Text" is seen in (say) View 6 and set to "Invisible" in View 1 (which is FM's default setting). Then toggling between the views (esc v 1 or esc v 6) turns the "Invisible Text" on or off. Any object that is colored with the turned off/invisible color never gets into the output stream, (though FM still can always see it and you can get at the contents via building blocks, i.e. it never gets hidden like conditional text). So there's nothing to redact in Acrobat either. The keyboard shortcut toggles at the book level, so it's fast and easy to turn colors on or off in FM.

                                 

                                Think of FM's color views as Layers that work on color (attribute based) instead of objects directly. So FM has always had six layers that you can work with.

                                • 13. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                                  Bob Niland (Error 7103) Community Member

                                  ... trying to create invisible text. NEVER, ever use white!

                                   

                                  That's a strong statement. It sounds like there are further downsides to white on white (w-o-w). Some I can think of are:

                                  • It really needs to be pure RGB or CMYK white. Acrobat won't redact if it's even 1 bit different than the background color.
                                  • Even so, if even one coordinate of a w-o-w- font outline lies on a non-white color object, that entire character will still be present in the PDF after redaction.
                                  • The invisible text color needs to be named something other than "White", which Frame might set to Cutout rather than Invisible.

                                   

                                  ... but use something that really stands out, like a magenta

                                   

                                  I agree on standout, but I wouldn't recommend magenta. Frame is hard-coded to use magneta to flag Condition Code overload.

                                   

                                  So there's nothing to redact in Acrobat either.

                                   

                                  Turns out we have to do that anyway. We use EPS imports. Unix Frame is apparently passing them to the .ps file with the preview/thumbnail images intact, and they are being distilled to pdf with the (large, but now useless) preview images embedded, along with EXIF photo data, pixels and vectors outside clipping paths, etc. This undesirable metadata can constitute some 40% of the final pdf, which matters on 20MB pdfs served on the web. So we routinely redact them, and the process stomps the invisible text with no extra effort.

                                   

                                  I looked into Color Views at one time, expecting that it could provide different definitions for colors in each view. It doesn't, so I abandoned it. I just took another look, and it turns out that between Cutout and Invisible, the feature apparently can handle our two magic color requirements, so we'll probably switch to Views. Thanks for bringing it up.

                                  • 14. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                                    1Editor Community Member

                                    Thanks for the heads up on the color.

                                    I've used views in other situations, too.

                                    • 15. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                                      Reviewer1066 Community Member

                                      So the page number on the Reference page looks like this:

                                       

                                      00<$chapnum>-<$pagenum>

                                       

                                      I have to adjust the number of leading zeroes for chapters under 10, but that's not bad at all.

                                       

                                      Please let us know how the TOC works out. I am guessing that the TOC generating mechanism may not work when some documents in a book have reference pages different from other documents in the book.

                                      • 16. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                                        1Editor Community Member

                                        The reference page for the TOC is where I have: 00<$chapnum>-<$pagenum>

                                        Reference pages in each chapter are the same.

                                         

                                        I'll definitely let you know what my best solution is.

                                        • 17. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                                          JohannesKrueger Community Member

                                          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)

                                           

                                          0.PNG

                                           

                                          Johannes

                                          • 18. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                                            1Editor Community Member

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

                                            • 19. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                                              Bob Niland (Error 7103) Community Member

                                              ... create leading zeros using tab leaders ... The tab with custom leaders fills in the leading zeros.

                                               

                                              Elegant. This might even work for TOC, and avoid having to use the hidden body text trick.

                                               

                                              Of course, this does not change the actual format of the system page number variable, so any cross- references in the body text also need to use that same tab leader trick. I'd be tempted to re-state the page number in the body text as a hidden run-in paragraph, named, say, Xref.PageNo, at each point where there will be an Xref marker.

                                               

                                              And none of these work-arounds are going to result in correct (LZ) page number display in PDF reader toolbars (the page content will have LZ numbering).

                                              • 20. Re: Solved: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                                                1Editor Community Member

                                                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>.

                                                FM headers.JPG


                                                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

                                                Numbering.jpg

                                                 

                                                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.

                                                • 21. Re: Solved: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                                                  Reviewer1066 Community Member

                                                  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

                                                  • 22. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                                                    1Editor Community Member

                                                    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.

                                                    • 23. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                                                      Reviewer1066 Community Member

                                                      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.

                                                      With all due respect, I believe you are missing the point. The chapter number does not need to appear anywhere in the chapter. When you select the file in the book, right-click, and select Numbering, in the Chapter tab you are setting the value of the chapnum for that file. Any reference to it using the <$chapnum> building block, whether in the TOC reference page or in a cross-reference format, displays the value you set in the book file.

                                                       

                                                      As an example, in my case, I have a Glossary file whose chapter number is set to be the text "Glossary". If I add a cross-reference to one of its definitions using a cross-reference format like "See page <$chapnum>-<$pagenum>.", it will display as

                                                       

                                                      See page Glossary-5.

                                                       

                                                       

                                                       

                                                      Van

                                                      • 24. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                                                        1Editor Community Member

                                                        Thank you for pointing this out.

                                                         

                                                        You're right that I don't need to add a cross-reference marker.

                                                        I was making this more complicated than necessary.

                                                        Simpler is better!

                                                        • 25. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                                                          1Editor Community Member

                                                          My solution is now much simpler- back to where I started almost.

                                                           

                                                          I'm using the chapter number variable in the header and footer.

                                                          The Reference page for the TOC format includes the chapter number variable, and I set the chapter number in book file, using the Numbering property Text format.

                                                           

                                                          For cross-references, I use the work package title paragraph tag with a cross-reference format defined as: WP <$chapnum>.

                                                           

                                                          Everything is working perfectly.

                                                           

                                                          Thanks very much.

                                                          • 26. Re: Has anyone worked with US MIL-STD doc, and successfully generated page numbers in TOC?
                                                            David_Coe

                                                            I am working with that same standard MIL-STD-40051-2A and I am curious to know if this same solution works with FrameMaker 10 or is there a simpler solution in the newer version? I will give it a try.