07-21-2009, 01:40 PM | #1 |
Sir Penguin of Edinburgh
Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
|
Can we do this in HTML?
Lately I've been interested in adapting into ebooks interesting formatting that I've found in paper books. Today I came across one that would be very neat to have but is beyond my knowledge of html. I need the help of one of the experts here.
Basically I want to reduce the width of the text for exactly one screenful of text. I know how to center, and I know how to do margin-top. Here are some limitations:
So is it possible? |
07-21-2009, 01:47 PM | #2 |
zeldinha zippy zeldissima
Posts: 27,827
Karma: 921169
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
|
hm, you mean you just want extra-large margins on the first screen of text ? this would be easy to accomplish in html / epub except for one thing : i am not sure how to apply dynamically the effect only to the first screen of text, since the quantity of text could change depending on font-size, screen-size, etc. however if you wanted to make a static simulation you could just apply this to the first paragraph or two, and then add a forced page-break. this is not ideal since it could spill into 2 screens depending on other factors, but i can't immediately think of a different way to do it.
on the other hand, when you mention mobipocket, you say no side margins, is it true you can't define any side margins in a mobipocket book ? that seems odd, to say the least (although not actually surprising, given what little i know of the format). does that mean you can't use padding either ? if you can use padding, you could add padding of say 25% to each side. perhaps someone else will have a better idea. |
Advert | |
|
07-21-2009, 01:53 PM | #3 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I would say abandon the whole idea of replicating page level features of paper books. Reflowable formats do not have pages! Any hackery you do to acheive the feature is likely to be very fragile.
|
07-21-2009, 02:07 PM | #4 | |
frumious Bandersnatch
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
As far as I know, no margin and no padding in mobipocket. You only have indents and a default enlarged left margin (only left) for blockquotes. Even so, that's often good enough to have meaningful formatting. Last edited by Jellby; 07-21-2009 at 02:12 PM. |
|
07-21-2009, 02:10 PM | #5 | |
Exwyzeeologist
Posts: 535
Karma: 3261
Join Date: Jun 2009
Device: :PRS-505::iPod touch:
|
Quote:
Last edited by Abecedary; 07-21-2009 at 02:12 PM. |
|
Advert | |
|
07-21-2009, 02:12 PM | #6 |
frumious Bandersnatch
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
But they have "screenfuls", even if the screen has a scroll bar. Just like they have lines, and there is a ":first-line" pseudo-element in CSS, there could be a ":first-page" or something for paged media.
|
07-21-2009, 02:20 PM | #7 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
The only way it occurs to me in which it could be done would be to use a graphic image of that one specific page. A "horrible hack", I know.
|
07-21-2009, 02:22 PM | #8 | |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
Quote:
The "killer" here is the "precisely one screenful" requirement, since that is device and setting-dependent. |
|
07-21-2009, 02:32 PM | #9 | |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
The last solution is probably the best. IIRC calibre when converting it will convert to <blockquote> in MOBI which actually does allow margins. |
|
07-21-2009, 02:59 PM | #10 | |
frumious Bandersnatch
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
Say you have a tiny font size, then the "first page" is the first 3 paragraphs, which are shown with large margins, when you click on "next page" or scroll down, you see the 4th paragraph with normal margins. Now you change the font size, and the "first page" is only half of the first paragraph, which is shown with large margins, and when you click on "next page" or scroll down the rest of the paragraph has normal margins. I don't see what's wrong with this (though it may not be a beautiful format). What would indeed be wrong is if the "first page" is fixed for some particular setting, and when you change the font size, you still see the first 3 paragraphs with large margins, even though only half a paragraph fits on the screen. But that's not what Nate wants, I believe. |
|
07-21-2009, 03:02 PM | #11 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
yes, but why? Why go to all this trouble to replicate a feature that only makes sense in fixed page layouts? Ask yourself what the purpose of that feature is in the pbook. In this case it is to further emphasize the start of a chapter, I believe. So instead of trying to replicate the feature exactly, replicate the goal...emphasizing the start of the chapter. Have a discussion about the best *reflowable* ways to accomplish that goal instead.
|
07-21-2009, 03:14 PM | #12 | |
Grand Sorcerer
Posts: 11,247
Karma: 35000000
Join Date: Jan 2008
Device: Pocketbook
|
Quote:
|
|
07-21-2009, 03:18 PM | #13 |
Exwyzeeologist
Posts: 535
Karma: 3261
Join Date: Jun 2009
Device: :PRS-505::iPod touch:
|
Alright, bored here at work, so I thought I'd give this a shot. It seems to work perfectly fine in ADE epubs. Of course, as Jellby mentioned, it is an Adobe extension to the format, so it won't work on all epub readers. But it definitely is doable in at least one format.
As for Kovid's "why do it" question, the answer is for the same reason as you'd do it in a printed book--aesthetics. |
07-21-2009, 04:31 PM | #14 | |
Sir Penguin of Edinburgh
Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
|
Quote:
Thanks everyone. |
|
07-21-2009, 05:56 PM | #15 |
Exwyzeeologist
Posts: 535
Karma: 3261
Join Date: Jun 2009
Device: :PRS-505::iPod touch:
|
It works in the desktop ADE, but it looks a little funky on the 505 due to no full justification. I'm not sure if there are any ADE portable ebook readers that support the justification feature yet (although I seem to remember seeing mention of one a few weeks ago).
Also, something else that occurred to me is that this method wouldn't work very well if you had a chapter title/head that was moderately long. That is, you couldn't have the chapter title be wider than the column of text--the title length would be matched to the column width and then it would wrap. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Merging multiple HTML files into one HTML file | skoobwoman | Workshop | 45 | 07-11-2014 10:46 AM |
Calibre Recipe HTML content differs from raw html of index.html. | krunk | Calibre | 4 | 09-20-2010 09:48 PM |
HTML Book + non HTML TOC to epub | aarcane | Calibre | 4 | 03-02-2010 02:58 AM |
HTML to ??? | Yayafava | Workshop | 2 | 02-23-2010 11:32 PM |
Where's the HTML? | Argel | Upload Help | 2 | 09-12-2008 11:01 AM |