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-11-2015, 04:08 PM   #16
Pam E.
Member
Pam E. began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2015
Device: iPad
They are in a cookbook epub file. :/ See a lot of them in cookbooks. I like to import recipes into my recipe management program, but I need to 'fix' all of those fractions first. This was a huge help! Thanks again.
Pam E. is offline   Reply With Quote
Old 01-11-2015, 09:20 PM   #17
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by theducks View Post
Where did you find these, they are not in the standard entity charts? Another non-standard 'Word' abomination?
They are a part of Unicode:

http://www.fileformat.info/info/unic...preview=entity

I personally avoid the use of "vulgar fractions" because what happens when you are dealing with fractions that don't have proper unicode versions? For example, 3/10.

Then you get an inconsistent look between the vulgar fractions + the non-vulgar versions.

Also, especially when dealing with some of these less common vulgar fractions, the reading devices might not have those as a part of their fonts. Sure, they will probably have ½, ¼, but the fonts most likely will not have things like ⅝ and ⅞.

I personally would go with consistency and readability over looks.

Side Note: This also reminds me about the usages of superscript/subscript in ebooks. Sure, it may "look nicer", but it makes it tougher to read for people with poorer eyesight. I personally fall into the camp that tries to avoid smaller text. (Superscript footnotes, vulgar fractions, ...).

We had a nice long chat on superscript footnotes/text back in this thread (I started it around Post #23):

https://www.mobileread.com/forums/sho...d.php?t=241177

Quote:
Originally Posted by theducks View Post
What I don't know is how to do this as a single pass replace
Yeah, I would probably just do this as normal search/replaces, and if you are dealing with a lot of cookbooks with the same fractions, I would just create a set of Saved Searches in Sigil.

Last edited by Tex2002ans; 01-11-2015 at 09:27 PM.
Tex2002ans is offline   Reply With Quote
Advert
Old 01-12-2015, 03:18 AM   #18
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
Quote:
Originally Posted by theducks View Post
What I don't know is how to do this as a single pass replace
With Calibre editor,
1- Search all.
2- Use Regex-Function with:
return match.group().replace ('½','1/2').replace ('⅓','1/3').replace ('¼','1/4') ..... etc.

Last edited by jbacelar; 01-12-2015 at 03:24 AM.
jbacelar is offline   Reply With Quote
Old 01-12-2015, 09:54 AM   #19
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,274
Karma: 62000000
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by jbacelar View Post
With Calibre editor,
1- Search all.
2- Use Regex-Function with:
return match.group().replace ('½','1/2').replace ('⅓','1/3').replace ('¼','1/4') ..... etc.
Thanks
This is using the very recent Edit feature ( which I have not come up to speed with).
So it can be done
theducks is offline   Reply With Quote
Old 01-12-2015, 01:22 PM   #20
Pam E.
Member
Pam E. began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2015
Device: iPad
Quote:
Originally Posted by Tex2002ans View Post
I personally would go with consistency and readability over looks.
Exactly! I get tired of dealing with ebooks that use them.
Pam E. is offline   Reply With Quote
Advert
Old 01-12-2015, 01:22 PM   #21
Pam E.
Member
Pam E. began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2015
Device: iPad
Quote:
Originally Posted by jbacelar View Post
With Calibre editor,
1- Search all.
2- Use Regex-Function with:
return match.group().replace ('½','1/2').replace ('⅓','1/3').replace ('¼','1/4') ..... etc.
Excellent!!! I will give this a try. Thanks so much!
Pam E. is offline   Reply With Quote
Old 01-12-2015, 02:28 PM   #22
Pam E.
Member
Pam E. began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2015
Device: iPad
Quote:
Originally Posted by jbacelar View Post
With Calibre editor,
1- Search all.
2- Use Regex-Function with:
return match.group().replace ('½','1/2').replace ('⅓','1/3').replace ('¼','1/4') ..... etc.
Ok, I created a new function:

Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
    return match.group().replace('½','1/2').replace('⅓','1/3').replace('¼','1/4')
^^Did I create the function correctly?^^

What do I use for the Find field so I can test out my new function?
Pam E. is offline   Reply With Quote
Old 01-12-2015, 07:11 PM   #23
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
Quote:
Originally Posted by Pam E. View Post
^^Did I create the function correctly?^^
Yes

Quote:
Originally Posted by Pam E. View Post
What do I use for the Find field so I can test out my new function?
.*
jbacelar is offline   Reply With Quote
Old 01-13-2015, 01:16 PM   #24
Pam E.
Member
Pam E. began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2015
Device: iPad
Thank you!! My ebooks are going to clean up so nicely now. I greatly appreciate all of your input and help.
Pam E. is offline   Reply With Quote
Old 01-13-2015, 02:30 PM   #25
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
You're welcome.
jbacelar is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A question for you all. J.M. Pierce Writers' Corner 11 09-26-2010 09:49 PM
iPad 3G question vonCZ Apple Devices 46 08-10-2010 11:33 AM
Classic Few Nook Question and Question on Nook 3G vs WiFi blackonblack Barnes & Noble NOOK 4 07-02-2010 03:07 AM
Looking for another reader question and PRS-600 question lilpretender Which one should I buy? 9 10-24-2009 05:02 AM


All times are GMT -4. The time now is 05:34 PM.


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