Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 04-08-2015, 09:07 AM   #1
oiver55
Enthusiast
oiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windows
 
Posts: 43
Karma: 120648
Join Date: Feb 2015
Device: kindle
Centering Text in Middle of Display Screen

I am working on publishing a book in Sigil and throughout the book there are little bits of info I would like seperated with its own page and centered on the screen. Is there away to have the text centered to the screen across different display devices? I mean I could press the enter button until it looks just about right, but I wanted to know if there was another way to go about doing this with code




For More Insight:

http://postimg.org/image/gc3d3l4ft/

http://postimg.org/image/thiv9oybd/
oiver55 is offline   Reply With Quote
Old 04-08-2015, 11:16 AM   #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: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by oiver55 View Post
I am working on publishing a book in Sigil and throughout the book there are little bits of info I would like seperated with its own page and centered on the screen. Is there away to have the text centered to the screen across different display devices? I mean I could press the enter button until it looks just about right, but I wanted to know if there was another way to go about doing this with code




For More Insight:

http://postimg.org/image/gc3d3l4ft/

http://postimg.org/image/thiv9oybd/
Just Press Enter

(Learn to) Use the stylesheet

.title {
font-size: 2em;
margin-top: 10%;
text-align: center;
}

HTML/CSS has no awareness of screen height (just as there is no limit on how long the scroll is)

the 10% I used above is relative to the WIDTH (Many displays are 3:4)
( my hint to get close to your goal)

A new file is the simple way to start a new Screen (stop thinking 'page' and work by file/section )

Semantics MUST be applied on a ONE per PER file basis
Only 1 Titlepage
Only 1 copyright-page
...

It is convenient to also do chapter per file rather than work with a monster length file. Most of the tools that work on a whole file can be used for a whole GROUP of files. Search, Merge, Link_CSS, Delete ,
theducks is online now   Reply With Quote
Advert
Old 04-08-2015, 04:56 PM   #3
RbnJrg
Wizard
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: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Yes, it's possible to get what you want but the needed code won't work on all e-readers. Read the following post:

https://www.mobileread.com/forums/sho...43&postcount=4

But also read all others opinions in that thread, since all of them are very usefull.

As I said in that post, the method works for Kindle (with support for .kf8, not the old Kindle models), iPad, maybe Kobo but not ADE and ereaders based on RMSDK. You'll see if that info helps you or not

Regards
Rubén

Last edited by RbnJrg; 04-08-2015 at 05:01 PM.
RbnJrg is offline   Reply With Quote
Old 04-09-2015, 07:04 AM   #4
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
When it comes to the title page, most New York publishers are finessing this by simply using an image of the page from the print edition.
Notjohn is offline   Reply With Quote
Old 04-09-2015, 10:43 AM   #5
oiver55
Enthusiast
oiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windows
 
Posts: 43
Karma: 120648
Join Date: Feb 2015
Device: kindle
Quote:
Originally Posted by RbnJrg View Post
Yes, it's possible to get what you want but the needed code won't work on all e-readers. Read the following post:

https://www.mobileread.com/forums/sho...43&postcount=4

But also read all others opinions in that thread, since all of them are very usefull.

As I said in that post, the method works for Kindle (with support for .kf8, not the old Kindle models), iPad, maybe Kobo but not ADE and ereaders based on RMSDK. You'll see if that info helps you or not

Regards
Rubén

Thanks I added the code in but I find that whenever I leave the header or the footer blank the middle row doesn't stay in the middle but goes up to the top.

As a last resort I could always just hit enter and eye it from there.

If I understand all this correctly all my sections (which aren't many) should have semantics? I have a Cover, Title Page, Table of Content, a soon to be copyright page and 4 sections devoted for the content of the book , so 8 sections total.

Last edited by oiver55; 04-09-2015 at 10:47 AM.
oiver55 is offline   Reply With Quote
Advert
Old 04-09-2015, 11:42 AM   #6
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: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by oiver55 View Post
Thanks I added the code in but I find that whenever I leave the header or the footer blank the middle row doesn't stay in the middle but goes up to the top.

As a last resort I could always just hit enter and eye it from there.

If I understand all this correctly all my sections (which aren't many) should have semantics? I have a Cover, Title Page, Table of Content, a soon to be copyright page and 4 sections devoted for the content of the book , so 8 sections total.
the contents (what you read) only once: Also referred as: Start reading

text gets assigned to the first file you would actually read as a user: EG Prologue/Chapter 1
theducks is online now   Reply With Quote
Old 04-09-2015, 01:51 PM   #7
RbnJrg
Wizard
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: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by oiver55 View Post
Thanks I added the code in but I find that whenever I leave the header or the footer blank the middle row doesn't stay in the middle but goes up to the top.
No, no You don't have to have three "rows" for what you want, you need to have one row. Do the following:

In the .css stylesheet, write:

Code:
html, body {
    height: 100%;
}

#content {
    display: table;
    font-family: serif; /* Or the font-family you want */
    height: 100%;
    width: 100%;
    text-indent: 0;
    text-align: center;
}

.middle_row {
    display: table-row;
    height: 100%;
}

.middle_cell {
    display: table-cell;
    vertical-align: middle;
    text-indent: 0;
    text-align: center;
    font-size: 2em; /* Or the font-size you want */
    font-weight: bold; /* If you wish */
}
And in the .html file write:

Code:
  <div id="content">
    <div class="middle_row">
      <p class="middle_cell">Your Text<br />Centered Here</p>
    </div>
  </div>
Below you can see the respective .epub
Regards
Attached Files
File Type: epub Vertical Align Text II.epub (2.2 KB, 222 views)
RbnJrg is offline   Reply With Quote
Old 04-09-2015, 02:02 PM   #8
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,168
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
@RbnJrg:

In ADE 1.7.2 I see that text at the TOP of the screen; albeit centered at the top.
PeterT is offline   Reply With Quote
Old 04-09-2015, 05:28 PM   #9
RbnJrg
Wizard
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: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by PeterT View Post
@RbnJrg:

In ADE 1.7.2 I see that text at the TOP of the screen; albeit centered at the top.
Hi Peter;

If you read my first post, you'll see that I said this method ONLY works for Kindle (new Kindle models, those ones who support .kf8), iPad and maybe Kobo but not for ADE or ereaders based on RMSDK. So, yes, you are right, it doesn't work for ADE 1.x. However, it should work for ADE 4.x as epub3.

Regards
RbnJrg is offline   Reply With Quote
Old 04-09-2015, 06:11 PM   #10
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,168
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
I'd suggest that you repeat any caveats when you post a solution. Not all of us remember the conditions from earlier posts and when you post a solution saying "It works" it causes extra confusion when someone like me or JSWolf tries what you have shared.
PeterT is offline   Reply With Quote
Old 04-09-2015, 07:53 PM   #11
RbnJrg
Wizard
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: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by PeterT View Post
I'd suggest that you repeat any caveats when you post a solution. Not all of us remember the conditions from earlier posts and when you post a solution saying "It works" it causes extra confusion when someone like me or JSWolf tries what you have shared.
Yes, Peter, I did exactly what you have written. Please, read again the post #4 of THIS thread and you'll see that I warn about the method doesn't work on ADE. Also I said that the method IS FOR Kindle (new Kindles), iPad and maybe Kobo. I didn't repeat it in my post #7 of this thread because I thought that was enough to write that warning in my original post (https://www.mobileread.com/forums/sho...3&postcount=4) and in the post #4.

Regards
RbnJrg is offline   Reply With Quote
Old 04-09-2015, 09:35 PM   #12
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,168
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Forget it. No point discussing it.
PeterT is offline   Reply With Quote
Old 04-10-2015, 10:54 AM   #13
oiver55
Enthusiast
oiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windowsoiver55 format shifts faster than booting Windows
 
Posts: 43
Karma: 120648
Join Date: Feb 2015
Device: kindle
Okay I have tried it out and your epub works both in the sigil previewer and kindle previewer standing alone, but when I insert it in my epub it looks right, in the sigil book view mode but when I preview it in kindle previewer, the same thing happens. The text just shoots right up to the top.
Here is a look at the code above and below your code:

Code:
  <div style="page-break-before:always;"></div>

  <div id="content">
    <div class="middle_row">
      <p class="middle_cell">Your Text<br />
      Centered Here</p>
    </div>
  </div><!--
                   FOOD FOR THOUGHT
   Did you know that of all the countless creatures that inhabit planet earth, that man is the only one who destroys his food with heat and chemicals before he eats it? And that consequently, man is the only one who needs so many hospitals?
-->

  <div style="page-break-before:always;"></div>
oiver55 is offline   Reply With Quote
Old 04-10-2015, 12:11 PM   #14
RbnJrg
Wizard
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: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by oiver55 View Post
Okay I have tried it out and your epub works both in the sigil previewer and kindle previewer standing alone, but when I insert it in my epub it looks right, in the sigil book view mode but when I preview it in kindle previewer, the same thing happens. The text just shoots right up to the top.
Here is a look at the code above and below your code:

Code:
  <div style="page-break-before:always;"></div>

  <div id="content">
    <div class="middle_row">
      <p class="middle_cell">Your Text<br />
      Centered Here</p>
    </div>
  </div><!--
                   FOOD FOR THOUGHT
   Did you know that of all the countless creatures that inhabit planet earth, that man is the only one who destroys his food with heat and chemicals before he eats it? And that consequently, man is the only one who needs so many hospitals?
-->

  <div style="page-break-before:always;"></div>
You don't need to use "page-break: before" and "page-break: after". Just write the code in a new .xhtml; so you should have to have something like:

Code:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title/>
  <link href="../Styles/Style0001.css" rel="stylesheet" type="text/css"/>
</head>

<body>
  <div id="content">
    <div class="middle_row">
      <p class="middle_cell">Your Text<br/>
      Centered Here</p>
    </div>
  </div>
</body>
</html>
Of course, the name of your stylesheet will be different (and the text to be centered). Be sure that the .css stylesheet is linked with the .xhtml page, otherwise the text won't appear centered.
RbnJrg is offline   Reply With Quote
Old 04-12-2015, 03:19 PM   #15
Grizella
Member
Grizella might easily be mistaken for a TexanGrizella might easily be mistaken for a TexanGrizella might easily be mistaken for a TexanGrizella might easily be mistaken for a TexanGrizella might easily be mistaken for a TexanGrizella might easily be mistaken for a TexanGrizella might easily be mistaken for a TexanGrizella might easily be mistaken for a TexanGrizella might easily be mistaken for a TexanGrizella might easily be mistaken for a TexanGrizella might easily be mistaken for a Texan
 
Posts: 17
Karma: 18298
Join Date: Jan 2015
Device: Mantano
LOL. You should also mention that the eReader needs to be charged and switched on, otherwise the text will not appear at all
Grizella is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
centering text andreadavison Conversion 1 12-29-2013 02:02 PM
Regex problem: Trying to replace surrounding text without effecting the middle ghostyjack Workshop 3 10-09-2012 04:26 PM
PRS-505 In middle of screen is a triangle with ! in middle toad1960 Sony Reader 0 12-30-2011 01:30 PM
Centering text epub for NOOK Color photoluminations Conversion 3 12-15-2011 12:01 PM
Two columns of text, line down middle? chingu ePub 2 09-04-2011 06:12 PM


All times are GMT -4. The time now is 08:42 PM.


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