Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Floating graphics with captions

Participant ,
Aug 28, 2024 Aug 28, 2024

Greetings,

 

Am I correct in assuming that the only way to have figures with captions that float and can be programmatically placed, e.g., at top of column, at bottom of column etc. is to use an anchored frame that is taller than the graphic and insert a text box inside the bottom of the frame?

 

Obviously, I cannot use the "one row table with the table title at bottom" method, since tables cannot float at the same time as they are programmatically placed, e.g., at top of column, at bottom of column etc. Those choices are mutually exclusive. Which - if I'm not missing something - is a major disadvantage that I cannot understand is not fixed yet.

 

And I can neither use an anchored frame with a next para tag for the figure title, as that title is kept with the insertion point and not the programmatically repositioned anchored frame e.g. on the next page.

 

Am I missing any other methods?

 

/Mats

1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 29, 2024 Aug 29, 2024

As FM so far lacks Frame-Above, what you descibe is what I've always done for captions.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 30, 2024 Aug 30, 2024

I'm not sure if I completely follow your needs here, but it sounds like you are describing my rationale for placing figure titles above the frame.

Not only does this solve my (perhaps not your) placement needs, it also improves the resulting hyperlinks to figure titles, as the figure isn't placed above the active window when displaying the figure title.

For me, placing the figure title in a text frame in an anchored frame causes too many issues.

 

-Matt Sullivan
FrameMaker Course Creator, Author, Trainer, Consultant
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 31, 2024 Aug 31, 2024

Hi Matt,

 

What I want to achieve is to be able to place figure plus its figure title according to the following:

 

  1. Figure and figure title shall always be kept together.
  2. Figure title shall be below the figure.
  3. The figure and its title shall be output at the top of the column (current or next), regardless of the figure's anchor point.
  4. The figure and its title shall float, i.e., any space on the page after the figure's anchor point shall be filled with the text that follows.

 

So, these are the options that I can see and none are working:

 

  1. Cannot use the method with a graphic in a 1 row, 1 column table with a table title below, as tables cannot float and have "Top of column" placement.
  2. Cannot use an anchored frame (with float and "Top of column") where a figure title para tag follows the anchor point para tag (keep with next for the anchor point para tag), as the anchor point para tag is not included in FrameMaker's "Top of column" forced placement.

 

This is such a basic usage scenario in figure management in technical documentation that I am convinced I am missing something. The only solution I can come up with is is to use an anchored frame that is taller than the graphic and insert a text box inside the bottom of the frame. But this is really cumbersome.

 

If Adobe made "Float" for tables into a checkbox (as it is for anchored frames) instead of a dropdown menu choice, this would be a walk in the park.

 

Mats

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2024 Aug 31, 2024

Either an Anchored Frame or a Table could be used, with the properties of the anchoring para set to Top of Column.

The anchoring para could be empty, but I usually have it contain an autonumber text of "¶TableAnchor" or "¶FrameAnchor", and the para set to a color named Authoring, switched on and off in Color Views.

For ¶FrameAnchor, At Insert Point, and Keep With Next for caption as next para. Centering the caption would require some hack if the frame isn't full column width.

For ¶TableAnchor, the double-negative vertical spacing trick would be needed, to align the Table top at top of column.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 31, 2024 Aug 31, 2024

Thanks Bob for spending time pondering about this.

However, a table cannot have the "Float" AND the "Top of column" property at the same time. They are mutually exclusive in the dropdown menu.

And if you use an anchored frame as per your description and set it to "Top of column" AND select the "Float" checkbox, the frame is split from its figure title so that doesn't work either.

Mats

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 01, 2024 Sep 01, 2024

So this is apparently not satisfactory:
¶FigureAnchor:
Center, ☑Next:[Caption], Start:TopOfColumn, Keep☑Next

ΔAnchored Frame, in ¶FigureAnchor:
Pos: at Insertion Point
¶Caption:
Center, Anywhere, Keep☑Prev

 

What this won't do is place the figure at the top of the current column, unless it's the leading para.

 

Or put another way, you don't just need Float, you need control over float to where (which FM doesn't do).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 03, 2024 Sep 03, 2024

Hi Bob,

 

Not, it doesn't work because this method doesn't backfill the empty area between the original anchoring position and the forced new position. See enclosed test.

 

Actually, FrameMaker does indeed support "Float" and "Top of column" properties at the same time, but only for anchored frames per se, not for an anchored frame that you want to be tied to a caption. So if you change the placement property for the anchored frame to "Float" and "Top of column" and the AnchorFigure > Pagination  to "Anywhere", the empty space is backfilled but the caption is now untied from the frame.

 

Mats

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 03, 2024 Sep 03, 2024

Thanks for the correction, Mats.

This would then tend to argue for putting a Text Frame in the AF.

And in a prior situation, that's what I did. The TF further used a Table for the caption, which had 3 columns, for Meta, Caption and ObjectID. Meta was document steward info about the graphic type, scale, transforms; hidden by Color View for pub. Caption was just a "Figure ## \r text-string" autonumber. ObjectID was an n-digit accession number assigned enterprise-wide.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 04, 2024 Sep 04, 2024

You seem to have arrived at your four possible paths:

  • Convince Adobe to engineer either frames or tables to meet your standard
  • Use an anchored frame containing a text frame with your title
  • Convince your standards honcho that adjusting the presentation of the figure title is significantly easier than changing your editing tool
  • Change tools

 

-Matt Sullivan
FrameMaker Course Creator, Author, Trainer, Consultant
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 04, 2024 Sep 04, 2024

I created a script that adds a text frame to a selected anchor frame.
・Edit the paragraph tag name for the caption on line 7.
・Please select either an anchor frame, the contents of an anchor frame, or the anchor point of an anchor frame before running the script.
・Multiple anchor frames can be processed at once.
・Undo is not possible. Save your document before running the script.

function f_addTextFrame (aFrame){
    // Set the anchored frame position
    aFrame.AFrameIsFloating = true;
    aFrame.AnchorType = Constants.FV_ANCHOR_TOP;
    aFrame.Alignment = Constants.FV_ALIGN_CENTER;
    // The name of the paragraph tag to use in the caption (Change it as needed)
    var pgfFmt = doc.GetNamedPgfFmt("Caption"); 
    if (pgfFmt.ObjectValid()){
        var pgfFmtProps = pgfFmt.GetProps();
        // Add a text frame to an anchored frame
        var textFrame = doc.NewTextFrame (aFrame); 
        textFrame.FirstPgf.SetProps(pgfFmtProps);
        textFrame.Width = aFrame.Width;
        textFrame.Height = pgfFmt.FontSize;
        textFrame.LocY = aFrame.Height + pgfFmt.SpaceAbove;
        // Increase the height of the anchored frame
        aFrame.Height = aFrame.Height + pgfFmt.SpaceAbove + pgfFmt.FontSize + pgfFmt.SpaceBelow;
    }
}

var doc = app.ActiveDoc;
if (doc.ObjectValid()){
    var graphic = doc.FirstSelectedGraphicInDoc;
    if (graphic.ObjectValid()){
        if (graphic.type == Constants.FO_AFrame){
            // The anchor frame is selected.
            f_addTextFrame (graphic);
        } else if (graphic.FrameParent.type == Constants.FO_AFrame){
            // The contents of the anchored frame are selected.
            f_addTextFrame (graphic.FrameParent);
        }
    }
    var tr = doc.TextSelection;
    var textItems = doc.GetTextForRange (tr, Constants.FTI_FrameAnchor);
    for (var i=0;i<textItems.length;i++){
        //The anchor points of the anchor frame are selected.
        f_addTextFrame (textItems[i].obj);
    }    
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 05, 2024 Sep 05, 2024
LATEST

Bob - thanks! Also a good idea with the metadata and object ID.

 

Yatani - script works great, many thanks! 

 

Matt - this is a very basic usage scenario in figure management for technical documentation, so I wouldn't exactly call it "my standard".

 

/Mats

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines