18 Replies Latest reply: Jul 26, 2012 7:46 AM by convextech67 RSS

    How to get the Figure Title to appear below the graphic, not above

    convextech67 Community Member

      I have valid XML that I am importing into FrameMaker just for printing.

       

      My <figure> element contains a <title> and a <graphic> element. The graphic comes in within an anchored frame, appearing after the figure title. The figure title needs to be below the graphic. How do I get this to work? I read a couple of threads that used tables to wrap the graphic & the title and to make the title appear below, but that was during an export function to XML, not an import. Short of editing the DTD, EDD & all of the XML data to have the graphic element structure come before the title within <figure>, how would this be accomplished? Thanks in advance.

        • 1. Re: How to get the Figure Title to appear below the graphic, not above
          ScottPrentice Community Member

          Are you using a data model like DITA or one that you've created?

           

          If it's your own model, just go into the DTD/EDD and move it .. but if it's one that's defined by another group, you don't want to do that since you'll be breaking the "standard". I'm assuming you're not using DITA since that has a <fig> and <image> elements not <figure> and <graphic>. In DITA-FMx (the plugin that I develop), I have an option to move the figure title below the image at "build" time. This is the proper time to move the element. Don't do it through some odd hack in the source .. that's called "tag abuse" and will come back to bite you eventually. The best option is to author it in the structre that's defined by the model, then create a publishing process that creates a book and component FM files from teh XML. This publishing process can then adjust the elements as needed through scripting (ExtendScript if you're using FM10). You may need to create a slightly different EDD for use in the "generated" files that differs from that of the XML source model.

           

          If you are using DITA, and just got the element names wrong, you might consider using DITA-FMx .. it'll just make your life easier in the long run ..

           

               http://leximation.com/dita-fmx/

           

          Cheers,

           

          ...scott

           

          Scott Prentice

          Leximation, Inc.

          www.leximation.com

          • 2. Re: How to get the Figure Title to appear below the graphic, not above
            convextech67 Community Member

            I am using a DoD DTD, but have had to modify the DTD greatly because the manufacturer did the last manuals before we got them, and they used their own version of DTDs. I have been given full rights to do whatever I have to do to the DTD to make this work (getting the manuals to print), except that this works just fine if I were to print out of Arbortext or using the government-issued system. The thing is, I can't use either system because my program can't afford them - they wanted to use something they already owned, which led me to FrameMaker. I guess I could make this version of the DTD a FrameMaker variant, since I had to make these DTDs variants from the rest of the DoD DTDs anyway...I am just not programmed to be a variant, I guess. I've always operated on the consistency engine. Thanks for your reply!

            • 3. Re: How to get the Figure Title to appear below the graphic, not above
              Reviewer1066 Community Member

              Unfortunately, FrameMaker does not have a Above the Line format for graphics, just below the line.

               

              My suggestion is a semi-variant approach. You could write a simple XSLT that inverted the order of the title and graphic elements, so a figure element would be

               

              <figure><graphic/><title>The Title</title></figure>

               

              FrameMaker would treat the figure element as a paragraph (with a blank line) with the graphic positioned below the line. Then the title would follow the graphic. This requires changing the EDD (NOT the source DTD) to make the change valid (changing the EDD is really only necessary if you want to validate the structure within FrameMaker). Also change the paragraph tag for the title element to keep with previous paragraph, to make sure there is no page break between the graphic and the title.

               

              If you also need to be able to edit in FrameMaker and then output to XML, then you would have to create an XSLT that reverses title and graphic elements to one that satisfies the DOD DTD.

               

              This is not ideal, because it changes the structure instead of the formatting (Scott's point), but it might be sufficient to get the documents printed.

               

              Van

              • 4. Re: How to get the Figure Title to appear below the graphic, not above
                convextech67 Community Member

                I decided to go with changing the DTD and the EDD to reflect the figure & subfig titles being below the graphics. I validated the DTD and then made the changes to the XML, and it validates as well. But now when I bring it into FrameMaker, the xrefs are all gone. I mean, text shows up as "See Figure." instead of "See Figure 1-1.". When I went into the Cross Reference tool, no elements are listed. None of my figures or tables exist.

                • 5. Re: How to get the Figure Title to appear below the graphic, not above
                  ScottPrentice Community Member

                  Hmm. Did your cross-refs target the figure or title elements? If the figure, then nothing should have changed, except that if the reference was trying to extract the title text from the title (first child of figure), it can't do that now since the graphic is in the way. But if you're just using figure numbers, then this shouldn't be an issue.  If you're referencing the title, then again, that shouldn't be a problem as long as you used the same definition for the title in its new location (probably needs an ID attribute, and the ID would probably need to be defined as an idref) .. but as long as you didn't change the title definition it should be fine. All you needed to do was to modify the general rule of the figure element to "graphic, title" instead of "title, graphic".

                   

                  I'm thinking that you probably changed more than you needed to. Roll back and just make the change to the general rule, see if that helps.

                   

                  ...scott

                  • 6. Re: How to get the Figure Title to appear below the graphic, not above
                    convextech67 Community Member

                    In the EDD I have xref setup as a cross-reference using the attribute "type" to determine what xref format to use. I added "type" to xref in the DTD and added the appropriate types to the xrefs in the XML data.

                     

                    The xrefs target the figure element, and its text was formatted with Element Paragraph Format "figure". The xrefs were working, no problem, when the title was the first child in figure, because I had no need to tell it any different; I thought there would be some way to get the title to "appear" below the graphic.

                     

                    When I changed the title to go under the graphic in the DTD and in the XML, the Element Paragraph Format was still "figure" for the figure element, so the xrefs did show up, but the title was above AND below the graphic, and therefore was numbered incorrectly (twice per graphic).

                     

                    So in the EDD I changed the figure's title to format on "figuretitle" and removed autonumbering on "figure". Now I'm back to the xrefs not showing up again.

                     

                    Some figures have subfigs, which are sheets of the one figure. So I have paragraph formats setup and read/write rules that will set the {first} subfig to the figure number & title with Sheet 1, and if the subfigs are {notfirst}, they keep the same figure number but increment the sheet numbers. This displayed & xref'd fine til I moved the dang title. :-\

                    • 7. Re: How to get the Figure Title to appear below the graphic, not above
                      ScottPrentice Community Member

                      Yeah .. a bit of a mess, eh? The easiest thing to do is to make the xrefs point at the title instead of the figure. This isn't really a "best practice", but is the easiest way to handle cross-refs in this situation. Of course, this totally breaks your existing XML, but in theory should work better once all of the references are re-linked.

                       

                      I didn't realize that you were dealing with xrefs, or I would have mentioned these issues earlier in this thread.

                       

                      Cheers,

                       

                      ...scott

                      • 8. Re: How to get the Figure Title to appear below the graphic, not above
                        convextech67 Community Member

                        So you're saying put my xrefs in the title in the XML and DTD? I have full

                        control and all bets were off when I moved the title, so I'm ok with

                        whatever I have to do. This DTD set will always be a variant for FrameMaker

                        anyway.

                        • 9. Re: How to get the Figure Title to appear below the graphic, not above
                          ScottPrentice Community Member

                          Well .. don't put the xrefs in the title, but create your xrefs so the reference the titles rather than the figures. You'll need to add IDs to the titles, then re-reference the xrefs so they point at the title elements. This should make it so it doesn't matter where the titles are.

                           

                          ...scott

                          • 10. Re: How to get the Figure Title to appear below the graphic, not above
                            convextech67 Community Member

                            Here's where I'm muddy on this. In the EDD under xref (CrossReference) I

                            have choices of figure, table, etc. If context type=figure, use

                            cross-reference format figure. Doesn't this point to the xref format in FM?

                            • 11. Re: How to get the Figure Title to appear below the graphic, not above
                              ScottPrentice Community Member

                              I'd have to see the EDD to say for sure, but if the xref has a type attribute that's set to match the target of the xref, you'd still want to set the @type to "figure" even if you're referencing the title, since you want a "figure" cross-ref format. Do you manually set the @type attribute? This is probably just controlling the format of the cross-ref, it has no bearing on the actual target of the xref.

                               

                              Does that help?

                               

                              ...scott

                              • 12. Re: How to get the Figure Title to appear below the graphic, not above
                                Reviewer1066 Community Member

                                Here's where I'm muddy on this. In the EDD under xref (CrossReference) I

                                have choices of figure, table, etc. If context type=figure, use

                                cross-reference format figure. Doesn't this point to the xref format in FM?

                                This is probably just controlling the format of the cross-ref, it has no bearing on the actual target of the xref.

                                Scott is correct. I have accidentally set my cross-reference target to a figure and selected a format for a section. The cross-reference target is good but the format is inappropriate. The EDD cannot, and does not, select the target; you have to do that.

                                 

                                Van

                                • 13. Re: How to get the Figure Title to appear below the graphic, not above
                                  convextech67 Community Member

                                  Yes, I knew that xref (CrossReference) in the EDD corresponds to the Cross-reference format in FrameMaker. I was just clarifying this.

                                   

                                  <waah>The worst part of this is that Adobe's documentation is unclear and contradicts each other in different documents so all of this is trial and error. I am not always sure what works when I do something, and what it was that I changed to make it work, so I'm having to go through one change, try to open the doc, see what it did, then move on to the next try if that didn't work, while copying the EDD and template each time so that I can go back to another iteration if needed. </waah>

                                  • 14. Re: How to get the Figure Title to appear below the graphic, not above
                                    ScottPrentice Community Member

                                    I've not found the documentation to be contradictory, but it is quite complex. Unfortunately, there are a number of version of the Structure Application Developer's Guide floating around, and at some point it was split into a Guide and Reference. It's possible that in the updating process things have cahnged (I still refer to the single document version that shipped with FM7.2.)

                                     

                                    FM8 versions of this documentation is here ..

                                     

                                         http://www.adobe.com/support/documentation/en/framemaker/#structured

                                     

                                    FM9 versions are here ..

                                     

                                         http://www.adobe.com/devnet/framemaker.html

                                     

                                    For fundamental stuff like that which you're working on hasn't changed for ages, so it shouldn't matter which version of the docs you use, although you'd hope that the most recent is the most correct. Just use the Structure Application Guide and Reference .. other docs that reference this information are likely to be wrong.

                                     

                                    Note also that you don't have to go through the whole process of updating the EDD, importing it into the template, etc .. you can just update the EDD and import that directly into a text document. Edit EDD, import, test, repeat .. not too bad.

                                     

                                    Good luck!

                                     

                                    ...scott

                                    • 15. Re: How to get the Figure Title to appear below the graphic, not above
                                      Reviewer1066 Community Member

                                      Note also that you don't have to go through the whole process of updating the EDD, importing it into the template, etc .. you can just update the EDD and import that directly into a text document. Edit EDD, import, test, repeat .. not too bad.

                                      This is true; HOWEVER, if one tries to import an EDD into an entire book, FrameMaker gets confused and at some point complains (I cannot remember the actual complaint), even though all is OK for a single document. So, I import the EDD into the template file to make sure all is correct; then import the EDD from the template into the entire book. FrameMaker does not get confused when I do it from the template.

                                       

                                      Van

                                      • 16. Re: How to get the Figure Title to appear below the graphic, not above
                                        convextech67 Community Member

                                        Would someone here be willing to give me a simple example on this? I've been struggling with it for two days and have gotten nowhere. I am at the pooint where I have to just push on ahead and do this manually somehow. I have to get a sample of the output to my customer by the end of the week.

                                         

                                        You're saying the xrefid should go in the <title> instead of in <figure>, but where in what document do I point to that ID? What I've been doing is changing the EDD around to make it point to paragraph formats, which if used properly somehow make my xref show up as a cross-reference. I have mapped the cross-references in the EDD to point to a type which I have added to the xml, like so:

                                         

                                        <figure id="abcd"><graphic boardno="abcd"><title>ABCD</title></figure>

                                         

                                        <para>For instructions A through D, see <xref type="figure" xrefid="abcd">.</para>

                                         

                                         

                                        In the EDD, I have:

                                         

                                        Element (Conatiner): title

                                        Text format rules

                                        1. If context is: {notfirst} < subfig

                                            Use paragraph format: subfigs

                                            Else, if context is: {first} < subfig

                                            Use paragraph format: subfig

                                        2. If context is {only} < figure

                                            Use paragarph format: figuretitle

                                         

                                        Element (Container): figure

                                        Text format rules

                                            Element paragraph format: figure

                                         

                                        Element (CrossReference): xref

                                        Initial cross-reference format

                                        1. If context is: [type="figure"]

                                            Use cross-reference format: figure

                                         

                                         

                                        This works as far as giving me the proper cross-reference text where the xref resides, but when <figure> is processed, that's where the cross-reference comes from, and it shows on the page on top of the graphic (I can turn that text white if I wind up diong this manually), and then I get the figure title below. I have the paragraph format for 'figure' with autonumbering under X: and 'figuretitle' has autonumbering under F: to keep them separate.

                                         

                                        Also, when any figure without subfigs appears, it gets formatted as 'figure' instead of 'figuretitle'. That's why I was trying to tell the EDD to look for the ONLY title within figure to make it 'figuretitle'.

                                         

                                        And the first subfig is getting formatted as 'subfigs' even though I have the EDD telling the first subfig title to be formatted as 'subfig' and the rest to be formatted as 'subfigs'. the goal is to have:

                                         

                                         

                                        Figure 1-1. ABCD                     <-- figuretitle

                                        Figure 1-2. EFGH (Sheet 1)     <-- subfig

                                        Figure 1-2. EFGH (Sheet 2)     <-- subfigs

                                        Figure 1-2. EFGH (Sheet 3)     <-- subfigs

                                         

                                        For instructions A - D, see Figure 1-1. For instructions E - H, see Figure 1-2.

                                        • 17. Re: How to get the Figure Title to appear below the graphic, not above
                                          Reviewer1066 Community Member

                                          You're saying the xrefid should go in the <title> instead of in <figure>, but where in what document do I point to that ID?

                                          First, to cross-reference an element, the target element has to have an ID attribute. You do not have to expicitly put a value into that attribute. When you create the cross-reference in FrameMaker, you list the elements, select the title element, and select the particular instance of that element as the target. FrameMaker adds a value to the target ID attribute for you.

                                           

                                          Second, FrameMaker basically treats every element as a paragraph unless the EDD specifically states that it is to have character formatting. When you create a cross-reference to an element, the TEXT of the element is the text of the first paragraph IN the element. In your case, the graphic element is the first paragraph inside the figure element; it has a phantom (blank) paragraph above the graphic to hold the graphic marker. Then the title element is the second paragraph in the figure element. So, when you reference the figure element, the text of the first paragraph inside it is blank.

                                           

                                          Third, the same applies to autonumbering. If the cross-reference is to show the autonumber and you target the figure element, then the first paragraph in the figure is the graphic element which has that blank paragraph above it. Your EDD does not treat apply formatting, that is the autonumbering to the graphic element. Hence, the autonumbering does not display in the cross-reference. FrameMaker has no way to dig down into the figure element and extract autonumbering from its second child element. Thus, you need to target the title element itself.

                                           

                                          Rereading your post, I may not be actually answering your questions, but maybe this will clear up a few things.

                                           

                                          In the EDD, I have:

                                           

                                          Element (Conatiner): title

                                          Text format rules

                                          1. If context is: {notfirst} < subfig

                                              Use paragraph format: subfigs

                                              Else, if context is: {first} < subfig

                                              Use paragraph format: subfig

                                          2. If context is {only} < figure

                                              Use paragarph format: figuretitle

                                           

                                          Element (Container): figure

                                          Text format rules

                                              Element paragraph format: figure

                                           

                                          Element (CrossReference): xref

                                          Initial cross-reference format

                                          1. If context is: [type="figure"]

                                              Use cross-reference format: figure

                                          You do not give an example of how you are using the subfig element. But there is a problem with the title element in a figure element. The context {only} < figure means "the only child element in the figure element". This will NEVER be satisfied because title is not the only element in figure; figure also has a graphic element. NOTE {only} means only ELEMENT NOT only TITLE element. This confused me when I started creating EDDs.

                                           

                                          NOW, if I assume the subfig structure should be something like:

                                           

                                          <figure>

                                          <subfig><graphic/><title></subfig>

                                          <subfig><graphic/><title></subfig>

                                          <subfig><graphic/><title></subfig>

                                          .

                                          .

                                          .

                                          </figure>

                                           

                                          Then the context {first} < subfig is NEVER satisfied because title is NEVER the first element inside subfig but {notfirst} < subfig is always true, because title is never the first element inside subfig. Hence, all title elements inside subfig elements are tagged with the subfigs tag, never subfig.

                                           

                                          I am thinking the contexts should be:

                                           

                                          subfig {first} < figure

                                          subfig {notfirst} < figure

                                           

                                          Remember these are contexts for the title element. The first is a title element in the first subfig element in a figure element; and the second is a title in a subfig that is not the first element in a figure element.

                                           

                                          Figure 1-1. ABCD                     <-- figuretitle

                                          Figure 1-2. EFGH (Sheet 1)     <-- subfig

                                          Figure 1-2. EFGH (Sheet 2)     <-- subfigs

                                          Figure 1-2. EFGH (Sheet 3)     <-- subfigs

                                           

                                          For instructions A - D, see Figure 1-1. For instructions E - H, see Figure 1-2.

                                          I am assuming you are manually entering Sheet 1, Sheet 2, etc in the title elements of each subfig element. It is not clear from your posts where the autonumber is displayed. Is it displayed in front of the title or above the graphic? If the title element carries the autonumbering, then you need to target the title element and not the figure element. If the autonumber is in that "blank" line above the graphic, then you can target the figure element because its first paragraph displays the autonumber.

                                           

                                          I believe I have gone on way too much, but hope something in the above is the answer to your problem. See if any of this helps and then post again. Maybe we can get this figured out...pun intended.

                                           

                                          Van

                                          • 18. Re: How to get the Figure Title to appear below the graphic, not above
                                            convextech67 Community Member

                                            LOL Thanks for your graphic representation of the problem (pun intended)!!! This worked. I didn't realize that {only} meant only element, not just only title element. Jeez. The xrefs are working now also because I have figure pointing to figure and title within figure pointing to figure title with the same autonumbering but on a different "thread" (X instead of F), and subfig element is now subfigure, which makes the xrefs come out exactly the way I need without managing ids within the titles.

                                             

                                            Thank you so much!!!