Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 03-29-2011, 08:29 AM   #1
K-Thom
The one and only
K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.
 
Posts: 3,302
Karma: 535819
Join Date: Oct 2008
Location: Berlin, Germany
Device: yup!
Solved - marginals in ePub

For a customer I hab to find a solution for marginals in ePub; in this case a theater script with the names of the actors.

Seems like I finally came up with a solution which works as well in ADE as on iBooks as on the Bookeen Opus.

This solution ist limited to the fact that the marginals will only work on the first line of a new parapgraph. Which shouldn't normally be a problem, but I just wanted to mention it.
Maybe someone comes up with a solution to place a marginal in the middle of a paragraph.

The main text is in paragraphs, the marginal is in a div plus a span (necessary for iBooks to keep the formatting).

Right below is a link to the html-file with the CSS and the final ePub. I'm no CSS stylist, so hopefully no web designer will be offended by the code.

It's all in German, just in case. Comments are welcome for sure, especially if this solution works on other devices too!

Basic html:
http://www.die-ebook-manufaktur.de/test/marginalien.htm

ePub:
http://www.die-ebook-manufaktur.de/t...rginalien.epub
K-Thom is offline   Reply With Quote
Old 03-29-2011, 12:48 PM   #2
theducks
Well trained by Cats
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: 30,884
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
At first, That appears to be a 'Hanging Indent' , but closer inspection shows that the rest of the line is part of the normal paragraph block.
I see you used
Code:
        div.marg {font-size: 1em; float:left; width: 125px; text-align: right; font-style:italic;}
to accomplish this
theducks is offline   Reply With Quote
Old 03-29-2011, 01:39 PM   #3
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: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
That looks fine.

But consider that the document might be read in small screens or with large fonts, so maybe:

(a) Using absolute units (125px) might not be a good idea.

(b) "Wasting" valuable space in the right side just because some name will appear there from time to time might look not so good.

For an e-book, I'd probably use some other style, like putting the character names in their own lines (paragraphs), or just writing them in bold, with some space to set them appart from the text. It won't look so pretty, but it can be more readable in a wider variety of systems.

When you test your code in a browser, resize the window to simulate a smaller screen.

Last edited by Jellby; 03-29-2011 at 01:43 PM.
Jellby is offline   Reply With Quote
Old 03-29-2011, 06:05 PM   #4
K-Thom
The one and only
K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.K-Thom ought to be getting tired of karma fortunes by now.
 
Posts: 3,302
Karma: 535819
Join Date: Oct 2008
Location: Berlin, Germany
Device: yup!
Yep, sure, it isn't a solutions for small screens. One the iPhone you would have to just use it landscape.

I do keep in mind that ePub isn't meant for two columns anyway. As marginals aren't either. So this is just a solution to save my day. While still being readable on larger screens, though.
K-Thom is offline   Reply With Quote
Old 03-29-2011, 11:04 PM   #5
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
The marginals used this way are a perfect example of what should be defined using "definition list" constructs i.e. using <dl>, <dt> and <dd>.

I edited your html to replace each <div> block with a <dt> (definition term) block and <p> block with a <dd> (definition definition) block. I then wrapped the entire "list" in a <dl> block and added the following CSS (note the grey background for the marginals):
Code:
  dt { font-size: 1em; float: left; width: 8em; text-align: right; font-style:italic; background-color: #ddd;}
  dd { margin: 0 0 1em 9em;}
To me, the resulting .html (attached below with a .txt suffix!) and .epub are a near perfect match to your code!!!

I have used this "definition list" construct before, namely in a conversion of my Webster's Dictionary 1913 in anticipation of having an official dictionary syntax incorporated into EPUB3 using this very same syntax. However, it seems my anticipation was premature...

How well does this appear in your epub reader?
Attached Files
File Type: txt marginalien-NR.htm.txt (5.9 KB, 240 views)
File Type: epub marginalien-NR.epub (4.4 KB, 215 views)
nrapallo is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
KOBO - problem solved Merbear Kobo Reader 2 01-14-2011 11:45 AM
[Solved] Help with name of ereader James_Wilde Which one should I buy? 3 10-22-2010 03:37 AM
Is this defective? (SOLVED) PoisonWolf Amazon Kindle 6 10-02-2010 02:03 AM
SOLVED: How to see the internal memory again Sunspark Astak EZReader 19 06-08-2010 11:33 AM
Now that my mobi problem is solved Boston Kindle Developer's Corner 34 11-18-2008 01:08 AM


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


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