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 07-13-2011, 04:33 AM   #16
charleski
Wizard
charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.
 
Posts: 1,188
Karma: 727236
Join Date: Sep 2009
Device: PRS-505
Quote:
Originally Posted by virtual_ink View Post
@ Alex, yes iPad overrides the stylesheet. Crazy huh?

Aside from manually adding a blank <span> to every <p> that needs it, does anyone know a way to do this at a macro level?
One way to do this inside ID is to create a junk character style that doesn't contain anything that will be exported (set kerning to metrics, for instance*). Then open the Find/Change dialog, set the Find Format to Character Style: None and the Change Format to Character Style: iBooks junk, leave the other boxes blank and do a replace over the whole document.

Quote:
Originally Posted by virtual_ink View Post
Also, I can not for the life of me figure out how get his centered in iBooks.

I want to center the text 'PART I." and here's the code:

</head>
<body>
<div id="chapter-6.html" xml:lang="en-GB">
<div class="center">
<h2 id="toc_marker-3" class="sectiontitle"><strong>PART I.</strong></h2>
</div>
</div>
</body>
</html>
I thought iBooks did respect text alignment for header tags. Maybe try removing the <div class="center">


* kerning should, of course, always be set to metrics (!), but this isn't really relevant to ebooks
Attached Files
File Type: zip Untitled-1.zip (570.9 KB, 47 views)
File Type: epub Untitled-1.epub (210.1 KB, 62 views)
charleski is offline   Reply With Quote
Old 07-13-2011, 04:51 AM   #17
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
Posts: 2,279
Karma: 3868800
Join Date: May 2008
Location: Launceston, Tasmania
Device: Kindle3, Kobo Touch, Sony PRS T3, Nexus 7, iPad mini
Quote:
Originally Posted by virtual_ink View Post
@ Alex, yes iPad overrides the stylesheet. Crazy huh?
Thanks for letting me know. If I ever prepare an ebook for an iPad I'll keep that in mind.
AlexBell is offline   Reply With Quote
 
Enthusiast
Old 07-13-2011, 06:02 AM   #18
coldplayplayer
Junior Member
coldplayplayer began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jul 2011
Device: iPad / iPhone
Adding <span> & </span>

I use Notepad++ to edit my XHTML and CSS. Today I did a very similar thing you are asking about I think.

I did a find and replace search like this.

FIND: <p>(.*)</p>
REPLACE: <p><span>\1</span></p>

The (.*) is a wildcard search I believe so it found every instance in my XTHML page that started with <p> had text in between and then ended with </p> and replaced it with the <p><span> and </span></p>.

If you use them, don't forget to add the class after the p, for example <p class="bodytext">(.*)</p>

It worked for me and 99 changes were done in a little under a minute.
coldplayplayer is offline   Reply With Quote
Old 07-20-2011, 09:46 PM   #19
virtual_ink
Zealot
virtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheese
 
virtual_ink's Avatar
 
Posts: 107
Karma: 1000
Join Date: Sep 2010
Location: Melbourne, Australia
Device: iPad2, Kindle
Fantastic, I will try this out.

On a related issue, when my * is centered, spacing above is not working as it should. My CSS is:

p.asterisk {
font-family : Georgia, serif;
font-weight : normal;
font-style : normal;
font-size : 1em;
text-decoration : none;
font-variant : normal;
line-height : 1.2;
text-align : center;
color : #000000;
text-indent : 0px;
margin : 8px 0px;
}

I have tried editing this line, as:
margin : 8px 0px 8px 0px;

But it didn't make any difference.
virtual_ink is offline   Reply With Quote
Old 07-21-2011, 01:42 AM   #20
virtual_ink
Zealot
virtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheese
 
virtual_ink's Avatar
 
Posts: 107
Karma: 1000
Join Date: Sep 2010
Location: Melbourne, Australia
Device: iPad2, Kindle
Quote:
Originally Posted by coldplayplayer View Post
I use Notepad++ to edit my XHTML and CSS. Today I did a very similar thing you are asking about I think.

I did a find and replace search like this.

FIND: <p>(.*)</p>
REPLACE: <p><span>\1</span></p>

The (.*) is a wildcard search I believe so it found every instance in my XTHML page that started with <p> had text in between and then ended with </p> and replaced it with the <p><span> and </span></p>.

If you use them, don't forget to add the class after the p, for example <p class="bodytext">(.*)</p>

It worked for me and 99 changes were done in a little under a minute.
If my code already contains a class, and reads for eg:

<p class="bodycenter"><span>text text text</span></p>

Is there a way to adjust and use this find/replace methodology?
virtual_ink is offline   Reply With Quote
Old 07-22-2011, 12:18 AM   #21
coldplayplayer
Junior Member
coldplayplayer began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jul 2011
Device: iPad / iPhone
Quote:
If my code already contains a class, and reads for eg:

<p class="bodycenter"><span>text text text</span></p>

Is there a way to adjust and use this find/replace methodology?
I think I get what you're asking. In this case you want to search like this:

<p class="bodycenter"><span>(.*)</span></p>

I just tried it in Notepad++ and it worked. Basically you are just telling it to find each individual instance of code that starts with <p class="bodycenter"><span> and ends with </span></p>.

So I guess could say it is a more refined search than the original one I posted up and probably a good thing to remember. Otherwise if you already had a line of code like you suggested, the original find and replace method would produce the following result:

<p class="bodycenter"><span><span>text text text</span></span></p>

Does this help you out?
coldplayplayer is offline   Reply With Quote
Old 08-29-2011, 04:28 AM   #22
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
Posts: 2,279
Karma: 3868800
Join Date: May 2008
Location: Launceston, Tasmania
Device: Kindle3, Kobo Touch, Sony PRS T3, Nexus 7, iPad mini
Quote:
Originally Posted by virtual_ink View Post
@ Alex, yes iPad overrides the stylesheet. Crazy huh?

Aside from manually adding a blank <span> to every <p> that needs it, does anyone know a way to do this at a macro level?
I know this is a relatively old thread, but rather than start another may I ask whether you have found a solution?
AlexBell is offline   Reply With Quote
Old 08-29-2011, 04:45 AM   #23
virtual_ink
Zealot
virtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheese
 
virtual_ink's Avatar
 
Posts: 107
Karma: 1000
Join Date: Sep 2010
Location: Melbourne, Australia
Device: iPad2, Kindle
I was doing a conversion today and didn't require a span around my centered asterisk. As there was only one in the book, I'm not convinced that ibooks have fixed the problem (I'd had some text center correctly before). I added a span just in case.

Not really an answer, but I haven't needed to revisit this for a while. I'm hoping coldplayplayers tip will work.
virtual_ink is offline   Reply With Quote
Old 08-31-2011, 06:27 AM   #24
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
Posts: 2,279
Karma: 3868800
Join Date: May 2008
Location: Launceston, Tasmania
Device: Kindle3, Kobo Touch, Sony PRS T3, Nexus 7, iPad mini
Quote:
Originally Posted by virtual_ink View Post
I was doing a conversion today and didn't require a span around my centered asterisk. As there was only one in the book, I'm not convinced that ibooks have fixed the problem (I'd had some text center correctly before). I added a span just in case.

Not really an answer, but I haven't needed to revisit this for a while. I'm hoping coldplayplayers tip will work.
Thanks, Virtual_Ink.

I've just started trying to produce ebooks for the iPad, and am running into many problems - mainly centering text but some others.

Something which is driving me frantic at the moment is that I have produced several ePub ebooks using a template. Some of them when read on an iPad centre the text where I have required that, and some of them, using the same template, do not. And I don't know why.

Also, some of the images show on an iPad the same as they do on my Sony, and some do not. For example I use a logo for myself which I set to 25% of the screen width, and it looks the same on the iPad as it does on the Sony. Some images are floated to the right side of the screen and set to 50% width, and look the same on the iPad as on the Sony. But another image which is centred and set to 50% width looks much wider on the iPad than it does on the Sony. And I don't know why, nor how to make look the same on the iPad as on the Sony.

It seems to my jaundiced eye that Apple ePub is only a loose approximation of real ePub.

If ever I find out why these difference occur and how to fix them I'll ask the Moderator to start a sticky so we can all add explanations and fixes.
AlexBell is offline   Reply With Quote
Reply

Tags
alignment, centering, epub

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help on how to align a table to the right NASCARaddicted ePub 6 02-18-2011 01:46 PM
I can not align the text...help please! XD derfel_spain ePub 17 12-18-2010 09:45 AM
Can you delete div with align=center mufc Recipes 4 12-10-2010 06:23 PM
ePub files do not center a custom <hr /> tag! Haidon ePub 2 08-21-2010 04:29 AM
Text becomes center-aligned when converting Alfy Calibre 12 01-19-2009 12:41 AM


All times are GMT -4. The time now is 04:26 PM.


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