Keeping caption and figure together

For all things Mellel

Moderators: Eyal Redler, redlers, Ori Redler

Post Reply
laup
Knows everything, can prove it
Posts: 311
Joined: Tue Aug 22, 2006 4:13 am
Location: Topanga, California

Keeping caption and figure together

Post by laup »

I have an auto-title and style for Figure Title. The style specifies next paragraph as Figure Placement. I use this to insert figures that are typically .png images.

How do I assure that the figure title and image remain together, rather than separated by a page break? There is a setting "Keep with next", where one specifies the number of lines in the next paragraph, but this does not seem to work when the next paragraph is an image.
Paul
Icelander
Knows everything, can prove it
Posts: 366
Joined: Mon Aug 18, 2014 10:59 pm

Re: Keeping caption and figure together

Post by Icelander »

I have an auto-title and style for Figure Title. The style specifies next paragraph as Figure Placement.
Just to make sure I get this right. You have a tag flow and paragraph styles called "Figure Title" and "Figure Placement". Right?
The figure caption (in your case "Figure Title") is normally followed by a paragraph style called "Body", or something similar. I don't understand why you call this style Figure Placement…
How do I assure that the figure title and image remain together, rather than separated by a page break?
In the Setup pane (where the auto-titles and the tag flows are) there is a drop-down menu called "Insert Before". It seems you have chosen "Page break" instead of "Return".
There is a setting "Keep with next", where one specifies the number of lines in the next paragraph, but this does not seem to work when the next paragraph is an image.
I think the paragraph style "Figure Placement" is superfluous. You only need two styles for this, if I understand the problem correctly. This is what I do:

1. Insert the image. It remains selected.
2. Deselect the image and place the insertion point after the image.
3. Double-click on the tag flow in the Auto-Title pane
4. This will insert the tag flow in a new line with the text UNTITLED selected
5. Replace the text UNTITLED with the image name.

The figure title and image remain together.
laup
Knows everything, can prove it
Posts: 311
Joined: Tue Aug 22, 2006 4:13 am
Location: Topanga, California

Re: Keeping caption and figure together

Post by laup »

Sorry, I apparently did not explain well. Here's the picture


Text... (paragraph style)
Figure Caption (a tag flow with Figure Caption style)
Image (e.g., a .png) (Figure Placement style)
Text (paragraph style)

If all of this appears low on a page, then Mellel may insert a page break between Figure Caption and Image. I want Figure Caption and Image to remain together.

In response to your message:
-- I use the "Figure Placement" style because that style is used in a Word template used by my publications department. I have one Mellel style set intended to be as close as possible to that standardized Word template. The function of the style Figure Placement is to specify that the inserted figure is centered and has a specified spacing before and after it. Also, having a separate style for the image assures that the image itself does not appear in a table of contents.
-- the style for Figure Caption has "Return" for Insert Before
--I was thinking that the issue was akin to keeping lines of a paragraph together. Thus, in the definition of the paragraph style Figure Placement, I have clicked "Keep lines together" and tried different numbers for the subsequent settings Lines at start, Lines at end, and Keep with next. The unwanted page breaks still occur sometimes, splitting caption from image.
-- If I follow your admonition at the bottom or your message, the title is below the image rather than before. Also. In my experiment just now, Mellel still inserts a page break between image and caption if the image just barely fits at the bottom of the page.
Paul
Icelander
Knows everything, can prove it
Posts: 366
Joined: Mon Aug 18, 2014 10:59 pm

Re: Keeping caption and figure together

Post by Icelander »

Ah, so you want the caption to be *above* the figure, now I understand. :–)
There is a setting "Keep with next", where one specifies the number of lines in the next paragraph, but this does not seem to work when the next paragraph is an image.
The Keep-with-next-field in the Paragraph style palette has a jam stoppage. Hit the Return key and the Save button will become active. I entered 2 in the field, clicked the Save button, placed both caption and figure at the bottom of my page, then hit Return and *both* moved to the next page.
The figure title and image remained together.

Did this solve the problem?
Icelander
Knows everything, can prove it
Posts: 366
Joined: Mon Aug 18, 2014 10:59 pm

Re: Keeping caption and figure together

Post by Icelander »

The function of the style Figure Placement is to specify that the inserted figure is centered and has a specified spacing before and after it.
Yes, that makes sense. By my first test the image had the paragraph style Body, but an own paragraph style 'Figure Placement' allows for better control of where the image is placed exactly. I added this style to my test and I'm going to keep it because it's useful, although it has nothing to do with keeping lines together, of course.
It's the paragraph style 'Figure Caption' which determines whether caption and image stay together.
laup
Knows everything, can prove it
Posts: 311
Joined: Tue Aug 22, 2006 4:13 am
Location: Topanga, California

Re: Keeping caption and figure together

Post by laup »

Icelander wrote: Tue Aug 11, 2020 4:40 pm Ah, so you want the caption to be *above* the figure, now I understand. :–)
There is a setting "Keep with next", where one specifies the number of lines in the next paragraph, but this does not seem to work when the next paragraph is an image.
The Keep-with-next-field in the Paragraph style palette has a jam stoppage. Hit the Return key and the Save button will become active. I entered 2 in the field, clicked the Save button, placed both caption and figure at the bottom of my page, then hit Return and *both* moved to the next page.
The figure title and image remained together.

Did this solve the problem?
I don't know what a jam stoppage is. Did you enter 2 in the field "Keep with next"? If so, then yes, I had done that. If I create a new experimental file, then it works as you describe. I just retested this. Further, if I just insert carriage returns before a figure caption/image, then--in the fresh file--the figure caption/image moves down the page and then moves, as a block, to the next page. That is, it doesn't split. All is well.

But--in the full manuscript--page splits occur between some figure captions and images. I don't know why and have not been able to reproduce that in the simple experimental file.
Paul
Icelander
Knows everything, can prove it
Posts: 366
Joined: Mon Aug 18, 2014 10:59 pm

Re: Keeping caption and figure together

Post by Icelander »

Paul wrote:
There is a setting "Keep with next", where one specifies the number of lines in the next paragraph, but this does not seem to work when the next paragraph is an image.
In my test I entered several numbers into the keep-with-next field, but the Save button was grayed out, making it impossible to save the changes. I thought you were referring to this behavior; this looks like a bug. It was not until I hit the Return key that the Save button came to life. Anyway, this behavior reminded me of a jammed gun, when a bullet doesn't properly slide into the chamber and instead gets stuck. Hence my characterization as jam stoppage.
in the full manuscript--page splits occur between some figure captions and images. I don't know why
Try to copy the whole document and paste the content into a new fresh document. Is the new document OK or is it still flawed?
If this doesn't help, you can send me the document and I'll take a look at it. If it contains sensitive information you can use a FindSet to scramble the text. This will make the text unreadable, but will leave all formatting elements—including figures and images—in tact. If you don't have such a FindSet, I can send you one or upload one for you. Send me a private message.
laup
Knows everything, can prove it
Posts: 311
Joined: Tue Aug 22, 2006 4:13 am
Location: Topanga, California

Re: Keeping caption and figure together

Post by laup »

I have put a-two-page file illustrating the problem is at

http://www.mediafire.com/file/xeo5tbkt1 ... ellel/file
Paul
Icelander
Knows everything, can prove it
Posts: 366
Joined: Mon Aug 18, 2014 10:59 pm

Re: Keeping caption and figure together

Post by Icelander »

The culprit is the figure. Double click on it and uncheck the check-box "Image causes wrap." Caption and figure are now together.
laup
Knows everything, can prove it
Posts: 311
Joined: Tue Aug 22, 2006 4:13 am
Location: Topanga, California

Re: Keeping caption and figure together

Post by laup »

Wow, I never thought of that! Is this effect a bug or a feature? I don't understand the logic that must be driving this. It may be compelling.

For years, I have used in-line wrapped figures because, when I have not, I have run into very annoying problems with exported versions of the manuscript. I don't remember details right now, but they were probably exports to Word (before the recent upgrade of Mellel 5) or to pdf, followed by applying Aodobe's tool for translating a pdf document into a .docx document.

Thanks for the sleuthing.
Paul
laup
Knows everything, can prove it
Posts: 311
Joined: Tue Aug 22, 2006 4:13 am
Location: Topanga, California

Re: Keeping caption and figure together

Post by laup »

I have done further checking. I ran into problems previously when I inserted images in pdf format (making it possible for publishers to edit figures without having my original drawing-program files). As I recall, this created problems with some journals because they would translate the pdfs into Word documents and figures got mangled.

I know that I have such troubles if I (1) export a Mellel manuscript with pdf images to pdf, (2) open the pdf in Adobe Reader, and (3) apply the Adobe tool that translates a pdf into Word. I just reproduced that problem. Some figures are mangled.

Bottom line: I am pretty sure that I will now be ok if I turn off wrap as you suggest and use .png images, rather than pdf images. Thanks.
Paul
Icelander
Knows everything, can prove it
Posts: 366
Joined: Mon Aug 18, 2014 10:59 pm

Re: Keeping caption and figure together

Post by Icelander »

Is this effect a bug or a feature?
Feature, I guess, but if you want to know for sure you'll have to ask the Redlers.

Thanks for the sleuthing.
You are welcome, Paul.
Post Reply