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-03-2013, 01:51 AM   #1
CyanBC
Junior Member
CyanBC began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Apr 2013
Device: Kindle Touch
Creating Indents on <br class="calibre1" />

I'm having trouble editing an epub in Sigil that has breaks after each paragraph as
<br class="calibre1" />
I'm trying to get all the new paragraphs to be indented.

It looks like this

<p class="calibre2">Text goes here and its a paragraph and reading this is boring blah blah blah.<br class="calibre1" />
This is the new line, this is where I cannot seem to get an indent for the new line, causing all the text to be broken into different paragraphs correctly, but not indent these lines<br class="calibre1" />
This line would also not be indented as I would like...

I'm able to edit the sytlesheet to have the calibre2 be indented. But I cannot get the calibre1 to be indented and I need to maintain the <br ... /> structure in the document because to do otherwise is immensely painful. I've tried adding this to the style sheet

.calibre1 {
text-indent: 1.5em;
}
br.calibre1 {
text-indent: 1.5em;
}
br {
text-indent: 1.5em;
}

I've even tried changing it from <br.../>/ to <p.../> and adding the proper entries in the style sheet. But i still cant seem to touch it because of the <.../> formatting.

Am I missing something?
CyanBC is offline   Reply With Quote
Old 04-03-2013, 02:38 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,802
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
You have 1 big paragraph with forced line breaks
IMHO that is a horrible way to do things (in most cases)


I suggest converting those <BR /> into </p> <p class="calibre1">
theducks is offline   Reply With Quote
Advert
Old 04-03-2013, 03:00 AM   #3
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,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Simply put: the input document is wrong, that's one of the reasons one should not use <br/> for paragraph breaks, you cannot get indents. Do as theducks says and add proper paragraph breaks.
Jellby is offline   Reply With Quote
Old 04-03-2013, 08:29 PM   #4
teh603
Autism Spectrum Disorder
teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.
 
teh603's Avatar
 
Posts: 1,212
Karma: 6244877
Join Date: Sep 2011
Location: Coastal Texas
Device: Android Phone
I'd suggest the Smashwords Nuke: copy everything into notepad, reimport the resulting .txt, and craft your own style sheet.
teh603 is offline   Reply With Quote
Old 04-03-2013, 09:57 PM   #5
CyanBC
Junior Member
CyanBC began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Apr 2013
Device: Kindle Touch
What need to happen and how I fixed it:

I just did a search for all <br class="calibre1" /> and replaced with <p class="calibre1" />

Then I `Saved` and re-opened, this causes Sigil to add <p>the text</p> wherever those things are located (or something, I might be wrong, but it changes it).

Then the stylesheet worked.
CyanBC is offline   Reply With Quote
Advert
Old 04-04-2013, 02:28 AM   #6
Ahmad Samir
Zealot
Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!
 
Posts: 114
Karma: 5246
Join Date: Jul 2010
Device: none
Quote:
Originally Posted by CyanBC View Post
What need to happen and how I fixed it:

I just did a search for all <br class="calibre1" /> and replaced with <p class="calibre1" />

Then I `Saved` and re-opened, this causes Sigil to add <p>the text</p> wherever those things are located (or something, I might be wrong, but it changes it).

Then the stylesheet worked.
Look at theducks' post again, you should have replaced <br class="calibre1" /> with:
</p> <p class="calibre1">

so that you end the first paragraph (with </p>) and then start a new one (with <p class="calibre1">).

Whatever you used worked because Sigil uses Tidy, which "corrected" all the syntax for you, but I'd be careful in the future as Tidy sometimes goes into crazy-overzealous-correcting mode if the code is too badly messed up.

Note that there's no <p /> tag, the end paragraph tag is </p>, which comes after <p>.

<br> is a special case, it only has a start tag and no end tag; so use <br> in html and <br /> in xhtml, c.f. https://developer.mozilla.org/en-US/...TML/Element/br
Ahmad Samir is offline   Reply With Quote
Old 04-04-2013, 08:14 AM   #7
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Just my .02¢...

I would replace <br class="calibre1" /> with </p><p> (no class).

I find it unnecessary to define a class for a normal paragraph. Simply style the normal paragraph in your CSS with
p {text-indent: 1.5em}
Then you only need to add classes to paragraphs that are different. This ends up being much cleaner and saves a bunch of bloat (smaller file size).

Cheers!

Last edited by Turtle91; 04-04-2013 at 08:19 AM.
Turtle91 is online now   Reply With Quote
Old 04-04-2013, 08:16 AM   #8
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Duplicate post

Last edited by Turtle91; 04-04-2013 at 08:17 AM. Reason: Duplicate post
Turtle91 is online now   Reply With Quote
Old 04-04-2013, 09:17 AM   #9
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,802
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 Turtle91 View Post
Just my .02¢...

I would replace <br class="calibre1" /> with </p><p> (no class).

I find it unnecessary to define a class for a normal paragraph. Simply style the normal paragraph in your CSS with
p {text-indent: 1.5em}
Then you only need to add classes to paragraphs that are different. This ends up being much cleaner and saves a bunch of bloat (smaller file size).

Cheers!
Since the OP is not you , he had a class, He will probably want to continue using the class or the lines could end up with a different look

I am stressing 2 Points:
1) Don't rely on Tidy to make YOUR code clean.
2) Always write/use the cleanest (replacement) solution, don't rely on Tidy.
theducks is offline   Reply With Quote
Old 04-04-2013, 11:32 AM   #10
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by theducks View Post
Since the OP is not you , he had a class, He will probably want to continue using the class or the lines could end up with a different look
I definitely agree with your two points.

I was simply commenting that having a class on every normal paragraph is not necessary and leads to bloat. The only purpose to the OP's Calibre1 class was to indent the line...not something that would change the look if it was included as part of the p {} style.
Turtle91 is online now   Reply With Quote
Old 04-04-2013, 04:39 PM   #11
teh603
Autism Spectrum Disorder
teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.
 
teh603's Avatar
 
Posts: 1,212
Karma: 6244877
Join Date: Sep 2011
Location: Coastal Texas
Device: Android Phone
Or he could create a .indent class and handle it that way?
teh603 is offline   Reply With Quote
Old 04-04-2013, 04:58 PM   #12
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,802
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 teh603 View Post
Or he could create a .indent class and handle it that way?
Look at the stylesheet in the early post. calibre1 has a 1.5em indent
theducks is offline   Reply With Quote
Old 04-04-2013, 07:58 PM   #13
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by teh603 View Post
Or he could create a .indent class and handle it that way?
No...the whole point is that you DON'T need a specific class for all your "normal" paragraphs at all. 4000 paragraphs x <p class="indent"> = a lot more space/bloat/file size than just <p> with one style in the css p {text-indent:1.2em}
Turtle91 is online now   Reply With Quote
Old 04-04-2013, 09:42 PM   #14
teh603
Autism Spectrum Disorder
teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.teh603 ought to be getting tired of karma fortunes by now.
 
teh603's Avatar
 
Posts: 1,212
Karma: 6244877
Join Date: Sep 2011
Location: Coastal Texas
Device: Android Phone
Quote:
Originally Posted by Turtle91 View Post
No...the whole point is that you DON'T need a specific class for all your "normal" paragraphs at all. 4000 paragraphs x <p class="indent"> = a lot more space/bloat/file size than just <p> with one style in the css p {text-indent:1.2em}
I got the feeling that he wanted some paragraphs indented, and some not.
teh603 is offline   Reply With Quote
Old 04-04-2013, 10:11 PM   #15
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
<p>
<p class="noindent">
<p class="spacebreak">

p {
margin-top: 0;
margin-bottom: 0;
text-indent: 1.2em
}
.noindent {
text-indent: 0
}
.spacebreak {
margin-top: 2em;
text-indent: 0
}

There you go; indented, not indented and even a section break.

Last edited by JSWolf; 04-05-2013 at 12:10 PM.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
class="none" vs class="none1" hymie Conversion 2 10-27-2011 06:45 AM
Value of Attribute "Class" is Invalid Error TFaire ePub 2 09-23-2011 11:25 AM
Changing or removing <div class="calibrenavbar"> ptsefton Recipes 3 05-28-2011 08:30 AM
How to reduce indents without "removing space between paragraphs" Skydog Calibre 5 06-05-2010 12:58 AM
Line indents using "<div>" tags HarryT Kindle Formats 11 04-29-2009 10:18 PM


All times are GMT -4. The time now is 06:23 PM.


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