Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-08-2014, 04:16 PM   #1
Sablerose
Enthusiast
Sablerose began at the beginning.
 
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?
Sablerose is offline   Reply With Quote
Old 01-08-2014, 07:14 PM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
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.
BetterRed is online now   Reply With Quote
Advert
Old 01-08-2014, 07:51 PM   #3
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
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.
mrmikel is offline   Reply With Quote
Old 01-08-2014, 07:53 PM   #4
Sablerose
Enthusiast
Sablerose began at the beginning.
 
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.
Sablerose is offline   Reply With Quote
Old 01-08-2014, 08:41 PM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Sablerose View Post
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.
I was referring to the Word Template you said you used - you should see a list of them when you create a new document - Alt+F/N

Quote:
Originally Posted by Sablerose View Post
I use a Word template to edit my lit, pdf, etc files, then save as a docx file.
If you don't specifically attach one, then I guess you'll be using Blank - I think that's Normal.docm (.docm is a extension for template files). But let's put that aside for now.

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
BetterRed is online now   Reply With Quote
Advert
Old 01-08-2014, 10:21 PM   #6
Sablerose
Enthusiast
Sablerose began at the beginning.
 
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.
Attached Files
File Type: pdf eBooks Template.pdf (67.8 KB, 340 views)
Sablerose is offline   Reply With Quote
Old 01-08-2014, 11:13 PM   #7
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
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).
PeterT is offline   Reply With Quote
Old 01-08-2014, 11:41 PM   #8
Sablerose
Enthusiast
Sablerose began at the beginning.
 
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?
Sablerose is offline   Reply With Quote
Old 01-08-2014, 11:46 PM   #9
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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.
eschwartz is offline   Reply With Quote
Old 01-08-2014, 11:52 PM   #10
Sablerose
Enthusiast
Sablerose began at the beginning.
 
Posts: 42
Karma: 10
Join Date: Dec 2010
Location: Arizona USA
Device: iPod Touch 6G
Okay, here it is, zipped up.
Attached Files
File Type: zip eBook Template.zip (14.3 KB, 308 views)
Sablerose is offline   Reply With Quote
Old 01-08-2014, 11:57 PM   #11
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
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:
  • There must be something in the DOCX XML that causes Calibre conversion to output <i class="calibre2">xxxxx</i> and something different that causes it to output <span class="text">xxxxx</span>.

    If you can isolate a sample of each into 2 DOCX's, convert them to EPUB, and bundle the four files + your Word Template into a zip and post here, then I'll have a look and maybe Kovid and others will too.
  • In one of the books that's giving you problems type a paragraph, I'd probably put it right at the beginning, make sure its Regular style, select a phrase and make it italics then save as DOCX and convert. If its OK in the EPUB then it must a paragraph formatting issue - if its not then its probably a document issue.
  • Cut & paste a paragraph that has italics from a Good LIT/PDF book into a Bad DOCX, also copy Cut & paste a paragraph that has italics from a Good DOCX into a Bad DOCX - convert the Bad DOCX and look at the ePUB. And vice versa - ie Bad into Good. This may provide clues as to whether its a document issue or a paragraph issue.
I don't like inexplicable inconsistencies either?

BR
BetterRed is online now   Reply With Quote
Old 01-09-2014, 12:01 AM   #12
Sablerose
Enthusiast
Sablerose began at the beginning.
 
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.

Sablerose is offline   Reply With Quote
Old 01-09-2014, 12:06 AM   #13
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Sablerose View Post
Okay, here it is, zipped up.
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
Attached Files
File Type: zip eBook Template docx and dotx.zip (28.4 KB, 254 views)

Last edited by BetterRed; 01-09-2014 at 12:14 AM.
BetterRed is online now   Reply With Quote
Old 01-09-2014, 12:32 AM   #14
Sablerose
Enthusiast
Sablerose began at the beginning.
 
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.
Attached Files
File Type: zip Granite Lake Wolves 02-Test-Goo - Rose.zip (518.3 KB, 254 views)
Sablerose is offline   Reply With Quote
Old 01-09-2014, 01:05 AM   #15
Sablerose
Enthusiast
Sablerose began at the beginning.
 
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.
Sablerose is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 07:00 AM.


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