03-29-2014, 01:02 AM | #1 |
Enthusiast
Posts: 37
Karma: 10
Join Date: Mar 2013
Device: iMac 10,1, OSX10.9
|
No Paragraph indents
Have an epub file (book). In iBooks, the book comes up with no paragraph indents. I want ahead and read the book, but in Sigil, I would like to Find and Replace all paragraphs with a 1 EM indent or something close. Will anyone share the code for this:
end of paragraph. <br class="chapter" /> This is the start of a paragraph as is. Sigil shows a space before the paragraph start. Does not show in iBooks. |
03-29-2014, 04:12 AM | #2 |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
That's wrong, <br> is not a paragraph, but a linebreak. Use this:
Code:
<p>... end of paragraph.</p> <p>This is the start of a paragraph ...</p> |
Advert | |
|
03-29-2014, 12:17 PM | #3 | |
Well trained by Cats
Posts: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Simple: ADD that line at the BOTTOM of the CSS. The last definition found prevails. (sledge hammer approach). This should override any previous setting. Better: Look a the code (we will be back to this again). If you see a <p class="<name>">. Note the name, then find it in the CSS. it may appear in the CSS as (a dot)name or p(a dot)name. If there is a text-indent: 0; , simply change the 0 to a value: (1.2em works and scales well, for me) If there is no text-indent:, just add one (with your value) between the { }'s. Be sure the previous line ends with a semi-colon (the continuation character). |
|
03-29-2014, 09:34 PM | #4 |
Enthusiast
Posts: 37
Karma: 10
Join Date: Mar 2013
Device: iMac 10,1, OSX10.9
|
Thanks, Jelby and theducks for responding. Have not tried to correct as yet, but wanted to say i appreciate your help.
|
03-29-2014, 11:47 PM | #5 |
Enthusiast
Posts: 37
Karma: 10
Join Date: Mar 2013
Device: iMac 10,1, OSX10.9
|
Anyone ever feel like you've missed the downtown bus and its dark, and getting darker, and you don't know if there will be further runs?
Tried to open the ebook in Textwrangler, but it said I had to save as an html doc first, so I did, then inserted the last line "p {text-indent:1em}", then decided I didn't know what the hell I was doing, so I opened Sigil and inserted the p {text-indent:1em} last in each text chapter, but to no effect. Is there a book you guy's have used to make sense of the converting and editing. I understand pasting code, but it ain't exactly working, but since I don't know what Im doing, oh well. |
Advert | |
|
03-30-2014, 12:36 AM | #6 | |
Connoisseur
Posts: 71
Karma: 47102
Join Date: Dec 2013
Location: Outside the Universe
Device: Kindle PW3
|
Quote:
Or you could manually add this text to the HTML within the <head>...</head> Code:
<link href="[filename].css" rel="stylesheet" type="text/css"/> Last edited by tempura; 03-30-2014 at 12:39 AM. |
|
03-30-2014, 03:29 AM | #7 |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
You probably need to learn some basic HTML and CSS first. Read a few tutorials, and do all editing in "code view".
|
03-30-2014, 05:29 AM | #8 | |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
Quote:
|
|
03-30-2014, 06:59 AM | #9 | ||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Would probably be nice if we could get some sample code of an HTML page in the book + the code in the CSS file if it exists, and any screenshots showing off your problem.
Example, here is a chapter in a book I am currently working on with no CSS applied: If you right click the HTML file in the left-hand side under the "Book Browser" and press "Link Stylesheets", you will get a menu which SHOULD show any CSS files included in the book: Make sure there is a checkbox in the box (meaning that stylesheet will be applied to that HTML file), and press Ok. NOTE: If there are no CSS files, this list will be blank. This probably means there is CSS Styles at the TOP of your files (again, requested that you post actual code samples from your book). After applying the CSS file, the look of the book will change: NOTE: IF you already have a CSS file, you should see it under the "Styles" folder (highlighted in orange). Posting the code from there will help us figure out what is causing problems. Example: Here is the HTML code from the above WIP book: Quote:
Here is some CSS in my stylesheet.css: Code:
body { margin-left: 5%; margin-right: 5%; } h1, h2, h3, h4 { text-align: center; text-indent: 0; } p { margin-top: 0; margin-bottom: 0; line-height: 1.2em; text-align: justify; text-indent: 2em; } blockquote { margin-top: 1em; margin-bottom: 1em; margin-left: 10%; margin-right: 10%; } .noindent { text-indent: 0; } span.raisedcap { font-size: 2em; } .italics { font-style: italic; } Quote:
<p>, <h#>, <blockquote>, <span>, classes, ... Those basics aren't much harder than learning to use this forum posting software. Last edited by Tex2002ans; 03-30-2014 at 07:05 AM. |
||
03-30-2014, 07:29 AM | #10 |
Brash Fumbler
Posts: 1,140
Karma: 8290493
Join Date: May 2013
Device: NST, Kobo Mini
|
What an excellent post from Tex2002ans! As a complete noob I learned much of what was listed in that post by reverse engineering other e-books in Sigil. One post like this one could have saved me hours of work. Is an extremely basic tutorial available somewhere? If not, we should build one here. |
03-30-2014, 08:54 AM | #11 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
There is one made by Pablo. I believe he also put it on the Wiki.
|
03-30-2014, 10:49 AM | #12 | ||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
For example, I emulated this "blog post"/"website"/"box" code right out of an EPUB I purchased (Post #5, Post #10): https://www.mobileread.com/forums/sho...d.php?t=218023 There are plenty of well-formatted books in the "epub Books" section of MobileRead: https://www.mobileread.com/forums/forumdisplay.php?f=130 I have also attached a bunch of EPUBs I created around these boards as "real-life examples" while explaining things. For example, in post #19 and #23 in this topic: https://www.mobileread.com/forums/sho...d.php?t=225045 Quote:
|
||
04-01-2014, 05:06 PM | #13 |
Wizard
Posts: 1,176
Karma: 2431850
Join Date: Sep 2008
Device: IPad Mini 2 Retina
|
The w3c has some great tutorials on writing web pages, a lot of which applies to epubs too: http://www.w3schools.com.
|
04-02-2014, 09:43 AM | #14 |
Brash Fumbler
Posts: 1,140
Karma: 8290493
Join Date: May 2013
Device: NST, Kobo Mini
|
Thanks, all. I have bookmarked Pablo's tutorial.
Can I just say that everyone I've interacted with here at mobileread has been awesome? Because they have! |
04-02-2014, 11:21 AM | #15 |
Guru
Posts: 836
Karma: 3976266
Join Date: Jun 2012
Location: London, UK
Device: Sony PRS-505, Pocketbook TL3, TL4, TL5
|
There's also the Sigil User Guide. Its very good at explaining the basics, including ones on Code View & HTML and Stylesheets via tutorials.
You can access it from the Help menu in Sigil or its available as and Epub download. |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Questions about paragraph spacing and indents | denverh | Conversion | 6 | 04-04-2012 01:31 PM |
Losing Indents and Paragraph spacing | videopope | ePub | 11 | 06-03-2011 07:47 PM |
LRF - losing indents and paragraph spacing | jjansen | Conversion | 12 | 02-04-2011 07:45 AM |
First paragraph line indents | jhempel24 | Sigil | 10 | 11-23-2010 07:26 PM |
Paragraph indents from command line | JSWolf | Calibre | 4 | 11-06-2008 08:41 PM |