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 09-04-2011, 12:56 PM   #151
Keroberos
Zealot
Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.
 
Keroberos's Avatar
 
Posts: 127
Karma: 194002
Join Date: Aug 2009
Device: Kobo Mini (4GB), Nook Classic wi-fi, iPod Touch (Bluefire Reader)
Multi Part Chapter Headers Using HTML Tables

I was looking for a way to have multiple items in a single line header (book# section# chapter#) spread out over the full width of the page and figured out a way to do it using a html table.

It works well in everythin I could test it in (nook classic, Bluefire Reader on my iPod Touch, Calibre, the Firefox ePub Reader, ADE 1.7.2 and 1.8 preview, and Sony Reader Library). And it converts decently to mobi using Kindlegen.

Here's the html code.
Code:
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td class="leftgrey">BOOK #</td>

      <td class="centergrey">Section #</td>

      <td class="right">Chapter #</td>
    </tr>
  </table>
  <hr />
And here's the css.
Code:
 table  { 
margin-top : 2em; 
margin-bottom : 0;
 }
 td  { 
font-family : sans-serif; 
font-size : 1.5em; 
width : 33%; 
 } 
 .left  { 
text-align : left; 
 } 
 .leftgrey  {         /* --- Use for greying out unchanging items --- */
text-align : left; 
color : #cccccc; 
 } 
 .center  { 
text-align : center; 
 } 
 .centergrey  {      /* --- Use for greying out unchanging items --- */ 
text-align : center; 
color : #cccccc; 
 } 
 .right  { 
text-align : right; 
 } 
 hr  { 
margin-top : 0; 
border : 0; 
background-color : black; 
height : 3px; 
 }
Attached Thumbnails
Click image for larger version

Name:	HTML Table Chapter Headers.jpg
Views:	221
Size:	63.4 KB
ID:	76087  
Keroberos is offline   Reply With Quote
Old 09-07-2011, 07:48 AM   #152
carmenchu
Connoisseur
carmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to all
 
Posts: 91
Karma: 159672
Join Date: Dec 2010
Device: none
Thanks.
Another point: DO or DO NOT most readers react to the addition of font-family for small-caps?
Thanks again.
carmenchu is offline   Reply With Quote
Old 09-07-2011, 09:59 AM   #153
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 2,727
Karma: 2117243
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
Most readers ignore smallcaps at the moment.
Toxaris is offline   Reply With Quote
Old 09-07-2011, 02:23 PM   #154
adv_dp_fan
Connoisseur
adv_dp_fan can name that ebook in five wordsadv_dp_fan can name that ebook in five wordsadv_dp_fan can name that ebook in five wordsadv_dp_fan can name that ebook in five wordsadv_dp_fan can name that ebook in five wordsadv_dp_fan can name that ebook in five wordsadv_dp_fan can name that ebook in five wordsadv_dp_fan can name that ebook in five wordsadv_dp_fan can name that ebook in five wordsadv_dp_fan can name that ebook in five wordsadv_dp_fan can name that ebook in five words
 
Posts: 89
Karma: 37660
Join Date: May 2010
Device: Sony 505, iPad 1 & 3, Galaxy Note 8.1
iBooks handles small-caps but one thing I noticed, if you set font-size: 1em and use small-caps, they won't display properly but setting the font-size of the small-caps to 1.1em or 0.9em and suddenly they work.
adv_dp_fan is offline   Reply With Quote
Old 09-07-2011, 03:18 PM   #155
carmenchu
Connoisseur
carmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to allcarmenchu is a name known to all
 
Posts: 91
Karma: 159672
Join Date: Dec 2010
Device: none
Tanks -- information always of value when editing.
carmenchu is offline   Reply With Quote
Old 09-09-2011, 08:36 AM   #156
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 9,384
Karma: 4531750
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2
Quote:
Originally Posted by carmenchu View Post
Thanks.
Another point: DO or DO NOT most readers react to the addition of font-family for small-caps?
Thanks again.
If you embed a font that uses only small caps and reference it then it will work but the CSS method does not work.
DaleDe is offline   Reply With Quote
Old 09-21-2011, 08:00 AM   #157
AbominableDavid
Member
AbominableDavid began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Sep 2009
Location: Tennessee
Device: PRS-505, PRS-650
My apologies if this is old hat to everyone, but it is new to me.

I've always been a little bothered by "quoted quotes" in epubs - when you've got a character speaking, and he's quoting something else. Having a double quote followed immediately by a single quite looks pretty bad, to me; it looks like a triple quote in most epubs I've seen. Putting a space between the double quote and single quote also looks pretty bad to me.

It occurred to me on my drive home this morning that I could fix that with css.

Code:
.space
{margin-left: 2pt;
}
Then use the following in my html:

Code:
<p>"<span class="space">'</span></p>
It produces results like in the attached image in ADE (and similar results in my PRS650).

I haven't decided yet if I'm OCD enough to start doing this in all my books.
Attached Thumbnails
Click image for larger version

Name:	ScreenShot088.png
Views:	183
Size:	14.6 KB
ID:	76741  
AbominableDavid is offline   Reply With Quote
Old 09-21-2011, 09:30 AM   #158
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: 5,787
Karma: 4027751
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon
I've always thought that this should be handled by font kerning...
Jellby is offline   Reply With Quote
Old 09-21-2011, 10:16 AM   #159
pdurrant
The Grand Mouse
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 29,226
Karma: 83706578
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
Quote:
Originally Posted by AbominableDavid View Post
I've always been a little bothered by "quoted quotes" in epubs - when you've got a character speaking, and he's quoting something else. Having a double quote followed immediately by a single quite looks pretty bad, to me; it looks like a triple quote in most epubs I've seen. Putting a space between the double quote and single quote also looks pretty bad to me.

It occurred to me on my drive home this morning that I could fix that with css.

Code:
.space
{margin-left: 2pt;
}
I've done this before now. I think it's probably worth the trouble. I'd also urge you to use 'proper' quotes in your ebooks, i.e. “” and ‘’.
pdurrant is online now   Reply With Quote
Old 09-21-2011, 10:59 AM   #160
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 9,384
Karma: 4531750
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2
Nice solution. I had thought of using CSS with letter-spacing to fix this problem and then set the span to the full " ' combination since it can also be ' " then there is also things like " ' ".

Dale
DaleDe is offline   Reply With Quote
Old 09-22-2011, 03:30 AM   #161
AbominableDavid
Member
AbominableDavid began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Sep 2009
Location: Tennessee
Device: PRS-505, PRS-650
Quote:
Originally Posted by pdurrant View Post
I've done this before now. I think it's probably worth the trouble. I'd also urge you to use 'proper' quotes in your ebooks, i.e. “” and ‘’.
I normally do use proper quotes - straight quotes were just easier for testing purposes since they're right there on the keyboard.

Quote:
Originally Posted by DaleDe View Post
Nice solution. I had thought of using CSS with letter-spacing to fix this problem and then set the span to the full " ' combination since it can also be ' " then there is also things like " ' ".
Do most epub readers recognize the letterspacing attribute? I didn't even know that existed until just now - I'll have to do some testing with it later. It would certainly be easier to do it that way than to create one for " ' and another for ' ".
AbominableDavid is offline   Reply With Quote
Old 09-22-2011, 04:04 AM   #162
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: 5,787
Karma: 4027751
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon
Or you could add one of the different non-breaking spaces available in Unicode:

&nbsp; -> Normal size, although it usually does not expand with other normal spaces when the line is justified.
& #8199; -> Figure space, shouldn't be much different from &nbsp;.
& #8239; -> Narrow no-break space. I'd favour this one.
& #8288; and & #65279; -> These are zero-width, and have other uses.
Jellby is offline   Reply With Quote
Old 03-26-2012, 08:47 AM   #163
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,310
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
@Jellby

About & #8239; -> Narrow no-break space.

" This char is also used in French before ";?!»" chars and after "«". "

As a French, this space entity interests me a lot of course. It's what we call or close to "espace fine insécable". However I can see no way to use it for EPUB purposes. Sigil erases it immediately, ADE will probably flag it with a question mark as it did with &thinsp; (this last one at least is recognized by Sigil) )

It seems we need special software to handle this? But how can we expect to transfer it to ebook-readers which follow ADE specifications? This has always puzzled me.

Emulation, though possible, seems to be too cumbersome for these small animals.
texte<span class=*»fine*»>nbsp</span>texte
Related CSS*code:
.fine {font-size: 30%; }

If you could provide some more comments on this, I would be very interested.

Last edited by roger64; 03-26-2012 at 08:57 AM.
roger64 is offline   Reply With Quote
Old 03-26-2012, 11:11 AM   #164
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: 5,787
Karma: 4027751
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon
I don't know what Sigil does, but my reader (Cybook Orizon, which uses an Adobe engine internally) supports it fine, at least with the fonts I use.
Jellby is offline   Reply With Quote
Old 03-26-2012, 12:12 PM   #165
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: 8,292
Karma: 35906004
Join Date: Jan 2010
Device: Kindle Fire HD, Kindle 2
Quote:
However I can see no way to use it for EPUB purposes. Sigil erases it immediately,
Sigil doesn't erase it at all. It just un-entities it... meaning you probably can't see it in the Code View. But it's still there and it still renders properly in the Book View.

The regex expression \x{202f} will find all occurrences of the narrow, non-breaking spaces that you thought were erased (in Code View).

This is all based on Sigil 0.5.3.

Quote:
ADE will probably flag it with a question mark as it did with &thinsp;
My Desktop ADE doesn't recognize it with default fonts, but I have no idea how portable devices might behave.
DiapDealer 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
direkter Umlaut oder lieber HTML Code in Epub ? NASCARaddicted Erste Hilfe 14 06-16-2011 05:54 AM
Programming language code snippets in ebooks? Connochaetes Writers' Corner 7 10-18-2010 02:43 PM
ebook-convert HTML to EPUB and problem with <pre><code> mikegr Calibre 2 03-09-2010 02:27 PM
css override code for margins? Amalthia Calibre 15 08-11-2009 07:20 PM
Problems generating ePub from HTML/CSS AlexBell Calibre 3 07-17-2009 05:10 AM


All times are GMT -4. The time now is 09:40 AM.


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