Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 12-02-2012, 08:51 PM   #1
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 1,444
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
Joining image and title

Hi

I am preparing an illustrated book. I'd like to join a title and a full page image, so that the title appears on the TOC but the reader can only see the image.

Here is the current code I would like to improve. If somebody was so kind as to give me the answer... Now I have the title on one page and the image on the next page... which is not the intended effect.

Code:
<body >
  <h2 id="toc0">LA LIONNE</h2>

  <div style="text-align:center"><img alt="images1" class="frameGraphics" id="images1graphic" src="../Images/image003.jpg" style="width:100%" /></div>
</body>
roger64 is offline   Reply With Quote
Old 12-02-2012, 08:59 PM   #2
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,846
Karma: 5654321
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Moderator Notice
This is a EPUB question. Moving to EPUB
theducks is offline   Reply With Quote
 
Enthusiast
Old 12-02-2012, 10:11 PM   #3
Aerys
Connoisseur
Aerys is faster than slow light.Aerys is faster than slow light.Aerys is faster than slow light.Aerys is faster than slow light.Aerys is faster than slow light.Aerys is faster than slow light.Aerys is faster than slow light.Aerys is faster than slow light.Aerys is faster than slow light.Aerys is faster than slow light.Aerys is faster than slow light.
 
Aerys's Avatar
 
Posts: 51
Karma: 29994
Join Date: Nov 2011
Location: Manila, Philippines
Device: iPad 2 & Nexus 7
Use a CSS style "visibility:hidden" for the h2 tag. Please note that the "title" is hidden but it's still occupying a space in the page.

Code:
<body >
  <h2 id="toc0" style="visibility:hidden">LA LIONNE</h2>

  <div style="text-align:center"><img alt="images1" class="frameGraphics" id="images1graphic" src="../Images/image003.jpg" style="width:100%" /></div>
</body>
Another way, is just to remove the "title" altogether and put the anchor "id" of the TOC to the DIV.
Aerys is offline   Reply With Quote
Old 12-02-2012, 10:53 PM   #4
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 1,444
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
@Aeris

Thank you for your reply.

I did not know visibillity:hidden. Looking on the web about this expression, I could also find display:none which seems to be more convenient because I wish to use a full-page image. As all my h2 titles are going to be replaced by images, I just added display:none to the h2 CSS and it seems to do what I wished.

roger64 is offline   Reply With Quote
Old 12-03-2012, 12:02 AM   #5
GrannyGrump
Persnickity Nitpicker
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 565
Karma: 2634542
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
You could also try this way, putting the Chapter Name in a "title" and leaving the <h> tags empty.
I've used it sometimes when using an image for a chapter heading. I use Sigil, and it will generate the automatic TOC using the "title". Also useful to use this if you want the TOC to have different wording than the page display, you can put a different name in the <h> tags.

Code:
<body >
  <h2 id="toc0" title="LA LIONNE"></h2>

  <div style="text-align:center"><img alt="images1" class="frameGraphics" id="images1graphic" src="../Images/image003.jpg" style="width:100%" /></div>
</body>
GrannyGrump is offline   Reply With Quote
Old 12-03-2012, 05:02 AM   #6
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,193
Karma: 4800739
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Also, "visibility: hidden" is not suported by the ePub 2.1 spec, so you shouldn't rely on it (even when that's what you need).

By the way, you don't need an <h2> at all if you don't want it displayed. You may want it to get other tools to automatically create the TOC, but you could always create (or edit) the TOC manually inserting the titles where you need them.

Last edited by Jellby; 12-03-2012 at 05:04 AM.
Jellby is offline   Reply With Quote
Old 12-03-2012, 05:53 AM   #7
mrmikel
Book Twiddler
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,086
Karma: 1444487
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
Roger64,

Be sure and check out anything that doesn't display on the Reader Library or your 505 not just in Sigil or Calibre. As was pointed out, it doesn't display, but it can leave a hole where it would be. On your title page, it might not matter at all, but in text I have found it very annoying, where pages numbers are invisible, but the space where they would have been is not, with a gap like this in the middle of a line.
mrmikel is offline   Reply With Quote
Old 12-03-2012, 06:54 AM   #8
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 1,444
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
Thanks for your comments.

I added to the h2 CSS of the EPUB the argument display:none

- The TOC is displayed where the TOC should be.
- The h2 titles are not displayed on the page and leave no hole. They just disappear into thin air.

Just perfect. But... when I convert this EPUB to PDF using Prince, I have some display problems (no TOC, faulty display for images). So, even if the above solution is handy for the EPUB, I still need to find another one acceptable for Prince.

To come back to my first idea, is it possible to enhance the div containing the image with some id tag so that it can be displayed in the TOC?

Last edited by roger64; 12-03-2012 at 06:57 AM.
roger64 is offline   Reply With Quote
Old 12-03-2012, 07:12 AM   #9
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,261
Karma: 42123822
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by roger64 View Post
To come back to my first idea, is it possible to enhance the div containing the image with some id tag so that it can be displayed in the TOC?
You don't need to "enhance" any of the (x)html or css to display whatever your heart desires in the ToC. As Jellby already mentioned earlier; simply modify the toc.ncx file manually. All the h tag and "visibility: none" trickery is only necessary when you want to generate a ToC automatically using other tools.
DiapDealer is offline   Reply With Quote
Old 12-03-2012, 07:47 AM   #10
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 1,444
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
Quote:
Originally Posted by DiapDealer View Post
You don't need to "enhance" any of the (x)html or css to display whatever your heart desires in the ToC. As Jellby already mentioned earlier; simply modify the toc.ncx file manually. All the h tag and "visibility: none" trickery is only necessary when you want to generate a ToC automatically using other tools.
OK It will be a good opportunity to learn something new because, up to now, I used, as you say, "other tools" to generate automatically a ToC and never bothered about it.
roger64 is offline   Reply With Quote
Old 12-03-2012, 11:00 AM   #11
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,193
Karma: 4800739
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
But if your problem is conversion with Prince (and my epubutils.py tool), fiddling with the NCX TOC won't help, because the PDF TOC (aka bookmarks) is generated from the XHTML through CSS.

(I'll have a look at the sample you sent me by PM.)
Jellby is offline   Reply With Quote
Old 12-03-2012, 11:27 AM   #12
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,193
Karma: 4800739
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
By the way, in that case something like this could be what you need:

Code:
<h2 title="LA LIONNE">
  <img alt="" class="frameGraphics" src="../Images/image003.jpg" />
</h2>
Just set the CSS for <h2> to center alignment and so on... Sigil will create the NCX TOC file for you. And you can make Prince do the same for the PDF.
Jellby is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Title bulk edit match - to remove series info from title Rob557 Library Management 25 09-22-2014 10:11 PM
Pubit!/Add Title Previewer shows ellipsis in title bar schooner1892 General Discussions 0 09-15-2012 07:04 PM
Just joining burk Introduce Yourself 3 04-26-2012 06:46 PM
Just Joining mijugama Introduce Yourself 6 04-19-2011 11:24 AM
Can I auto enter numbers to title/title sort? blu- Library Management 19 02-16-2011 01:01 PM


All times are GMT -4. The time now is 04:06 AM.


MobileRead.com is a privately owned, operated and funded community.