Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
As FM so far lacks Frame-Above, what you descibe is what I've always done for captions.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Hi Matt,
What I want to achieve is to be able to place figure plus its figure title according to the following:
So, these are the options that I can see and none are working:
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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).
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
You seem to have arrived at your four possible paths:
Copy link to clipboard
Copied
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);
}
}
Copy link to clipboard
Copied
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
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more