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 08-17-2012, 01:00 PM   #16
mmat1
Det
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 939
Karma: 1104656
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Quote:
Originally Posted by democrite View Post
Anyway, Digital Editions (and thus readers) don't like any of this very much so maybe I do have to restort to a table.
I'm sorry, but i made a mistake with my suggestion.

It should read:
.label { margin-left: -3em; float: left }
This should work with multiline.

Concerning your right aligned numbers to the right:
.lineno { float: right; text-align: right; }
mmat1 is offline   Reply With Quote
Old 08-17-2012, 06:36 PM   #17
democrite
Connoisseur
democrite can name that song in three notesdemocrite can name that song in three notesdemocrite can name that song in three notesdemocrite can name that song in three notesdemocrite can name that song in three notesdemocrite can name that song in three notesdemocrite can name that song in three notesdemocrite can name that song in three notesdemocrite can name that song in three notesdemocrite can name that song in three notesdemocrite can name that song in three notes
 
Posts: 69
Karma: 24566
Join Date: Sep 2011
Device: Sony PRS-T1, iPad, iPhone
Thanks mmat1. ADE likes that much better. Though the page numbers still don't work too well. Not as much of a big deal. It's possible having them in a separate floating paragraph might work but I haven't tried that yet.
democrite is offline   Reply With Quote
Old 04-02-2014, 09:45 AM   #18
doubleshuffle
Oi, Artistic License!
doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.
 
doubleshuffle's Avatar
 
Posts: 1,645
Karma: 12911153
Join Date: Jan 2011
Location: Just about to enter Sprinkle City
Device: Aura HD
Coding an albatross.

OK, I'm probably insane, but I'd still like to know if there is any reasonable to way to get something like this (see attached pic) in epub. It's Coleridge's Rime of the Ancient Mariner, and it has got all those little sidenotes on the left that explain what's going on for those who can't be bothered to read the poem proper. Anyway, it looks very neat on the printed page.

The problem with coding it in epub is the varying length of those sidenotes. Some of them run for longer than a stanza, others are shorter.

In the earlier posts in this thread I have found two basic patterns for coding something like this, let's call them the float- and the table-approach. I've tried both, and have run into different kinds of problems with both:

- using the float-approach, it is impossible to get a regular straight left edge of the poem proper; lines will start too far to the left when the left-floating span is short, or too far to the right when it is long and gets close to the next one. I fiddled with inserted line breaks to adjust the length of the span, but the effect of course breaks down immediately if you change the font-size.

- the table approach (or the "fake table" Jellby suggested in post #5) works beautifully regarding the edges, but I have to start a new table with each new sidenote (or in the end for each stanza probably), and ADE starts a new page after each one, which of course I don't want. So it would solve all my problems if there was a way to tell ADE not to do that.

I know there are some real experts here - can it be done?
Attached Thumbnails
Click image for larger version

Name:	mariner.jpg
Views:	37
Size:	30.3 KB
ID:	121147  
doubleshuffle is online now   Reply With Quote
Old 04-02-2014, 12:52 PM   #19
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,510
Karma: 4597184
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2
Does ADE always start a new page, or only when the next table will not fit on the current page? If the latter then simply make smaller tables.

what does you code look like for the first solution?

Dale
DaleDe is offline   Reply With Quote
Old 04-02-2014, 01:04 PM   #20
mmat1
Det
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 939
Karma: 1104656
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Quote:
Originally Posted by doubleshuffle View Post
OK, I'm probably insane, but I'd still like to know if there is any reasonable to way to get something like this (see attached pic) in epub. It's Coleridge's Rime of the Ancient Mariner, and it has got all those little sidenotes on the left that explain what's going on for those who can't be bothered to read the poem proper. Anyway, it looks very neat on the printed page.

The problem with coding it in epub is the varying length of those sidenotes. Some of them run for longer than a stanza, others are shorter.

In the earlier posts in this thread I have found two basic patterns for coding something like this, let's call them the float- and the table-approach. I've tried both, and have run into different kinds of problems with both:

- using the float-approach, it is impossible to get a regular straight left edge of the poem proper; lines will start too far to the left when the left-floating span is short, or too far to the right when it is long and gets close to the next one. I fiddled with inserted line breaks to adjust the length of the span, but the effect of course breaks down immediately if you change the font-size.

- the table approach (or the "fake table" Jellby suggested in post #5) works beautifully regarding the edges, but I have to start a new table with each new sidenote (or in the end for each stanza probably), and ADE starts a new page after each one, which of course I don't want. So it would solve all my problems if there was a way to tell ADE not to do that.

I know there are some real experts here - can it be done?
You might try Pynch's method used in Joyce, Finnigans Wake Chapter 3
mmat1 is offline   Reply With Quote
Old 04-02-2014, 01:57 PM   #21
RbnJrg
Evangelist
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 441
Karma: 299858
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by doubleshuffle View Post
OK, I'm probably insane, but I'd still like to know if there is any reasonable to way to get something like this (see attached pic) in epub. It's Coleridge's Rime of the Ancient Mariner, and it has got all those little sidenotes on the left that explain what's going on for those who can't be bothered to read the poem proper. Anyway, it looks very neat on the printed page.

The problem with coding it in epub is the varying length of those sidenotes. Some of them run for longer than a stanza, others are shorter.

In the earlier posts in this thread I have found two basic patterns for coding something like this, let's call them the float- and the table-approach. I've tried both, and have run into different kinds of problems with both:

- using the float-approach, it is impossible to get a regular straight left edge of the poem proper; lines will start too far to the left when the left-floating span is short, or too far to the right when it is long and gets close to the next one. I fiddled with inserted line breaks to adjust the length of the span, but the effect of course breaks down immediately if you change the font-size.

- the table approach (or the "fake table" Jellby suggested in post #5) works beautifully regarding the edges, but I have to start a new table with each new sidenote (or in the end for each stanza probably), and ADE starts a new page after each one, which of course I don't want. So it would solve all my problems if there was a way to tell ADE not to do that.

I know there are some real experts here - can it be done?
I think a two columns layout could solve your issues. And it works in ADE (except ADE 2.0), iPad and with the modern Kindle devices (those who support the .kf8 format, since you can't use this technique with K1 and K2).

In your .css stylesheet write the following:

Code:
h1 {
  clear: both;
  font-size: 1.4em;
  font-family: sans-serif;
  margin: 0;
  padding: 1em 0;
  text-align: center;
}

p {
  font-size: 1em;
  text-align: left;
  font-family: serif;
  margin: 0;
  padding-bottom: 1em;
}

.col1 {
  clear: both;
  float: left;
  width: 20%; /* of course, you can change the width here */
}

.col2 {
  float: left;
  width: 80%; /* of course, you can change the width here */
}

div.col1 p {
  margin-left:0;
  margin-right: 0.75em;
  font-size: 0.8em; 
  font-style: italic;
}

div.col2 p {
  margin-left: 0.75em;
  margin-right: 0;
}
And in your .html file write something like:

Code:
<body>
  <h1>PART THE FIRST</h1>

  <div class="col1">
    <p>This is the first side note, in this case a short one.</p>
  </div>

  <div class="col2">
    <p>It is an ancient Mariner,<br />
    And he stoppeth one of three.<br />
    “By thy long grey beard and glittering eye,<br />
    Now wherefore stopp'st thou me?</p>

    <p>“The Bridegroom's doors are opened wide,<br />
    And I am next of kin;<br />
    The guests are met, the feast is set:<br />
    May'st hear the merry din.”</p>
  </div>

  <div class="col1">
    <p>This is the second side note; this is a larger side note than the first one and in this case also larger than one stanza.</p>
  </div>

  <div class="col2">
    <p>He holds him with his skinny hand,<br />
    “There was a ship,” quoth he.<br />
    “Hold off! unhand me, grey-beard loon!”<br />
    Eftsoons his hand dropt he.</p>

    <p>He holds him with his glittering eye—<br />
    The Wedding-Guest stood still,<br />
    And listens like a three years child:<br />
    The Mariner hath his will.</p>
  </div>
</body>
This is how it looks in Sigil:

Click image for larger version

Name:	Image2.png
Views:	27
Size:	84.8 KB
ID:	121158

And this is how the epub looks in ADE:

Click image for larger version

Name:	Image1.png
Views:	28
Size:	88.7 KB
ID:	121156

You must enclose your side notes in a <div class="col1"> tag and your stanzas in a <div class="col2">. That's all. Below you can see the respective .epub and you'll be able to understand better what I want to say

Regards
Rubén
Attached Files
File Type: epub Poetry with side notes.epub (2.7 KB, 15 views)

Last edited by RbnJrg; 04-02-2014 at 04:51 PM.
RbnJrg is offline   Reply With Quote
Old 04-02-2014, 02:57 PM   #22
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,001
Karma: 4346921
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by doubleshuffle View Post
- using the float-approach, it is impossible to get a regular straight left edge of the poem proper; lines will start too far to the left when the left-floating span is short, or too far to the right when it is long and gets close to the next one.
Isn't that fixed by setting a width for the float? I think that's basically what Rubén's solution boils down to.
Jellby is offline   Reply With Quote
Old 04-02-2014, 03:44 PM   #23
doubleshuffle
Oi, Artistic License!
doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.
 
doubleshuffle's Avatar
 
Posts: 1,645
Karma: 12911153
Join Date: Jan 2011
Location: Just about to enter Sprinkle City
Device: Aura HD
Wow, thanks guys for all the suggestions. I'll fiddle on a bit and report the results.

And I DID set a width for the float, Jellby; fully expected it to work, but it didn't. I only floated the sidenotes, though, not the body of the poem.
doubleshuffle is online now   Reply With Quote
Old 04-02-2014, 03:56 PM   #24
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,001
Karma: 4346921
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by doubleshuffle View Post
And I DID set a width for the float, Jellby; fully expected it to work, but it didn't. I only floated the sidenotes, though, not the body of the poem.
Did you set them as <div>s or as <span>s? If I remember correctly, inline elements (<span>s by default) don't take a width.
Jellby is offline   Reply With Quote
Old 04-02-2014, 04:06 PM   #25
doubleshuffle
Oi, Artistic License!
doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.
 
doubleshuffle's Avatar
 
Posts: 1,645
Karma: 12911153
Join Date: Jan 2011
Location: Just about to enter Sprinkle City
Device: Aura HD
Quote:
Originally Posted by Jellby View Post
Did you set them as <div>s or as <span>s?
Tried both. Neither worked. Ruben's solution seems to work nicely. I'll test the other suggestions (Dale's shorter - which would mean single stanza - tables, and whatever Pynch did in Finnegans Wake) an report back; not tonight though...
doubleshuffle is online now   Reply With Quote
Old 04-03-2014, 03:08 AM   #26
pynch
luxury item
pynch ought to be getting tired of karma fortunes by now.pynch ought to be getting tired of karma fortunes by now.pynch ought to be getting tired of karma fortunes by now.pynch ought to be getting tired of karma fortunes by now.pynch ought to be getting tired of karma fortunes by now.pynch ought to be getting tired of karma fortunes by now.pynch ought to be getting tired of karma fortunes by now.pynch ought to be getting tired of karma fortunes by now.pynch ought to be getting tired of karma fortunes by now.pynch ought to be getting tired of karma fortunes by now.pynch ought to be getting tired of karma fortunes by now.
 
pynch's Avatar
 
Posts: 901
Karma: 7901231
Join Date: Apr 2012
Device: Sony PRS-350, Kobo Aura
The thing that did the trick for the Wake chapter is easy to miss in the css: I gave the body a left margin, and then set the left margin of the floating span to the negative value of that.
pynch is online now   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
Fixed additional CSS to all of recipes ? Filo Recipes 3 03-05-2012 03:39 AM
Fixed additional CSS to all of recipes ? Filo Conversion 0 03-02-2012 01:49 PM
Tables in ePub: CSS virtual_ink ePub 5 02-23-2012 02:51 PM
Fixed Layout Sample ".mobi" file with package(html, css, opf, ncx files). Sushil Kindle Fire 1 01-13-2012 07:16 AM
The Kindle supports html tables? zwandy Amazon Kindle 12 10-01-2010 09:52 AM


All times are GMT -4. The time now is 02:01 PM.


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