Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 07-28-2011, 06:55 PM   #1
Ransom
Banned
Ransom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensions
 
Posts: 242
Karma: 51054
Join Date: Jun 2011
Location: Belleville, IL
Device: Kindle-3
A Way To Keep "Certain" Lines From Indenting?

Whenever Calibre sees a blockquote, it automatically indents the first line of it just like any other paragraph. But often a blockquote will contain something like a poem or a song where you wouldn't want the first line indented. Is there a way to stop individual lines from being indented without having to resort to a 'pre' tag? (which just brings about a new set of problems). This is NOT what I want:

Ransom is offline   Reply With Quote
Old 07-28-2011, 11:12 PM   #2
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Put this in extra css under the Look and Feel settings:
Code:
blockquote > p:first-child {text-indent:0;}
ldolse is offline   Reply With Quote
Advert
Old 07-28-2011, 11:14 PM   #3
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Quote:
Originally Posted by ldolse View Post
Put this in extra css under the Look and Feel settings:
Code:
blockquote > p:first-child {text-indent:0;}
Google 'css psuedo selectors' for other examples of other specific content. As I recall Calibre doesn't support all pseudo selectors, but many work (search the forum for details).

Edit: that may not work, see this post for further discussion/links:
https://www.mobileread.com/forums/sho...d.php?t=112344

Based on the image you may be able to get away with this:
Code:
blockquote > p {text-indent:0;}

Last edited by ldolse; 07-28-2011 at 11:17 PM.
ldolse is offline   Reply With Quote
Old 07-29-2011, 12:51 PM   #4
Ransom
Banned
Ransom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensions
 
Posts: 242
Karma: 51054
Join Date: Jun 2011
Location: Belleville, IL
Device: Kindle-3
Thanks, but neither of those seem to work. I even tried the following setting all values to zero, and that didn't work either, so I guess CSS isn't going to help.

<STYLE type="text/css"> <!-- BLOCKQUOTE.passage P {text-indent: 0em; margin-top: 0; margin-bottom: 0;} BLOCKQUOTE.passage BLOCKQUOTE P {text-indent: 0;} --> </STYLE>

Edit: I should point out that using a 'pre' tag rather than a block quote would seem ideal. The caveat is that you can't use any kind of html generated 'em dash' inside of a pre tag, or at least I don't know of a way to do it. So the only way to use a dash inside a pre is to use something else to represent it like a pair of hyphens: -- or maybe tildas: ~~, but darn it, I want my text to look just like the book!

Last edited by Ransom; 07-29-2011 at 01:10 PM.
Ransom is offline   Reply With Quote
Old 07-29-2011, 03:17 PM   #5
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Quote:
Originally Posted by Ransom View Post
Thanks, but neither of those seem to work. I even tried the following setting all values to zero, and that didn't work either, so I guess CSS isn't going to help.

<STYLE type="text/css"> <!-- BLOCKQUOTE.passage P {text-indent: 0em; margin-top: 0; margin-bottom: 0;} BLOCKQUOTE.passage BLOCKQUOTE P {text-indent: 0;} --> </STYLE>

Edit: I should point out that using a 'pre' tag rather than a block quote would seem ideal. The caveat is that you can't use any kind of html generated 'em dash' inside of a pre tag, or at least I don't know of a way to do it. So the only way to use a dash inside a pre is to use something else to represent it like a pair of hyphens: -- or maybe tildas: ~~, but darn it, I want my text to look just like the book!
What you've posted above is a comment with css-like text inside of it - it's not actually css. The text I gave you goes into the conversion settings before you convert the file to epub. If you insert it after conversion you have to do a lot more work as every tag has an id and inserting more generic css like the examples discussed won't override that ID.

btw, if you want an em-dash just use an actual em-dash -there's no need to use html encoding.

Last edited by ldolse; 07-29-2011 at 03:31 PM.
ldolse is offline   Reply With Quote
Advert
Old 07-29-2011, 05:20 PM   #6
Ransom
Banned
Ransom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensions
 
Posts: 242
Karma: 51054
Join Date: Jun 2011
Location: Belleville, IL
Device: Kindle-3
Quote:
"What you've posted above is a comment with css-like text inside of it"
I sure did.

Quote:
"btw, if you want an em-dash just use an actual em-dash -there's no need to use html encoding. "
Not really. If you take text out of something like a Word doc file and paste it in an html file, it may or may not show up in some browsers. If you want it to show for sure, use an html tag for an Em Dash like this:

And if you try to paste some text from a typical Word doc with a dash in it into the 'pre' tags of an html file, it will get turned into, oh I don't remember what you call it, but it's a very small dash rather than a nice big Em dash. It's hardly any longer than a hyphen and most people would confuse it with one I'm sure.

Lastly, Calibre will ignore anything but a proper html Em dash code like the one I gave above.

In the following sample the first stanza was copy/pasted into html without using html code for the Em dash. The second stanza used for the dash. And the third was the same copy/paste from Word and placed within 'pre' tags. They all show up in my browser, but the dashes within the 'pre' tags get turned into that real small dash I was talking about.



This is what the same html file looks like after Calibre gets hold of it. Notice that only the stanza with the proper code for an Em dash shows up. However, you can't use that code within 'pre' tags. It simply won't work. Maybe there's another way, but I haven't found it yet.


Last edited by Ransom; 07-29-2011 at 07:29 PM.
Ransom is offline   Reply With Quote
Old 07-30-2011, 01:06 AM   #7
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
I suspect there is some other problem relating to copy/paste from Word vs. the em-dash itself. I frequently use em-dash using just the character and have never had a problem. An alternative approach to get an em-dash during conversion though is to use double hyphens -- and enable 'smarten punctuation' during conversion.

I'm not sure if you solved your issue around blockquotes - this is something else I use all the time so not sure why you're having a problem here. Posting your conversion settings and perhaps a snippet of the source code could help.

If your formatting requirements are relatively simple (by the screenshots they look like they are) you can try using text with Markdown or Textile instead of whatever combination of Word/HTML you're using. Those are my preferred formats if I'm starting something from scratch or really poorly formatted text.

Here's an example using only markdown, smarten punctuation, and extra css - '>' creates blockquotes:
Code:
PART I
-------

### THE MESSAGE


>My heart trembles like a poor leaf.
>
>The planets whirl in my dreams.
>
>The stars press against my window.
>
>I rotate in my sleep.
>
>My bed is a warm planet.
>
>>--M<span class="smcps">ARVIN</span> M<span class="smcps">ERCER</span>
>>
>>P.S. 153, Fifth Grade, Harlem 
>>
>>New York City, N.Y. (1981)
Extra CSS:
Code:
body{font-family: serif}
p {margin-top: 0em; margin-bottom: 0.3em; text-align:justify}

blockquote {margin-bottom: 0.5em; margin-top: 0.3em}
p + blockquote {margin-top: 1em; margin-bottom: 1em; margin-left:15%}
span.smcps { white-space: pre; font-size: 80%}
h2 {text-align: right; margin-bottom: 0em}
h2 + h3 {text-align: right; font-size: 2.5em; margin-top: 0em}
blockquote > blockquote {padding-left: 20%}
Attached Thumbnails
Click image for larger version

Name:	screenshot.png
Views:	836
Size:	32.3 KB
ID:	74951  

Last edited by ldolse; 07-30-2011 at 01:24 AM.
ldolse is offline   Reply With Quote
Old 08-01-2011, 11:55 PM   #8
Ransom
Banned
Ransom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensions
 
Posts: 242
Karma: 51054
Join Date: Jun 2011
Location: Belleville, IL
Device: Kindle-3
I tried 'smarten punctuation', however placing two, or even three, hyphens in a row anywhere within 'pre' tags doesn't do anything. Apparently 'smarten punctuation' doesn't effect anything within a 'pre' tag. So I'm back to using block quotes, which works fine except for that first line being indented. I'll live with it.

Thanks for your help.
Ransom is offline   Reply With Quote
Old 08-02-2011, 03:02 AM   #9
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
The first line definitely isn't indented by default, as I was trying to illustrate with my example - if you post more detail beyond the screenshots we may be able to figure out where you're going wrong.

My only thought is that you have 'remove spacing between paragraphs' enabled - that could potentially be the root cause of you problems, depending on how the line breaks in the poems are defined.

Last edited by ldolse; 08-02-2011 at 03:12 AM.
ldolse is offline   Reply With Quote
Old 08-02-2011, 09:52 PM   #10
Ransom
Banned
Ransom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensions
 
Posts: 242
Karma: 51054
Join Date: Jun 2011
Location: Belleville, IL
Device: Kindle-3
"My only thought is that you have 'remove spacing between paragraphs' enabled"

I do. Didn't I mention that? That's why I was asking if there was a specific way to keep certain lines from indenting. Yes, I could turn off that feature and do everything the hard way, but that's a great feature and I'd like to keep using it.
Ransom is offline   Reply With Quote
Old 08-02-2011, 10:12 PM   #11
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
No, actually you didn't mention it - just re-read the thread to double-check. And by your screenshots it's not obvious that it's enabled since your code must be using <br/> tags under the hood, otherwise every line in your blockquotes would be indented.

Don't use that feature if you actually want the level of control that you're asking for - everything can be done with a much finer grain of control using extra css. If you enable that feature it over-rides everything else, including extra css.

Here's how to get what you want (with that feature disabled). Put this in extra css before conversion:
Code:
p {margin-top: 0em; margin-bottom: 0.0em; text-indent:1.5em}
blockquote > p {text-indent:0;}
ldolse is offline   Reply With Quote
Old 08-02-2011, 10:18 PM   #12
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: 79,680
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Try the following CSS and see what happens....

Code:
blockquote {
   text-indent: 0
}
I cannot say if that will work, but it might.
JSWolf is offline   Reply With Quote
Old 08-03-2011, 10:02 AM   #13
Ransom
Banned
Ransom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensions
 
Posts: 242
Karma: 51054
Join Date: Jun 2011
Location: Belleville, IL
Device: Kindle-3
Quote:
otherwise every line in your blockquotes would be indented.
They are. Look again at my first post. I wasn't using block quotes in my fourth post. My examples there were just concerned with Em dashes.

Quote:
Put this in extra css before conversion
I tried that. It won't keep block quotes from indenting though.

I tried your way too JSWOLF. No go.

Any other ideas?

Last edited by Ransom; 08-03-2011 at 11:28 AM.
Ransom is offline   Reply With Quote
Old 08-03-2011, 11:31 AM   #14
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Quote:
Originally Posted by Ransom View Post
They are. Look again at my first post.
You seem to be mixing up left margins with indents. Your first picture has a blockquote - blockquotes automatically get margins that just happen to co-incide with most people's default indents. The first line of that blockquote is indented - the subsequent lines are not indented.

As far as how to fix it, disabling remove spacing between paragraphs combined with the extra css should have fixed it - but only with the original document. Converting a bad ePub to ePub probably won't fix it. You'll need to actually post the job log (lower right hand corner) along with snippets of the original source code instead of screenshots.
ldolse is offline   Reply With Quote
Old 08-03-2011, 12:18 PM   #15
Ransom
Banned
Ransom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensionsRansom can understand the language of future parallel dimensions
 
Posts: 242
Karma: 51054
Join Date: Jun 2011
Location: Belleville, IL
Device: Kindle-3
I'm not mixing up anything. You're simply doing a lot of strange assuming.

Quote:
As far as how to fix it, disabling remove spacing between paragraphs combined with the extra css should have fixed it - but only with the original document.
It doesn't. Period. I'm not converting anything yet. It's still in html form.

Quote:
You'll need to actually post the job log
It's just basic html for Pete's sake. No other css or scritping whatsoever. Just basic 'blockquote' tags with 'br' at the end of each line except the last of course.
Ransom is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Touch Horizontal white streaky lines - on "Connected and Charging" screen beautifulsoup Kobo Reader 0 07-27-2011 06:47 PM
Feature Request: configurable space setting for "Insert blank line" in "Look & Feel" therealjoeblow Calibre 15 07-25-2011 03:14 PM
Ten Favorite Noir Lines...Plus "The Grifters" Coming to Kindle Paul Levine Reading Recommendations 5 04-16-2011 12:53 AM
Woher bekomme ich "Infinite Jest" oder "Unendlicher Spaß" von David Foster Wallace? bitschnau Erste Hilfe 3 11-01-2010 01:22 PM


All times are GMT -4. The time now is 03:34 AM.


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