Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 03-16-2016, 08:04 PM   #1
bookman156
Addict
bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.
 
Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
How to convert straight quotes to smart 'curly' typographer's quotes

I have an EPUB from a publisher that I'm doing some editing work on in Sigil. But it has been produced using straight quotes instead of smart quotes, same goes for the apostrophes.

I'm wondering if there is a way to change the XHTML files to smart quotes. It may be automatic in Word, but I'm not sure how to do it in an EPUB.

I use Sigil for editing.

Anyone have any ideas?
bookman156 is offline   Reply With Quote
Old 03-16-2016, 08:46 PM   #2
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)
I know calibre has a builtin tool for that (both in conversion and in the Editor), not sure about Sigil.

It should be easy to do with a plugin though -- maybe someone has already made one.

EDIT: Yes, DiapDealer's PunctuationSmarten plugin is your friend.

Last edited by eschwartz; 03-16-2016 at 08:49 PM.
eschwartz is offline   Reply With Quote
Advert
Old 03-16-2016, 09:05 PM   #3
bookman156
Addict
bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.
 
Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
Ah, thanks!

That looks like what I need.
bookman156 is offline   Reply With Quote
Old 03-17-2016, 10:05 AM   #4
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Be warned, though, that these automated methods are not 100% reliable. After using them, you really do need to go through and check for errors manually. The tools are a good first step, but not a complete solution (not, at least, if you want to publish the book. Obviously if it's just for your personal use, you may not be concerned about a few mistakes.).

Tools tend to have problems with words with initial apostrophes, particularly in books where the single apostrophe is also used for speech marks.

Last edited by HarryT; 03-17-2016 at 10:07 AM.
HarryT is offline   Reply With Quote
Old 03-17-2016, 01:07 PM   #5
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by HarryT View Post
Tools tend to have problems with words with initial apostrophes, particularly in books where the single apostrophe is also used for speech marks.
Absolutely true, it is also depending on the language. I use multiple S&R commands to get it right. You can do it all automatic, as lang as you program it right.
Toxaris is offline   Reply With Quote
Advert
Old 03-17-2016, 01:18 PM   #6
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by Toxaris View Post
Absolutely true, it is also depending on the language. I use multiple S&R commands to get it right. You can do it all automatic, as lang as you program it right.
It really is almost impossible to get it right programmatically. Consider the following:

What the 'ell are you doin'?

and:

'Today is Thursday', he said.

Same pattern of quotes, but the first example has two closing quotes, while the second has an opening and a closing quote. Any tool should get the second example right. It's the first one that'll break the automated tool and need to be corrected manually.

Toxaris, how would you distinguish between these two cases, programmatically?

Last edited by HarryT; 03-18-2016 at 05:16 AM.
HarryT is offline   Reply With Quote
Old 03-17-2016, 02:22 PM   #7
WillAdams
Wizard
WillAdams ought to be getting tired of karma fortunes by now.WillAdams ought to be getting tired of karma fortunes by now.WillAdams ought to be getting tired of karma fortunes by now.WillAdams ought to be getting tired of karma fortunes by now.WillAdams ought to be getting tired of karma fortunes by now.WillAdams ought to be getting tired of karma fortunes by now.WillAdams ought to be getting tired of karma fortunes by now.WillAdams ought to be getting tired of karma fortunes by now.WillAdams ought to be getting tired of karma fortunes by now.WillAdams ought to be getting tired of karma fortunes by now.WillAdams ought to be getting tired of karma fortunes by now.
 
WillAdams's Avatar
 
Posts: 1,234
Karma: 3350652
Join Date: Feb 2008
Device: Amazon Kindle Paperwhite (300ppi), Samsung Galaxy Book 12
And of course, there’s the matter of using primes and double primes for foot and inch marks, and stick quotes at need for actual computer code. To expand on Harry's example, one which I've used in the past is:

“She was 5′2″, with eyes of blue, ‘’struth’.”

More on this at: http://tex.stackexchange.com/questio.../248039#248039
WillAdams is offline   Reply With Quote
Old 03-18-2016, 11:40 AM   #8
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
Quote:
Originally Posted by HarryT View Post
Be warned, though, that these automated methods are not 100% reliable.
Indeed. I use WordStar, an old DOS word processor, and WS doesn't do curly quotes (or em dashes, for that matter). So whenever I open a file in Word, I must clean up those omissions. Where Word fails every time (and where I suspect every automagical repair tool would fail) is words that have been truncated by omitting initial letters or syllables, such as the 'ell for hell you cited earlier.
Notjohn is offline   Reply With Quote
Old 03-19-2016, 04:03 AM   #9
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by HarryT View Post
The tools are a good first step, but not a complete solution (not, at least, if you want to publish the book
which doesn't mean there aren't published books (from mainstream publishers) filled with wrong quotes/apostrophes.
Jellby is offline   Reply With Quote
Old 03-22-2016, 03:37 AM   #10
fbrzvnrnd
Fanatic
fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.
 
Posts: 554
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
You can also use RegEx, like

Code:
"[A-Z].+?"
to get book titles for example
fbrzvnrnd is offline   Reply With Quote
Old 03-22-2016, 03:34 PM   #11
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by fbrzvnrnd View Post
You can also use RegEx, like

Code:
"[A-Z].+?"
to get book titles for example
I don't see the relevance of this to converting straight quotes to curly quotes. Can you elaborate?
HarryT is offline   Reply With Quote
Old 03-22-2016, 06:53 PM   #12
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,561
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by HarryT View Post
It really is almost impossible to get it right programmatically. Consider the following:

What the 'ell are you doin'?

and:

'Today is Thursday', he said.

Same pattern of quotes, but the first example has two closing quotes, while the second has an opening and a closing quote. Any tool should get the second example right. It's the first one that'll break the automated tool and need to be corrected manually.

Toxaris, how would you distinguish between these two cases, programmatically?
If the text in which the straight quote appears at beginning of a word is itself within dialogue quotes, then one could replace it with the closing single curly quote ( ’ ).

The ability to detect and correct mismatched dialogue quotes is a feature of Toxaris' EPUBTools add-in for Word so maybe the above would be possible - as a final phase in dialogue checking.

And if it's not in dialogue then what the ’ell is it doing there anyway, in which case Toxaris' could make use of his new Mark Text tool to highlight the offending text with a suitable tag and colour

Not sure if/how the above would work with UK dialogue marking (single quotes). Aside: I prefer double quotes on displays; but I loathe them on paper - they're almost invariably obtrusive, they tend to stand out like [...].

BR
BetterRed is offline   Reply With Quote
Old 03-22-2016, 07:21 PM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,901
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
What I would like is a way to convert UK style quotes to US style quotes because UK style quotes just look unnatural.
JSWolf is offline   Reply With Quote
Old 03-22-2016, 08:35 PM   #14
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,561
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by JSWolf View Post
What I would like is a way to convert UK style quotes to US style quotes because UK style quotes just look unnatural.
One brute force way to do it is to replace all singles with doubles and then either correct the spelling mistakes in the contractions - some spell checkers are better at that than others, or use a regex replace of [a-z]"[a-z] with \1’\2.

Maybe it's yet another feature Toxaris could offer in his Word add-in as part of dialogue checking

BR

Last edited by BetterRed; 03-22-2016 at 08:57 PM.
BetterRed is offline   Reply With Quote
Old 03-23-2016, 04:04 AM   #15
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by JSWolf View Post
What I would like is a way to convert UK style quotes to US style quotes because UK style quotes just look unnatural.
It all boils down to distinguishing between right single quote and apostrophe. Unfortunately, in Unicode they are the same character (a design mistake, I'd say). If using entities, I've used ’ for the former and ’ for the latter, but that doesn't help when the editor changes all entities to characters (and it makes the code messy).
Jellby is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Typographer's Quotes and other formatting issues. [Assistance to a new member] Dr. Drib Writers' Corner 6 05-07-2015 01:29 PM
Curly vs Straight Quotes in Metadata icallaci Library Management 2 05-04-2015 02:08 AM
Curly quotes or apostrophes? storax Workshop 2 06-19-2013 11:43 AM
convert straight quotes to curly quotes alansplace Calibre 3 09-25-2010 03:51 PM
curly quotes DaleDe Sigil 6 06-26-2010 10:33 PM


All times are GMT -4. The time now is 09:13 AM.


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