Skip navigation
Currently Being Moderated

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

Jul 18, 2012 9:19 AM

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.

 
Replies
  • Currently Being Moderated
    Jul 18, 2012 9:51 AM   in reply to convextech67

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 19, 2012 10:35 AM   in reply to convextech67

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 19, 2012 2:25 PM   in reply to convextech67

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 20, 2012 9:31 AM   in reply to convextech67

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 20, 2012 11:45 AM   in reply to convextech67

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 22, 2012 8:58 PM   in reply to convextech67

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 23, 2012 5:35 AM   in reply to convextech67

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 23, 2012 9:23 AM   in reply to convextech67

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 23, 2012 10:16 AM   in reply to saprentice

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 25, 2012 11:07 AM   in reply to convextech67

    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

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points