Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-14-2013, 03:49 PM   #1
crutledge
eBook FANatic
crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.
 
crutledge's Avatar
 
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
Dumb question #________

The folloeing is one stanza of a poem,

Code:
    <div class="poem">
      <div class="stanza">
        <span class="i0">Mi memoria en ti se ocupa</span><br />
        <span class="i0">No te olvida un solo instante,</span><br />
        <span class="i0">Y mi mente delirante En ti piensa,</span><br />
        <span class="i0">en ti piensa sin cesar.</span><br />
      </div>
    </div>
I would like to center the poem on the page without losing the foemat. Nothing I have tried has nas workeed.


advice

Last edited by Jellby; 09-15-2013 at 05:19 AM. Reason: fixed markup
crutledge is offline   Reply With Quote
Old 09-14-2013, 04:19 PM   #2
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: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
moved to a new thread. How can this have anything to do with regular expressions?
DaleDe is offline   Reply With Quote
Advert
Old 09-14-2013, 04:31 PM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,441
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Depending on what the rest of the CSS looks like... it could be something as simple as:
Code:
.poem {
    text-align: center;
  }
Or:
Code:
.stanza {
    text-align: center;
  }
DiapDealer is offline   Reply With Quote
Old 09-14-2013, 04:56 PM   #4
crutledge
eBook FANatic
crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.
 
crutledge's Avatar
 
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
Quote:
Originally Posted by DiapDealer View Post
Depending on what the rest of the CSS looks like... it could be something as simple as:
Code:
.poem {
    text-align: center;
  }
Or:
Code:
.stanza {
    text-align: center;
  }
I have tried that and each line is centered independantly losing all poem formatting.
crutledge is offline   Reply With Quote
Old 09-14-2013, 05:11 PM   #5
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Create a div and center that div. Inside the div you can create your normal paragraphs or divs (with whatever you want) with its own alignment.
Toxaris is offline   Reply With Quote
Advert
Old 09-14-2013, 05:13 PM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,441
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Sorry, I misunderstood your intent.
I don't know of any fail-safe way to exactly center the structure as a whole. You can probably get it close with margin/padding, but even that's not going to come through a user font-resize unscathed.

Last edited by DiapDealer; 09-15-2013 at 07:31 AM.
DiapDealer is offline   Reply With Quote
Old 09-14-2013, 05:44 PM   #7
crutledge
eBook FANatic
crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.
 
crutledge's Avatar
 
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
Quote:
Originally Posted by DiapDealer View Post
Sorry, I misunderstood your intent
I don't know of any fail-safe way to exactly center the structure as a whole. You can probably get it close with margin/padding, but even that's not going to come through a user font-resize unscathed.
I guess that you are correct, sir. I'll keep thinking.

Thsnk you.
crutledge is offline   Reply With Quote
Old 09-14-2013, 06:20 PM   #8
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,527
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by crutledge View Post
The folloeing is one stanza of a poem,

[CODE]
<div class="poem">
<div class="stanza">
<span class="i0">Mi memoria en ti se ocupa</span><br />
<span class="i0">No te olvida un solo instante,</span><br />
<span class="i0">Y mi mente delirante En ti piensa,</span><br />
<span class="i0">en ti piensa sin cesar.</span><br />
</div>
</div>
CODE]

I would like to center the poem on the page without losing the foemat. Nothing I have tried has nas workeed.


advice
Hi crutledge;

What you want, it can be done, at least in the modern .kf8 format. In your .css stylesheet write:

Code:
h2 {
   text-indent: 0;
   text-align: center;
   font-size: 1.4em;
   font-weight: bold;
   margin: 1em 0 2em;
}

.poem {
    display: table;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.stanza {
    display: table-cell;
    vertical-align: top;
}
And in your .html file write:

Code:
<h2>Título del Poema</h2>

  <div class="poem">
    <div class="stanza">
      Mi memoria en ti se ocupa<br />
      No te olvida un solo instante,<br />
      Y mi mente delirante En ti piensa,<br />
      en ti piensa sin cesar.
    </div>
  </div>
Below you can see screenshots of my kindle with different font-sizes and both, in portraid and landscape mode. As you can see, the body of the poem always remains centered. But since this technique makes use of the properties display: table and margin-left: auto, margin-right: auto, it doesn't work in ADE.

Regards
Rubén
Attached Thumbnails
Click image for larger version

Name:	screen_shot-9328.gif
Views:	156
Size:	6.3 KB
ID:	111043   Click image for larger version

Name:	screen_shot-9329.gif
Views:	249
Size:	9.5 KB
ID:	111044   Click image for larger version

Name:	screen_shot-9330.gif
Views:	154
Size:	6.3 KB
ID:	111045   Click image for larger version

Name:	screen_shot-9331.gif
Views:	183
Size:	11.0 KB
ID:	111046  
Attached Files
File Type: epub Centered Poem.epub (2.3 KB, 110 views)
RbnJrg is offline   Reply With Quote
Old 09-15-2013, 02:09 AM   #9
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Basically that is what I said.... BTW, margin: auto does not work on ADE based readers. You need to create a margin manually.
Toxaris is offline   Reply With Quote
Old 09-15-2013, 05:29 AM   #10
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,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
The problem here is that you need to have a container whose width adapts to its contents. Normal block elements (<p>, <div>) are no good, it is their contents that adapt to their width, and no the other way around. But tables behave like that, so you you could use Rubén's trick with "display:table" (though I'm not sure how that interacts with long lines).

However, when it comes to centering such an element, you need to use "auto" margins. "align:center" does not work, because it controls the alignment of whatever is inside, not the positioning of the element itself. "align:center" in the parent element does not work either, because the table is a block-like element, which does not obey the align attribute. And this is when we find that "auto" margins are explicitly optional in the ePub specification, and ADE choses to ignore them (or rather set them to 0). I'm afraid there's no solution for this.
Jellby is offline   Reply With Quote
Old 09-15-2013, 07:10 AM   #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,527
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Jellby View Post
...And this is when we find that "auto" margins are explicitly optional in the ePub specification, and ADE choses to ignore them (or rather set them to 0). I'm afraid there's no solution for this.
In ADE, no, there is no solution. The trick just works in Kindle (as many others so far).

EDIT: Pero creo que no hay que preocuparse mucho Jellby porque si los lectores basados en ADE quieren permanecer competitivos frente a Kindle, van a tener que mejorar su soporte para css ya que hoy por hoy el lector de Amazon les está sacando cada vez más ventajas en ese campo. Así que creo que pronto Nook, Sony y otros van a darle soporte a esas propiedades que estoy utilizando.

Last edited by RbnJrg; 09-15-2013 at 08:32 AM.
RbnJrg is offline   Reply With Quote
Old 09-15-2013, 09:59 AM   #12
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,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by RbnJrg View Post
In ADE, no, there is no solution. The trick just works in Kindle (as many others so far).
But Kindles do not read ePub, even if the inside of a KF8 file is similar to ePub. And Sigil is an ePub editor.

The bottom line, anyway, is that the solution is not guaranteed to work in an ePub, and not because readers are buggy, but because of what the ePub spec says.

Quote:
Pero creo que no hay que preocuparse mucho Jellby porque si los lectores basados en ADE quieren permanecer competitivos frente a Kindle, van a tener que mejorar su soporte para css ya que hoy por hoy el lector de Amazon les está sacando cada vez más ventajas en ese campo. Así que creo que pronto Nook, Sony y otros van a darle soporte a esas propiedades que estoy utilizando.
(Translation: ADE-based readers should improve if they want to stay competitive against Kindle. He believes Nook, Sony and others will soon support these additional CSS properties.)

I wish I could be as optimistic as you are, but experience has shown me that I should never expect things to improve in the way I'd like them to. In all these years I haven't seen any significant development in ADE-based readers, except some hyphenation and ligatures support. Old limitations are still there, and I don't see any reader vendor is interested in changing that (Bookeen once looked as if they were, but that was then). Any future "improvement", I'm afraid, will be in the way of bells and whistles, animations, facebook and one-touch buying, and not in better CSS support, spec compliance or layout control (for the user).
Jellby is offline   Reply With Quote
Old 09-15-2013, 03:38 PM   #13
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Jellby View Post
But Kindles do not read ePub, even if the inside of a KF8 file is similar to ePub. And Sigil is an ePub editor.
For all intents and purposes the KF8 format is ePub2 plus most non-interactive HTML5/CSS3 elements. Both KindleGen and Calibre will convert valid ePubs without changes to the source code just fine and both hobbyists and professional ebook designers use Sigil to create Kindle books.

In many ways the current Kindle devices offer more layout features than ADE-based devices. And, as your many posts in the Known ADE bugs forum show, you of all people should be fully aware of the many bugs and limitations in ADE.
IMHO, Adobe just got lucky, because nobody else bothered to develop competing DRM solutions and most ereader manufacturers need to buy an RMDSK license for DRM support alone.

Quote:
Originally Posted by Jellby View Post
Any future "improvement", I'm afraid, will be in the way of bells and whistles, animations, facebook and one-touch buying, and not in better CSS support, spec compliance or layout control (for the user).
I'm not so pessimistic. While new ereaders will doubtlessly come with a plethora of social network and in-app buying features that nobody wanted, ebook manufacturers will eventually discover ePub3 as a marketing tool and will demand that the firmware of their ereaders support ePub3/HTML5/CSS3.

And since the solution suggested by RbnJrg will already work on two different "ecosystems" (iBooks and Kindle/KF8) I fail to see why he shouldn't post them here just because purists insist on Kindles not being "real" ePub2 readers.

@RbnJrg: Keep your often innovative solutions coming.
Doitsu is offline   Reply With Quote
Old 09-15-2013, 03:52 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,527
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Doitsu View Post

@RbnJrg: Keep your often innovative solutions coming.
I'll do so
RbnJrg is offline   Reply With Quote
Old 09-15-2013, 08:02 PM   #15
crich70
Grand Sorcerer
crich70 ought to be getting tired of karma fortunes by now.crich70 ought to be getting tired of karma fortunes by now.crich70 ought to be getting tired of karma fortunes by now.crich70 ought to be getting tired of karma fortunes by now.crich70 ought to be getting tired of karma fortunes by now.crich70 ought to be getting tired of karma fortunes by now.crich70 ought to be getting tired of karma fortunes by now.crich70 ought to be getting tired of karma fortunes by now.crich70 ought to be getting tired of karma fortunes by now.crich70 ought to be getting tired of karma fortunes by now.crich70 ought to be getting tired of karma fortunes by now.
 
crich70's Avatar
 
Posts: 11,306
Karma: 43993832
Join Date: Feb 2010
Location: Monroe Wisconsin
Device: K3, Kindle Paperwhite, Calibre, and Mobipocket for Pc (netbook)
Select all of the text in your sigil document and then choose the option under the paragraphs alignment that centers text. That should do it.
crich70 is offline   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
Another dumb question. kamanza Sigil 5 07-12-2012 02:11 PM
Dumb Question Pomtroll Sony Reader 6 10-07-2011 03:14 PM
Dumb Question, but... omro Astak EZReader 6 12-04-2009 04:32 PM
Unutterably Silly There is never a dumb question, only dumb people! Dr. Drib Lounge 17 12-29-2008 09:43 AM
really dumb question ernietd Kindle Formats 2 11-01-2008 12:31 AM


All times are GMT -4. The time now is 02:37 AM.


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