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 08-17-2010, 04:03 PM   #1
Pablo
Guru
Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.
 
Pablo's Avatar
 
Posts: 757
Karma: 3058207
Join Date: Mar 2009
Location: Rosario, Argentina
Device: SONY PRS-505, PRS-T2
Problem with <br /> tags

I am using Sigil 0.2.0.
When importing html files, <br /> tags get converted to

Code:
<p> <br /> </p>
Is this correct? When I load the resulting epub in my Sony 505, the blank line is lost, unless I put two consecutive <br /> tags, in which case I get one blank line.

Is it illegal to have an isolated <br /> tag in one line in epub?
Pablo is offline   Reply With Quote
Old 08-17-2010, 05:42 PM   #2
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 Pablo View Post
Is it illegal to have an isolated <br /> tag in one line in epub?
Yes. Sigil is correctly wrapping them in a block tag.

You shouldn't be using br tags to set margins anyway - do that in the css.
charleski is offline   Reply With Quote
Old 08-17-2010, 06:12 PM   #3
Pablo
Guru
Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.
 
Pablo's Avatar
 
Posts: 757
Karma: 3058207
Join Date: Mar 2009
Location: Rosario, Argentina
Device: SONY PRS-505, PRS-T2
Quote:
Originally Posted by charleski View Post
Yes. Sigil is correctly wrapping them in a block tag.

You shouldn't be using br tags to set margins anyway - do that in the css.
I'm not using br tags for margins. I use <br /> to generate a blank line in the middle of the text.
Pablo is offline   Reply With Quote
Old 08-17-2010, 06:24 PM   #4
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 Pablo View Post
I'm not using br tags for margins. I use <br /> to generate a blank line in the middle of the text.
That's a block margin. Margins aren't only at the sides of the page. Just use a style class with margin-top:1.2em (or whatever your line-height is, 1.2 is the default). I know a lot of people misuse br tags line this (or, worse, use <p>&nbsp;</p>), but it's a bad habit to adopt.
charleski is offline   Reply With Quote
Old 08-17-2010, 06:32 PM   #5
Pablo
Guru
Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.
 
Pablo's Avatar
 
Posts: 757
Karma: 3058207
Join Date: Mar 2009
Location: Rosario, Argentina
Device: SONY PRS-505, PRS-T2
Quote:
Originally Posted by charleski View Post
That's a block margin. Margins aren't only at the sides of the page. Just use a style class with margin-top:1.2em (or whatever your line-height is, 1.2 is the default). I know a lot of people misuse br tags line this (or, worse, use <p>&nbsp;</p>), but it's a bad habit to adopt.
Could you expand? In short, to insert a line break, what should I do? (in html and in epub)
Pablo is offline   Reply With Quote
Old 08-17-2010, 07:12 PM   #6
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
I typically use the following css:

.indent {
margin: 0;
text-indent: 1em
}

.flush {
margin-top: 1.25em;
margin-bottom: 0;
text-indent: 0
}

Then the text goes:
<p class="indent">This paragraph has the first line indented. Lorem ipsum dolor sit amet, id euismod, consectetuer nec aliquam. Sagittis amet, nec nunc, qui accumsan turpis. A tempus, class aliquam tempor, eget wisi. Enim duis eros, ut eros. Mauris ut lectus, lorem semper, leo ut convallis.</p>

<p class="flush">This paragraph will appear with a blank line above it and without an indent. Adipiscing posuere, lobortis nec nec, ipsum iaculis. Aliquam posuere dolor, leo nulla, nulla mi. Wisi ut commodo, justo tellus vel. Vitae occaecati platea. Nam a sapien, porta lacus platea, pellentesque eleifend.</p>
charleski is offline   Reply With Quote
Old 08-17-2010, 10:55 PM   #7
pietvo
Reader
pietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notes
 
pietvo's Avatar
 
Posts: 514
Karma: 24612
Join Date: Aug 2009
Location: Cochabamba, BO
Device: Onyx Boox 60, iPod Touch
Quote:
Originally Posted by Pablo View Post
Could you expand? In short, to insert a line break, what should I do? (in html and in epub)
A line break is <br /> (or in older HTML <br>) but a line break is different from a blank line.
pietvo is offline   Reply With Quote
Old 08-18-2010, 08:50 AM   #8
Pablo
Guru
Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.
 
Pablo's Avatar
 
Posts: 757
Karma: 3058207
Join Date: Mar 2009
Location: Rosario, Argentina
Device: SONY PRS-505, PRS-T2
Quote:
Originally Posted by charleski View Post
I typically use the following css:

.indent {
margin: 0;
text-indent: 1em
}

.flush {
margin-top: 1.25em;
margin-bottom: 0;
text-indent: 0
}

Then the text goes:
<p class="indent">This paragraph has the first line indented. Lorem ipsum dolor sit amet, id euismod, consectetuer nec aliquam. Sagittis amet, nec nunc, qui accumsan turpis. A tempus, class aliquam tempor, eget wisi. Enim duis eros, ut eros. Mauris ut lectus, lorem semper, leo ut convallis.</p>

<p class="flush">This paragraph will appear with a blank line above it and without an indent. Adipiscing posuere, lobortis nec nec, ipsum iaculis. Aliquam posuere dolor, leo nulla, nulla mi. Wisi ut commodo, justo tellus vel. Vitae occaecati platea. Nam a sapien, porta lacus platea, pellentesque eleifend.</p>
Thank you very much!!!
Pablo is offline   Reply With Quote
Old 08-18-2010, 11:12 AM   #9
sourcejedi
Groupie
sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.
 
sourcejedi's Avatar
 
Posts: 155
Karma: 200000
Join Date: Dec 2009
Location: Britania
Device: FBReader/OpenInkpot on Hanvon N516.
Quote:
Originally Posted by charleski View Post
I typically use the following css:

.flush {
margin-top: 1.25em;
margin-bottom: 0;
text-indent: 0
}

Then the text goes:

[...] leo ut convallis.</p>

<p class="flush">This paragraph will appear with a blank line above [...]
Ew. I've seen this stated a couple of times, but not been able to work out _why_.

What is the reason for preferring this approach to an "empty paragraph" / line break tag / etc? Doesn't this break the principle that HTML should be semantic, and that it should degrade gracefully?

Suppose you do this on a website. Suppose you also have some styling that unfortunately makes it unreadable for me on my device - due to colour, screen width, font choice / size or something. In my case, I have a netbook with an 800px wide screen - which is too narrow for some sites. So I disable styles (View -> Page style -> None).

Now I miss your "block margin".
sourcejedi is offline   Reply With Quote
Old 08-18-2010, 12:45 PM   #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: 6,316
Karma: 4963983
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Semantically, there is not a blank line, there is, at most, some "break" in the story, a change in scene, an unnamed section break, whatever. And to mark this you can either:

Code:
<p>This is a normal paragraph.</p>

<p class="scene-break">This is a paragraph after a break.</p>
and put some top margin in p.scene-break, or:

Code:
<p>This is a normal paragraph.</p>

<div class="scene-break"/>

<p>This is a paragraph after a break.</p>
and style the div.scene-break to have some height, margin, content, etc. (depending on the renderer, you may have to put an &nbsp; inside).

And of course there will be cases where this is not rendered exactly the same with and without CSS, that's the whole point of CSS and content/formatting separation. Anyway, this is ePUB, and ePUB readers are required to support CSS.
Jellby is offline   Reply With Quote
Old 08-18-2010, 03:48 PM   #11
sourcejedi
Groupie
sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.
 
sourcejedi's Avatar
 
Posts: 155
Karma: 200000
Join Date: Dec 2009
Location: Britania
Device: FBReader/OpenInkpot on Hanvon N516.
Good point. I think <div class="break">&nbsp;</div> is the lesser evil, but then epub gets held to different standards than the Web. (And this is a point of divergence from the web; there's no universally endorsed best practise for this because by default websites will separate _all_ paragraphs with a blank line).

More relevantly: I found a related thread. Summary: test your scene breaks carefully on ADE, because it can potentially re-arrange paragraphs in a way that will insert extra blank lines at the end of pages, making it impossible to see where the actual scene breaks are. (Read the thread to work out what you need to test).

With the <div> method, you have to use CSS to ensure that the <div> doesn't end up at the end of a page. If margin-top avoids that problem, I guess that makes it simpler to use. (It also suggests you shouldn't use margin-bottom to create scene breaks... but I expect my ignorance is showing here).

Last edited by sourcejedi; 08-18-2010 at 03:52 PM. Reason: formatting & nitpicks
sourcejedi is offline   Reply With Quote
Old 08-18-2010, 04:04 PM   #12
ghostyjack
Guru
ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.
 
ghostyjack's Avatar
 
Posts: 718
Karma: 1085604
Join Date: Mar 2009
Location: Bristol, England
Device: PRS-T1, 1825PT, Galaxy Tab, One X, TF700T, Aura HD, Nexus 7
I'm self-taught with HTML/XHTML so haven't been taught any "best practice" techniques.

I generally use <p>&nbsp;</p> as a scene break when I have "margin: 0" in the p tag in the CSS file. This works, what's the problem with it?
ghostyjack is offline   Reply With Quote
Old 08-18-2010, 05:08 PM   #13
sourcejedi
Groupie
sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.sourcejedi ought to be getting tired of karma fortunes by now.
 
sourcejedi's Avatar
 
Posts: 155
Karma: 200000
Join Date: Dec 2009
Location: Britania
Device: FBReader/OpenInkpot on Hanvon N516.
ghostyjack: That's the same as the second option Jellby presented. The only difference is Jellby said "div" instead of "p" - after all, the blank line isn't actually a paragraph. Which sounds like a good idea to me, but I don't know whether it would ever matter.
sourcejedi is offline   Reply With Quote
Old 08-18-2010, 05:23 PM   #14
capidamonte
Not who you think I am...
capidamonte , Klaatu Barada Niktu!capidamonte , Klaatu Barada Niktu!capidamonte , Klaatu Barada Niktu!capidamonte , Klaatu Barada Niktu!capidamonte , Klaatu Barada Niktu!capidamonte , Klaatu Barada Niktu!capidamonte , Klaatu Barada Niktu!capidamonte , Klaatu Barada Niktu!capidamonte , Klaatu Barada Niktu!capidamonte , Klaatu Barada Niktu!capidamonte , Klaatu Barada Niktu!
 
capidamonte's Avatar
 
Posts: 346
Karma: 5337
Join Date: Jan 2010
Location: Honolulu
Device: Sony PRS-350
No, he didn't. He wrote:

Code:
<div class="scene-break"/>
Which has no content. Inserting a paragraph and/or a non-breaking-space is adding content which is not contained in the original document.

The div above doesn't add anything and can be displayed (or not) in any manner that CSS describes. The structure is marked up in his example, but the display of a blank line is not forced.

If someone wanted to display scene breaks with a set of diamonds, or asterisks or a horizontal line or an image of a giant dinosaur, there would be no way to do it in any example that contains a plain paragraph, or a plain line break.
capidamonte is offline   Reply With Quote
Old 08-18-2010, 06:54 PM   #15
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
Actually the clearest way of doing it would probably be
<div class="scene">
<p>...</p>
<p>...</p>
<p>...</p>
</div>
<div class="scene">
etc.
with
div.class + p {
text-indent: 0
}
But I don't think in practice this really gains anything over merely indicating the semantics with a class change. Changing a class is a perfectly valid way of indicating that one block has different semantics to another.
charleski 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
Tags gone again ccowie Calibre 5 07-26-2010 02:53 PM
Problem with collections/tags Shadowjack Calibre 11 04-21-2010 10:25 AM
<br /> Tags ghostyjack Sigil 5 09-14-2009 08:08 AM
Tags import problem femto Calibre 10 04-22-2009 05:39 AM
Tags pcmedic Sony Reader 7 02-19-2009 10:36 AM


All times are GMT -4. The time now is 11:20 AM.


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