02-25-2010, 08:53 AM | #1 |
Member
Posts: 19
Karma: 10
Join Date: May 2008
Device: Amazon Kindle, Apple iPad
|
How to do centering
I have RTF files with book and chapter heads centered. When converting with calibre they change to flush left. Is there a way to do centering in my options or should I learn to like left justified titles?
|
02-25-2010, 03:12 PM | #2 |
creator of calibre
Posts: 44,351
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use extra css
|
Advert | |
|
02-26-2010, 08:32 AM | #3 |
Member
Posts: 19
Karma: 10
Join Date: May 2008
Device: Amazon Kindle, Apple iPad
|
OK, I hear you but...
I'm using Microsoft Word to create an RTF file like this: Test heading 1 (this is style Heading 1 in Word) Test heading 2 paragraph text text text (The heading 1 & 2 are formatted centered). I added this CSS to the converter: H1 { text-align: center } H2 { text-align: center } The text formatting comes through but the text is still left aligned. What am I doing wrong? I suspect that Word is the culprit but I can't see how they internally encode styles. |
02-26-2010, 08:38 AM | #4 |
Member
Posts: 19
Karma: 10
Join Date: May 2008
Device: Amazon Kindle, Apple iPad
|
When I save the RTF file as HTM, this is what results:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Style-Type" content="text/css"> <title></title> <meta name="Author" content="Steve Johnson"> <meta name="Generator" content="Cocoa HTML Writer"> <meta name="CocoaVersion" content="1038.25"> <style type="text/css"> p.p1 {margin: 12.0px 0.0px 3.0px 0.0px; text-align: center; font: 16.0px 'Times New Roman'} p.p2 {margin: 12.0px 0.0px 3.0px 0.0px; text-align: center; font: 14.0px 'Times New Roman'} p.p3 {margin: 0.0px 0.0px 10.0px 0.0px; font: 12.0px Cambria} </style> </head> <body> <p class="p1"><b>Test heading 1</b></p> <p class="p1"><b>Part 1</b></p> <p class="p2"><b><i>Test heading 2</i></b></p> <p class="p2"><b><i>Chapter 2</i></b></p> <p class="p3">Test text text text<span class="Apple-converted-space"> </span></p> </body> </html> Thoughts? |
02-26-2010, 12:51 PM | #5 |
creator of calibre
Posts: 44,351
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
So convert the HTML and you should be fine.
|
Advert | |
|
02-26-2010, 07:37 PM | #6 |
Grand Sorcerer
Posts: 6,216
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
@sjohnson
I use Word all the time to create my HTML files for Calibre. If you style your headings with the built-in styles "Heading 1", "Heading 2", etc your output HTML should be translated to <h1>...</h1> where you used "Heading 1" <h2>...</h2> where you used "Heading 2" ... and so on <p class=MsoNormal>...</p> where you used "Normal" <p>...</p> where you used "Normal(Web)" You can then reference h1, h2, p and p.MsoNormal in your Calibre Extra CSS during conversion if you need to. Also make sure you save as Web-filtered to avoid much of the MS excess baggage tags. |
02-27-2010, 07:59 AM | #7 |
Member
Posts: 19
Karma: 10
Join Date: May 2008
Device: Amazon Kindle, Apple iPad
|
Thanks. That worked. Saving the RTF as a HTM file puts the correct H1 H2 settings and now headings are centered.
But Jackie, how do I now manage my files? I have an RTF (source) saved as a HTM (copy) which I manually add to Calibre, which converts it to a Zip. When I edit the file (eg, for typos) must I edit the RTF, delete the HTM and ZIP and manually re-add them? |
02-27-2010, 12:58 PM | #8 | |
Grand Sorcerer
Posts: 6,216
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
So I suppose I'm saying, once I've decided to edit the RTF it serves no further purpose. The reason I keep my HTML as a backup source is that I think calibre makes changes to it during the import/zip process (someone correct me if I'm wrong). I choose not to apply my re-edits to the ZIP (although I suppose you could edit typos easily enough). I don't think any changes (other than file rename) are made to other filetypes (e.g. LIT, PDF, TXT, EPUB, DOC, RTF etc). Anyway there's some things for you to consider. There is no "right" way. P.S. I should have added to my first post, in case you don't know already. Once you have the h1, h2 etc headings in your calibre HTML/ZIP you can use them in your conversion process for Chapter detection and to create a nice TOC in your EPUB. |
|
02-27-2010, 03:02 PM | #9 |
Member
Posts: 19
Karma: 10
Join Date: May 2008
Device: Amazon Kindle, Apple iPad
|
Thanks for your reply. I guess I was thinking that I'd like to have one editable source file. I'd be willing for it to be doc, rtf, htm but none alone seems to do the job. So I'll take your suggestion and keep the HTML. Alas, I'll need to delete the Zip file containing the HTML, edit, the re-add the HTML file manually each time.
|
02-27-2010, 03:29 PM | #10 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Basically, it uses the author and title from any book you try to add, searches the Calibre database to find that book, and if it exists, adds the format of the new book to the existing record (or creates a new record if it does not). It's intended to deal with bulk adding of ebooks, but it's perfect for keeping a copy that you edit and improve. Just drag and drop the improved copy and it will find the matching ebook record and replace the old copy of the same format. You could even keep a whole folder of books, work on some of them whenever you felt like it, then drag/drop all of them whenever you felt like it (or use any of the other Add books tools). |
|
02-27-2010, 03:38 PM | #11 |
Member
Posts: 19
Karma: 10
Join Date: May 2008
Device: Amazon Kindle, Apple iPad
|
That may be the ideal solution. Look forward to downloading a new version of this excellent program. Thanks for all your efforts.
|
02-27-2010, 04:01 PM | #12 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
I'm in the last half of a very long project to import my ebook collection from the last 20 years. This has given me a pretty good feel for the problems encountered in adding books and metadata to Calibre. Everything I've written has been to address a problem I've personally encountered multiple times. Although it's taken me a long time to learn the rudiments of Python and explore the Calibre codebase, in the long run, the changes I've made have sped things up for me, even with all the time I've spent on coding. Now I'm back to entering ebooks. |
|
02-27-2010, 09:39 PM | #13 | |
Well trained by Cats
Posts: 30,377
Karma: 58053698
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Then watch for ( file time-stamp) changes and ask at reader upload time, if you want to sync the other (to be uploaded) format. (a Master format icon would get a Star or something to mark it visually) |
|
02-28-2010, 07:57 AM | #14 |
Member
Posts: 19
Karma: 10
Join Date: May 2008
Device: Amazon Kindle, Apple iPad
|
Let's look at a use scenario: I have 200+ books in RTF format. When reading the book on Kindle I find a typo. Because I'm anal, I want to fix the typo. I'd like to go into Calibre, open the source file, change the typos, save, and rebuild the epub output.
Today I have to open in Word, save the RTF, then save as HTML, then manually add the HTM to calibre which converts it to a Zip file, and then convert to ePub or Mobi. I'd be willing to use another source file format (such as HTML) but I still have the Zip problem. If I convert the RTF file, I don't get centering. If I convert to HTML, I get centering but now I have added a file management problem with a source file, plus a couple of interim files (HTM and ZIP), before I get to an output file. |
02-28-2010, 08:30 AM | #15 | |
Resident Curmudgeon
Posts: 75,899
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Centering blockquotes | ghostyjack | ePub | 6 | 07-17-2014 06:07 AM |
Centering PDF | nguirado | Amazon Kindle | 5 | 10-04-2010 08:45 PM |
Centering and adjusting the width of a block | Jellby | ePub | 3 | 04-09-2009 12:38 PM |
centering images with css override? | Amalthia | Calibre | 2 | 03-30-2009 01:53 PM |
Bookdesigner - Centering Title Author... | davers | Workshop | 7 | 01-12-2009 04:21 PM |