Answers.Body: <p>Ultimately, it depends on which ereader devices you want to support.</p>
  
  <p>Unless you are making a fixed layout book, the only method that will work 100% of the time is to make the caption a part of the image. Since epub and mobi are reflowable document formats, there is always a possibility that the device being used to view the document will push a text caption on the next page. However, devices do not usually split images across more than one page.</p>
  
  <p>While I have used the text-in-image solution in the past, I don't personally recommend it, since images can be displayed at many different sizes and resolutions depending on the device or screen. It may be difficult for readers to read the caption while viewing on their phone, but the caption may look unusually large compared to body text on a computer screen. People using an e-ink reader may find the image text grainy or difficult to read. I agree that it is undesirable for the caption to get orphaned from its image, but I think that most readers of ebooks are accustomed to these kinds of text-flow failures, and would prefer the text being on the next page over not being able to read the text at all.</p>
  
  <p>If you would like to do the best you probably can, you could try wrapping your image and caption in a <code>&lt;div&gt;</code> with <code>page-break-inside: avoid;</code> styling, but support for this CSS property is not universal, so you are still at the mercy of the device. </p>
  
  <p>Some people prefer to use <code>page-break-before: always;</code> before the image, but this also has drawbacks. (You can end up with only one or two lines of text on a page and then a forced page-break for the image.)</p>
  
  <p>In the event that all of the devices you plan to support can handle SVG tags, you could wrap the image in <code>&lt;svg&gt;</code> and include the text caption inside the SVG tag with the image. I have heard this works very well (but it requires SVG support).</p>
  
  <p>If you're still interested in other more complicated ideas, you can check <a href="https://www.mobileread.com/forums/showthread.php?t=166836" rel="nofollow noreferrer">this thread on the MobileRead forums</a>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-23T04:54:28.587Z
Answers.LastActivityDate: 2017-03-23T04:54:28.587Z
Answers.UserDisplayName: blendenzo
Answers.Body: <p>Here's a practical suggestion. Download or buy one of the epub files by Oreilly publishers (or some other technical publishers). (They may even have some free downloads available). </p>
  
  <p>Then rename the .epub to .zip and then unzip the files. Open in a browser, turn to a chapter with graphics and captions or titles and see how they solved the issue by inspecting the css (a right-click browser option). </p>
  
  <p>Blendezo's solution is the preferred solution, but note that 1)Google Books historically haven't supported page-oriented css very well and 2)although Kindle supports image scaling, it does it automatically and sometimes can disregard the css (particularly in smaller devices). You will have to use css media queries. </p>
  
  <p>If the images and captions are an important part of the ebook, I think it's fair to say that it is supported only for medium-to-large tablets.</p>
  
  <p>One compromise is to put the images at the end or beginning of chapters -- where it's less likely for these issues to arise. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-24T13:29:34.743Z
Answers.LastActivityDate: 2017-03-24T13:29:34.743Z
Answers.UserDisplayName: idiotprogrammer
Body: <p>I have written a book in Microsoft Word with a lot of images. But I am facing issues that the titles that I have given are going in the next page.</p>
  <p>I understand I can resize the images but I wanted to tie the captions with the image. Even if I convert it to other format like mobi/epub, if it does not fit on the page let the image be scaled down in that format.</p>
  <p>Is there any way to achieve this in Word or epub or mobi formats?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-01-19T20:18:46.353Z
Comments.Text: I don't quite understand which part of my sentence you found "shaming". I was trying to be as polite as I could.
Comments.UserDisplayName: trejder
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-01-21T16:29:22.160Z
Comments.Text: @beaker Can't really address your arguments as I don't understand what's your point. I don't like ugly written text. If someone omits capital letters in many posts, gets many comments. Can't be simpler. Sorry, but I completely don't see a point in continuing this kind of discussion. Have a good day.
Comments.UserDisplayName: trejder
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-01-21T17:45:03.807Z
Comments.Text: @beaker So, you check each user profile, when you are editing a question and you are not posting any comment (or doing nothing? I am puzzled), if that person hasn't been here for a longer period of time, right? OK, so after spending 10 years in SE I am used to a little bit different approach. Comment can be seen by others not just OP. You can do with my comments whatever you wish to do. I would like to stop this discussion, please.
Comments.UserDisplayName: trejder
Tags: <epub><mobi><image>
Title: Any way to keep captions of the images always with the image?
UserDisplayName: Amol Patil
ThreadText: # Any way to keep captions of the images always with the image?
  
  (Asked by: username_0 on 2017-03-22)
  
  I have written a book in Microsoft Word with a lot of images. But I am facing issues that the titles that I have given are going in the next page.
  
  I understand I can resize the images but I wanted to tie the captions with the image. Even if I convert it to other format like mobi/epub, if it does not fit on the page let the image be scaled down in that format.
  
  Is there any way to achieve this in Word or epub or mobi formats?
  
  **Tags:** epub, mobi, image
  
  > **Comments:**
  > **username_1**: I don't quite understand which part of my sentence you found "shaming". I was trying to be as polite as I could.  
  > **username_1**: @beaker Can't really address your arguments as I don't understand what's your point. I don't like ugly written text. If someone omits capital letters in many posts, gets many comments. Can't be simpler. Sorry, but I completely don't see a point in continuing this kind of discussion. Have a good day.  
  > **username_1**: @beaker So, you check each user profile, when you are editing a question and you are not posting any comment (or doing nothing? I am puzzled), if that person hasn't been here for a longer period of time, right? OK, so after spending 10 years in SE I am used to a little bit different approach. Comment can be seen by others not just OP. You can do with my comments whatever you wish to do. I would like to stop this discussion, please.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2017-03-23. Score: 2 | Accepted answer
  
  Ultimately, it depends on which ereader devices you want to support.
  
  Unless you are making a fixed layout book, the only method that will work 100% of the time is to make the caption a part of the image. Since epub and mobi are reflowable document formats, there is always a possibility that the device being used to view the document will push a text caption on the next page. However, devices do not usually split images across more than one page.
  
  While I have used the text-in-image solution in the past, I don't personally recommend it, since images can be displayed at many different sizes and resolutions depending on the device or screen. It may be difficult for readers to read the caption while viewing on their phone, but the caption may look unusually large compared to body text on a computer screen. People using an e-ink reader may find the image text grainy or difficult to read. I agree that it is undesirable for the caption to get orphaned from its image, but I think that most readers of ebooks are accustomed to these kinds of text-flow failures, and would prefer the text being on the next page over not being able to read the text at all.
  
  If you would like to do the best you probably can, you could try wrapping your image and caption in a `<div>` with `page-break-inside: avoid;` styling, but support for this CSS property is not universal, so you are still at the mercy of the device.
  
  Some people prefer to use `page-break-before: always;` before the image, but this also has drawbacks. (You can end up with only one or two lines of text on a page and then a forced page-break for the image.)
  
  In the event that all of the devices you plan to support can handle SVG tags, you could wrap the image in `<svg>` and include the text caption inside the SVG tag with the image. I have heard this works very well (but it requires SVG support).
  
  If you're still interested in other more complicated ideas, you can check [this thread on the MobileRead forums](https://www.mobileread.com/forums/showthread.php?t=166836).
  
  
  ---
  
  ### Answer by username_3 on 2017-03-24. Score: 1
  
  Here's a practical suggestion. Download or buy one of the epub files by Oreilly publishers (or some other technical publishers). (They may even have some free downloads available).
  
  Then rename the .epub to .zip and then unzip the files. Open in a browser, turn to a chapter with graphics and captions or titles and see how they solved the issue by inspecting the css (a right-click browser option).
  
  Blendezo's solution is the preferred solution, but note that 1)Google Books historically haven't supported page-oriented css very well and 2)although Kindle supports image scaling, it does it automatically and sometimes can disregard the css (particularly in smaller devices). You will have to use css media queries.
  
  If the images and captions are an important part of the ebook, I think it's fair to say that it is supported only for medium-to-large tablets.
  
  One compromise is to put the images at the end or beginning of chapters -- where it's less likely for these issues to arise.
  
  
  ---
  
  