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 03-29-2014, 01:02 AM   #1
blackxacto
Enthusiast
blackxacto began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Mar 2013
Device: iMac 10,1, OSX10.9
Talking 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.
blackxacto is offline   Reply With Quote
Old 03-29-2014, 04:12 AM   #2
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
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>
And set p {text-indent:1em} in the CSS.
Jellby is offline   Reply With Quote
Advert
Old 03-29-2014, 12:17 PM   #3
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,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:
Originally Posted by blackxacto View Post
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.
Jelby shows the best place to do book wide styling. The CSS.

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).
theducks is offline   Reply With Quote
Old 03-29-2014, 09:34 PM   #4
blackxacto
Enthusiast
blackxacto began at the beginning.
 
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.
blackxacto is offline   Reply With Quote
Old 03-29-2014, 11:47 PM   #5
blackxacto
Enthusiast
blackxacto began at the beginning.
 
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.
blackxacto is offline   Reply With Quote
Advert
Old 03-30-2014, 12:36 AM   #6
tempura
Connoisseur
tempura knows more than wikipediatempura knows more than wikipediatempura knows more than wikipediatempura knows more than wikipediatempura knows more than wikipediatempura knows more than wikipediatempura knows more than wikipediatempura knows more than wikipediatempura knows more than wikipediatempura knows more than wikipediatempura knows more than wikipedia
 
Posts: 71
Karma: 47102
Join Date: Dec 2013
Location: Outside the Universe
Device: Kindle PW3
Quote:
Originally Posted by blackxacto View Post
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.
Umm, did you link the .css file to HTML. If you didn't then in SIGIL, just right click on the HTML and select "Link Stylesheets", tick the name of the css file and click "OK".

Or you could manually add this text to the HTML within the <head>...</head>

Code:
<link href="[filename].css" rel="stylesheet" type="text/css"/>
where [filename] is the name of the CSS.

Last edited by tempura; 03-30-2014 at 12:39 AM.
tempura is offline   Reply With Quote
Old 03-30-2014, 03:29 AM   #7
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
You probably need to learn some basic HTML and CSS first. Read a few tutorials, and do all editing in "code view".
Jellby is offline   Reply With Quote
Old 03-30-2014, 05:29 AM   #8
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by blackxacto View Post
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.
You don't put it in the chapter files; you put it (once only) in the Stylesheet - the file with a ".css" extension.
HarryT is offline   Reply With Quote
Old 03-30-2014, 06:59 AM   #9
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
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:

Click image for larger version

Name:	BeforeCSS.png
Views:	210
Size:	59.9 KB
ID:	121017

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:

Click image for larger version

Name:	LinkStylesheets.png
Views:	198
Size:	62.4 KB
ID:	121018 Click image for larger version

Name:	LinkStylesheetsMenu.png
Views:	190
Size:	3.5 KB
ID:	121019

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:

Click image for larger version

Name:	AfterCSS.png
Views:	168
Size:	62.3 KB
ID:	121020

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:
<?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/stylesheet.css" rel="stylesheet" type="text/css"/></head>

<body>
<h2>I. OF CIVIL OBEDIENCE</h2>

<blockquote class="belowchapter">
<p class="noindent"><span class="italics">1. The mystery of civil obedience. 2. The historical character of obedience. 3. Statics and dynamics of obedience. 4. Obedience linked to credit</span>.</p>
</blockquote>

<p class="noindent"><span class="raisedcap">A</span><span class="smallcaps">fter</span> describing in his lost treatises on Constitutions the various governmental structures of a large number of different societies, Aristotle, in the <span class="italics">Politics</span>, reduced them all to three basic types: monarchy, aristocracy, and democracy. The characteristics of these three types, in the various mixtures in which they were found in practice, accounted for all the forms of Power which had come under his observation.</p>

[...]
Note: As you can see in RED, "Link Stylesheets" applied the CSS file to the top of my HTML file.

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:
Originally Posted by Jellby View Post
You probably need to learn some basic HTML and CSS first. Read a few tutorials, and do all editing in "code view".
I second this. Even just learning basic HTML+CSS will help:

<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.
Tex2002ans is offline   Reply With Quote
Old 03-30-2014, 07:29 AM   #10
Calenorn
Brash Fumbler
Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.
 
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.
Calenorn is offline   Reply With Quote
Old 03-30-2014, 08:54 AM   #11
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
There is one made by Pablo. I believe he also put it on the Wiki.
Toxaris is offline   Reply With Quote
Old 03-30-2014, 10:49 AM   #12
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Calenorn View Post


What an excellent post from Tex2002ans!


Quote:
Originally Posted by Calenorn View Post
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.
I also second taking apart other EPUBs and learning how they work (that is probably how most of us on MobileRead learned, that is definitely how I did). You like the look of something in EPUB? Take apart the code, figure out how it works, and then emulate it/take it and use it in your own books!

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:
Originally Posted by Toxaris View Post
There is one made by Pablo. I believe he also put it on the Wiki.
https://wiki.mobileread.com/wiki/EPub_Tutorial
Tex2002ans is offline   Reply With Quote
Old 04-01-2014, 05:06 PM   #13
ShellShock
Wizard
ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.
 
ShellShock's Avatar
 
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.
ShellShock is offline   Reply With Quote
Old 04-02-2014, 09:43 AM   #14
Calenorn
Brash Fumbler
Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.Calenorn ought to be getting tired of karma fortunes by now.
 
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!

Calenorn is offline   Reply With Quote
Old 04-02-2014, 11:21 AM   #15
MickiTee
Guru
MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.
 
MickiTee's Avatar
 
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.
MickiTee 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
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


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


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