03-06-2011, 11:54 PM | #1 |
Member
Posts: 14
Karma: 304
Join Date: Nov 2010
Device: Sony PRS 900
|
Text Alignment Problem
I'm having problems with text alignment...
My preference in a book is to have the main text of the book justified - no spaces between paragraphs - first line indented (1.5 em is just fine). The options in the "Look and Feel" section of the Convert dialog does this beautifully. However, I prefer to have titles, and other info centered and some text even Left Aligned (for Glossaries, etc.). The problem is that Calibre also wants to indent the first line of centered and the Left Aligned text as well - not a good look! At the moment, my work-around is to let Calibre process the book, then edit the .css in Wordpad to remove all the text-indent 1.5 em references in all the other styles. My question is, am I doing something wrong? have I neglected to select something? - or is there a better way to do it? Alternatively, is this a bug (hush my mouth!) or maybe I should request an enhancement? Many thanks, (BIG) fan |
03-07-2011, 12:13 AM | #2 |
Well trained by Cats
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Sigil (next Forum Down)
Makes editing CSS and touch-up easy. Note: Your TOC (NCX) must be based upon H# (nested) tags or it will be overwritten |
Advert | |
|
03-07-2011, 03:40 PM | #3 |
Member
Posts: 14
Karma: 304
Join Date: Nov 2010
Device: Sony PRS 900
|
Text Alignment Problem
@ theducks
Thanks buddy - but I already knew that... I already have the TOC based on nested H# tags - I do that by setting the chapter headers using MS Word "styles" - easy with search & replace. If I open the epub with Sigil to edit the style sheet, then Sigil imposes its own TOC - overwriting the one already created with Calibre - I like the one created with calibre. It's also easy to edit the style sheet with Wordpad... Right click on the epub file, open with WinZip, then right click the css file and open with Wordpad - edit as appropriate, save and update the archive with the saved file - too easy. My problem is that I don't want Calibre to first-line indent centered and left-aligned text in the first place. Any tips on how to achieve this would be much appreciated. Maybe "Extra CSS" could be used to do this? Does anyone know how to code this? All I want is to end up with certain styles with text indent set to zero. Many thanks - fan |
03-07-2011, 03:49 PM | #4 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Calibre would only be indenting text if you chose the 'remove spacing between paragraphs' option. If you don't like the way that option works then don't use it, the same thing can be accomplished with much more control using extra css. There have been numerous threads on this recently in both the Calibre and Sigil forums, just search for 'indents' and you'll get the info.
|
03-07-2011, 04:23 PM | #5 |
Well trained by Cats
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Don't bother with winzip and all that.
T for Tweak epub (in calibre): Explode. Now edit any part(s) you want, Then click 'Rebuild' |
Advert | |
|
03-07-2011, 09:01 PM | #6 | |
Member
Posts: 14
Karma: 304
Join Date: Nov 2010
Device: Sony PRS 900
|
@ ldolse
I like the general paragraph alignment settings given with the 'remove spacing between paragraphs' option. My question was about how to create exceptions to that - so that for the few exceptions - i.e. titles, chapters, etc., which I don't want justified, I can stop the indenting process. I had tried to find something about this problem, before bothering anyone, but for the life of me, I never thought to search for indents! Thanks for the pointer. @ theducks I never really saw the point of the tweak feature - it's easy enough to open and fiddle an epub without running Calibre at all - no need to explode or rebuild - just edit the thing within winzip... However, on a different thread, you replied to another user with: Quote:
Code:
h1,h2,h3 { text-align: center text-indent: 0 } Thanks again guys, for the suggestions - like I said before - any tips or suggestions are gratefully appreciated |
|
03-07-2011, 09:25 PM | #7 | |
Well trained by Cats
Posts: 29,800
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:
|
|
03-07-2011, 10:57 PM | #8 | |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Quote:
Code:
p {margin-top:.3em; margin-bottom:.3em} Code:
p {margin-top:0; margin-bottom:0} This is all discussed ad-nauseam in those threads I mentioned before, I believe you've found them. Last edited by ldolse; 03-07-2011 at 11:00 PM. |
|
03-07-2011, 10:57 PM | #9 | |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
I don't think you can create exceptions to this option. It might be easier to do the opposite. Don't use the 'remove spacing between paragraphs/ indent' option and attempt to use extra css to insert indents for paragraphs. Maybe someone here can help from this angle. Last edited by DoctorOhh; 03-07-2011 at 11:00 PM. |
|
03-08-2011, 03:05 PM | #10 |
Member
Posts: 14
Karma: 304
Join Date: Nov 2010
Device: Sony PRS 900
|
@ Idolse & @ dwanthny,
Finally, the penny has dropped I hadn't appreciated the "all or nothing" nature of this option. The other indents threads I found seemed to quickly drift away from the indent question (without really answering it) and get into paragraph spacing issues, or whether to use pixels, points or ems as the unit. All or nothing is indeed a broad brush - and inappropriate for text that is centered - do you think the development team might be persuaded to change that? Guys (Girls?), thanks for your patience - I am a bit slow on the uptake - but it's much appreciated! |
03-20-2011, 07:12 AM | #11 |
Writer
Posts: 101
Karma: 590630
Join Date: Mar 2011
Location: Munich, Germany
Device: none
|
text indent
I have made it with <br> between <p> and text.
For instance: <p style="text-indent:0pt"><br>Text</p> and <p style="text-align:center; text-indent:0pt"><br>Text</p> It gives you an empty line, but it looks better than an indent where no one should be. It works with epub but not with mobi. So have tried it with Mobipocket Creator too and it looks fine. I even got pagebreaks (each chapter a separate file), what seems not to be possible with Calibre. George I have found more about that at the Mobipocket Developer Center on http://www.mobipocket.com/dev/articl...tification.htm George Last edited by GMcG; 03-27-2011 at 03:20 AM. Reason: update |
03-20-2011, 01:46 PM | #12 |
Overenthusiastic Noob
Posts: 69
Karma: 896
Join Date: Feb 2011
Location: France
Device: Kindle 3
|
I might have misunderstood the issue but if I didn't, then I guess you could scrap the p {...} bit from the css, and give classes to ALL your paragraphs, with the "regular" text as p.indent, and notes/index/glossary whatever as p.noindent.
That should take a few seconds and you'll have absolute control over everything. Or am I going about this in a weird way? |
03-20-2011, 03:09 PM | #13 | |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
|
|
03-20-2011, 03:28 PM | #14 | |
Well trained by Cats
Posts: 29,800
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:
Give the <Body>, the basic paragraph style ( default class) Give separate classes to the exceptions ONLY. <p class="noindent"> blah blah with indent at Zero</p> <p> more blahs, with the normal indent</p> |
|
03-20-2011, 04:51 PM | #15 |
Writer
Posts: 101
Karma: 590630
Join Date: Mar 2011
Location: Munich, Germany
Device: none
|
text indent
I had made a proposal in ticket 8667 (enhancement) for new p classes in stylesheet.css and was said to make it by myself in Look and Feel (Layout) / Extra CSS.
So I had defined new classes as addition to the existing classes (with ni = non indent). It works with epub, but at that time I had done it already with the proposal mentioned above. George .calibre2ni { border-bottom: 0; border-top: 0; display: block; margin-bottom: 0.5em; margin-left: 0; margin-right: 0; margin-top: 0.5em; padding-bottom: 0; padding-top: 0; text-indent: 0em } .calibre5ni { border-bottom: 0; border-top: 0; display: block; margin-bottom: 0.5em; margin-left: 0; margin-right: 0; margin-top: 0.5em; padding-bottom: 0; padding-top: 0; text-align: justify; text-indent: 0em } .calibre6ni { border-bottom: 0; border-top: 0; display: block; margin-bottom: 0.5em; margin-left: 0; margin-right: 0; margin-top: 0.5em; padding-bottom: 0; padding-top: 0; text-align: center; text-indent: 0em } Calibre should (!) add the Extra CSS to the stylesheet.css file. If it doesn't, you have to do it. Open the epub container by right click and edit epub. Open stylesheet.css with your editor and add the new p classes at the end of the file (copy from Extra CSS and paste). Save it. Look for an html file, in which you want lines/paragraphs with no indent. Open it with your editor. Look for the line/paragraph, which should have no indent. If it begins with <p class="calibre2">Your text....... add ni (=no indent) to the class like <p class="calibre2ni">Your text... The same is with other new classes that you have defined in stylesheet.css before. Save the html file. You can format italic fonts (font-style: italic (<== this is ; and )) the same way in stylesheet.css. When leaving the epub container you have to save the changements (new packing). George Last edited by GMcG; 03-26-2011 at 02:23 AM. Reason: update |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Please help with RSS feed text alignment / justification | zoilom | Recipes | 0 | 01-09-2011 12:23 PM |
Text alignment | James_Wilde | iRiver Story | 0 | 10-25-2010 04:22 AM |
left alignment | speakingtohe | Calibre | 2 | 08-13-2010 10:39 AM |
Vertical Alignment | gardefjord | ePub | 2 | 05-25-2010 09:59 PM |
Text Editor Problem | crutledge | Sigil | 2 | 08-10-2009 10:12 AM |