01-08-2014, 04:16 PM | #1 |
Enthusiast
Posts: 42
Karma: 10
Join Date: Dec 2010
Location: Arizona USA
Device: iPod Touch 6G
|
<Span> tag vs <I> tag
I've been having an odd thing pop up occasionally.
I use a Word template to edit my lit, pdf, etc files, then save as a docx file. I then import the docx and have Calibre convert to epub. The strange thing is, only twice now in 16 books, I've had my <i class="calibre2"> (meaning italic) not show up, and get <span class="text"> (also meaning italic) instead. Now, for consistency-sake, I've been changed the <span> tags back to <i> tags. But, that takes a looong time, since there can be 4-6 <span> and </span> tags in a single paragraph. Anyone have any idea why this is happening? And how I can stop it? |
01-08-2014, 07:14 PM | #2 |
null operator (he/him)
Posts: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@Sablerose
Are you actually using the same Word Template on all the files - i.e. are you attaching it. Have you applied the Template's styles consistently. For 'straight forward' text I usually start by attaching the template I want, then I select the entire document and apply the templates Normal Style. Then I go from there - I have quite a few macros that I've filched and developed over the last ~20 years so they take care of most of the work. Do you do your editing on the DOCX format or some interim format, e.g. RTF, DOC, ODT etc. Try saving the interim format to DOCX first, and then editing that. Not sure why it would matter, but its what I do, and I've not seen your problem. Although I admit I do not look at the EPUB XHTML unless I have to. BR Last edited by BetterRed; 01-08-2014 at 07:32 PM. |
Advert | |
|
01-08-2014, 07:51 PM | #3 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
You have encountered why some prefer to not use Calibre. It works, but the resulting code can be hard to understand.
This is a reason to get acquainted with regular expressions. You put <whatever calibre tag>(.+?)</whatever calibre tag> in find. You put <i>\1</i> in replace. Set the search for regex. That should get you just the expressions and replace them with ordinary italic tags. Test this out by finding just one, then press replace. You should see it change to what you want. Then you can do find/replace repeatedly and when you get brave replace all. Even though calibre can take you back, do a save before you do anything with replace alls, just in case. Or you use AWP or fight with Toxaris' add on until you get it to work. They don't add all the extra stuff. |
01-08-2014, 07:53 PM | #4 |
Enthusiast
Posts: 42
Karma: 10
Join Date: Dec 2010
Location: Arizona USA
Device: iPod Touch 6G
|
I cut/paste from the lit, PDF etc. that I start with. I have the template set to always use the destination formatting.
Once I have all the text imported, I do any editing (fixing typos, etc). I double-check all of the template formatting, headings, italics. I don't know how to "attach" a template. I just paste the incoming text where it should go. For example, I put the text of Chapter 2 after the formatted heading for Chapter 2. I'll try saving the docx file before I do any editing, and see if that makes any difference. The strange part is that it's only happening on a couple book files out of over a dozen. |
01-08-2014, 08:41 PM | #5 | ||
null operator (he/him)
Posts: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Quote:
When you copy a block of text that contains italics, are the italics a) always pasted into your Word document, or b) is it always plain text that's pasted, or c) do they sometimes get pasted as italics and sometimes not? Q. Why not convert the LIT files directly to EPUB in calibre. According to this list LIT is the best format from which to convert. And even though PDF is the worst, there are a number of alternative conversion paths one of which will often produce a reasonable result - there's a Sticky at the top of the Calibre/Conversion sub-forum that suggests alternatives. Cut and paste sounds like a lot of effort. BR |
||
Advert | |
|
01-08-2014, 10:21 PM | #6 |
Enthusiast
Posts: 42
Karma: 10
Join Date: Dec 2010
Location: Arizona USA
Device: iPod Touch 6G
|
Template
I made up a custom template, with all the formatting in place.
Each style is separate. Title, Author, Heading 1 (Chapter Number/Name), Any Poem or something like in between the chapters (example: The Bible Quote at the Beginning of Twilight). I also set set up a style for the internal part of the Chapters, named it Regular. So not all that hard or time-consuming to do the cut/paste. The italics are always showing after I do the paste. I do a search for italicized characters to make sure they are there. The reason I don't directly convert the LIT files, etc, is because I want to edit them before I put them into Calibre. And I want to keep a backup copy of the docx file, just in case, after I do the Calibre convert. Once I make sure I have a good epub copy, I will be deleting the docx files. I attached a PDF copy of my template, since I couldn't get the docx to upload. Each different kind of line has its own style, and the text I paste in replaces the matching spaceholder line. So it doesn't take long, just a few minutes to paste all the chapters from a moderate-sized book. |
01-08-2014, 11:13 PM | #7 |
Grand Sorcerer
Posts: 12,172
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
I think there is some miscommunication here... I believe that what we were expecting to see was a Word template that contained formating styles, and that you would then be applying a named style to a section of text (along with clearing all the existing formatting from that section of text).
|
01-08-2014, 11:41 PM | #8 |
Enthusiast
Posts: 42
Karma: 10
Join Date: Dec 2010
Location: Arizona USA
Device: iPod Touch 6G
|
If I could figure out how to upload my docx file, then I would have presented my actual template. Any help?
|
01-08-2014, 11:46 PM | #9 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
put it in a zip. docx isn't listed in the manage attachments section as being an allowed filetype, but anything can still be zipped/tarred/gzipped/bzipped.
|
01-08-2014, 11:52 PM | #10 |
Enthusiast
Posts: 42
Karma: 10
Join Date: Dec 2010
Location: Arizona USA
Device: iPod Touch 6G
|
Okay, here it is, zipped up.
|
01-08-2014, 11:57 PM | #11 |
null operator (he/him)
Posts: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Re : converting v cut & paste, what you're happy with is best.
Do the books that are giving you 'problems' have anything in common - eg did they all come from LIT, does the font in the source differ, etc, etc. Some things to try - if you've not already done so:
BR |
01-09-2014, 12:01 AM | #12 |
Enthusiast
Posts: 42
Karma: 10
Join Date: Dec 2010
Location: Arizona USA
Device: iPod Touch 6G
|
I have home issues that will keep me busy next couple days, but I'll try to get those samples posted by the weekend.
Thanks for the help. |
01-09-2014, 12:06 AM | #13 |
null operator (he/him)
Posts: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
OK, It's not a 'proper' Word Template, its a docx file, I can guess how you're using it - damn jargon
I'll go and have a play with it - attached zip has Sablerose's .docx and equivalent dotx BR Last edited by BetterRed; 01-09-2014 at 12:14 AM. |
01-09-2014, 12:32 AM | #14 |
Enthusiast
Posts: 42
Karma: 10
Join Date: Dec 2010
Location: Arizona USA
Device: iPod Touch 6G
|
Here's the start chapters of 1 good and 1 bad book. Both the docx and epub files.
|
01-09-2014, 01:05 AM | #15 |
Enthusiast
Posts: 42
Karma: 10
Join Date: Dec 2010
Location: Arizona USA
Device: iPod Touch 6G
|
Okay, I did a retest with those 2 files, adding a paragraph at the beginning (hand-typed, not pasted) with italics in it. The good file still worked, the bad still didn't.
Did the same with a pasted paragraph, same results. /sigh Thanks for sending the correct template. I didn't realize i was using just a docx file. Now using the correct item. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sorting tag values in tag browser | mcam | Library Management | 15 | 08-25-2013 05:50 AM |
Send tag to device only if tag has more than 1 book? | eosrose | Calibre | 0 | 01-29-2013 07:46 PM |
svg image inside span tag in mobi file not display numbers | Hala Aly | Workshop | 3 | 09-12-2012 08:00 AM |
Adding an Owner tag to tag list? | Fangles | Library Management | 1 | 02-25-2011 02:32 AM |
'Keep' tag? | AnemicOak | Amazon Kindle | 13 | 03-17-2009 04:19 PM |