Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 03-26-2009, 05:43 PM   #1
MaggieScratch
Has got to the black veil
MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.
 
MaggieScratch's Avatar
 
Posts: 537
Karma: 7960
Join Date: Aug 2007
Location: Southeastern Pennsylvania
Device: Nook Color, Nook Simple Touch
Smart quotes in XHTML?

After some experimentation, I've determined that the easiest way (for me) to make an ePub book from plain text is to just mark it up myself. However, I can't figure out how to get "smart quotes" in an XHTML page and have it be valid. As far as I can tell, smart quotes aren't valid for XHTML, or at least I can't get any file that uses them to validate. It doesn't say why, just that it encountered an unexpected code or something like that. I took out the smart quotes and it validated just fine.

I've been unzipping ePub books to see how they work. I've found some that have the smart quotes. Are they just inserted and nobody worries if they don't validate?
MaggieScratch is offline   Reply With Quote
Old 03-26-2009, 05:48 PM   #2
zelda_pinwheel
zeldinha zippy zeldissima
zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.
 
zelda_pinwheel's Avatar
 
Posts: 27,828
Karma: 908606
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
by "smart quotes" do you mean properly angled quotes ? in that case, try these codes :

double quotes :
left “
right ”

single :
left ‘
right ’

angled quotes :
left «
right »

for more html entities look at this reference table.
zelda_pinwheel is offline   Reply With Quote
Old 03-26-2009, 06:02 PM   #3
pdurrant
The Ghost Mouse
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 32,250
Karma: 89021440
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
If you use a text editor that handles UTF-8 text, and specify the XHTML character set to be UTF-8 you can just include curly quotes and they'll verify OK. Otherwise you'll need to use the entities.

“

etc
Quote:
Originally Posted by MaggieScratch View Post
After some experimentation, I've determined that the easiest way (for me) to make an ePub book from plain text is to just mark it up myself. However, I can't figure out how to get "smart quotes" in an XHTML page and have it be valid. As far as I can tell, smart quotes aren't valid for XHTML, or at least I can't get any file that uses them to validate. It doesn't say why, just that it encountered an unexpected code or something like that. I took out the smart quotes and it validated just fine.

I've been unzipping ePub books to see how they work. I've found some that have the smart quotes. Are they just inserted and nobody worries if they don't validate?
pdurrant is online now   Reply With Quote
Old 03-26-2009, 08:34 PM   #4
cerement
Groupie
cerement knows what time it iscerement knows what time it iscerement knows what time it iscerement knows what time it iscerement knows what time it iscerement knows what time it iscerement knows what time it iscerement knows what time it iscerement knows what time it iscerement knows what time it iscerement knows what time it is
 
cerement's Avatar
 
Posts: 170
Karma: 2000
Join Date: Apr 2008
Location: San José, CA
Device: Amazon Kindle 1, Sony PRS-300, Amazon Kindle 3
Or use the <q> tag and the stylesheet from this page: Language Specific Quotation Marks
cerement is offline   Reply With Quote
Old 03-26-2009, 08:36 PM   #5
zelda_pinwheel
zeldinha zippy zeldissima
zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.
 
zelda_pinwheel's Avatar
 
Posts: 27,828
Karma: 908606
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
Quote:
Originally Posted by cerement View Post
Or use the <q> tag and the stylesheet from this page: Language Specific Quotation Marks
thanks for that excellent ressource !
zelda_pinwheel is offline   Reply With Quote
Old 03-26-2009, 10:09 PM   #6
jgray
Fanatic
jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.
 
Posts: 512
Karma: 1018067
Join Date: Mar 2008
Device: Galaxy Tab 10.1 & Note II
I have had trouble with the named character entities not displaying correctlyin some situations. It is safer to use the numeric entities, which will always work:

Left double quote = “
Right double quote = ”

Some text editors will allow you to enter the UTF-8 character, or the named entity and convert them to numeric on command.

The named entities that are safe to use in all cases are:

http://en.wikipedia.org/wiki/List_of...ntities_in_XML

Last edited by jgray; 03-26-2009 at 10:14 PM.
jgray is offline   Reply With Quote
Old 03-27-2009, 06:13 AM   #7
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: 6,198
Karma: 4800739
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
The proper "smart quotes" (i.e., not just oriented quotation marks, but with the ability of detecting the language and quotation level) rely, as far as I know, on the ":before" and ":after" pseudo-classes and "content" property of CSS. I'm not sure these are supported in the ePUB specification, I believe they aren't.

Besides, there is still the "issue" with multi-paragraph quotes, I don't think it's possible to define how they should behave with CSS... So, I decided to forget about the "smartiness" and instead just use the proper character (or entity) in each place.
Jellby is online now   Reply With Quote
Old 03-27-2009, 12:41 PM   #8
MaggieScratch
Has got to the black veil
MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.MaggieScratch knows the square root of minus one.
 
MaggieScratch's Avatar
 
Posts: 537
Karma: 7960
Join Date: Aug 2007
Location: Southeastern Pennsylvania
Device: Nook Color, Nook Simple Touch
I used named entities in HTML docs that I converted via Mobipocket Creator and they didn't work; just showed the code rather than the character. I ended up inserting smart quotes directly in the original HTML document. (And yes, by "smart quotes" I mean angled quotation marks, single and double--that's what they're called in Word.) I guess that's why I didn't think of it when making an XHTML document for ePub.

I did use UTF-8. I wonder why the pages didn't verify, then? The error didn't name them specifically, just said that there was a character it couldn't read. I assumed it was the quotation marks, because when I took them out there was no problem. I used the verifier on the w3.org site, uploading the document. I just used regular Notepad to make the files.

I don't own a reader that can read ePub. Do most of the readers parse named entities properly? If so, I think that might be the way to go.

When I'm coding regular HTML, I just use the straight quotes. But for something I'm going to read on a dedicated reader, it should be as book-like as possible, in my opinion, especially when trying to convert the paper fetishists! Thanks for the advice.
MaggieScratch is offline   Reply With Quote
Old 03-27-2009, 01:40 PM   #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: 6,198
Karma: 4800739
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by MaggieScratch View Post
I used named entities in HTML docs that I converted via Mobipocket Creator and they didn't work; just showed the code rather than the character.
That's strange, I'm sure it should work. Maybe you forgot the semicolon at the end of the entities or some other typo? Or maybe MPC didn't "know" you were importing an HTML file and then converted &lsquo; into &amp;lsquo;?

[quote](And yes, by "smart quotes" I mean angled quotation marks, single and double--that's what they're called in Word.)

"Smart" in the smart quotes does not mean curled/angled quotes, but the ability (or whatever) of Word to properly guess which kind of quote mark (open or close) should be used when you just type " (straight quote mark).

Quote:
I did use UTF-8. I wonder why the pages didn't verify, then? The error didn't name them specifically, just said that there was a character it couldn't read.
I'd guess the character encoding was not set to UTF-8 in the header.

Quote:
I don't own a reader that can read ePub. Do most of the readers parse named entities properly? If so, I think that might be the way to go.
Neither do I, but I can test ePUBs in Adobe Digital Editions or in a browser. Everything I've tried recognized entities (&rsquo;) or numbers (& #8217;), including the mobipocket reader in the Cybook.
Jellby is online now   Reply With Quote
Old 03-27-2009, 03:53 PM   #10
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 9,657
Karma: 5072002
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2
Quote:
Originally Posted by jgray View Post
I have had trouble with the named character entities not displaying correctlyin some situations. It is safer to use the numeric entities, which will always work:

Left double quote = “
Right double quote = ”

Some text editors will allow you to enter the UTF-8 character, or the named entity and convert them to numeric on command.

The named entities that are safe to use in all cases are:

http://en.wikipedia.org/wiki/List_of...ntities_in_XML
You really don't have to run off to other sites for this sort of thing. Look in our own wiki under Special characters

Dale
DaleDe is offline   Reply With Quote
Old 03-27-2009, 03:59 PM   #11
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 622
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by MaggieScratch View Post
don't own a reader that can read ePub. Do most of the readers parse named entities properly? If so, I think that might be the way to go.
To be spec-correct when using named entities you need to declare one of the XHTML DTDs, which means that you cannot include any non-XHTML markup in the document (such as SVG or OPF namespace-case sections). These days there's no real reason to use entities anyway. Just use an editor which will allow you to insert the character directly and use an EPUB-valid Unicode encoding (UTF-8 or UTF-16).
llasram is offline   Reply With Quote
Old 03-28-2009, 05:08 PM   #12
jgray
Fanatic
jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.jgray ought to be getting tired of karma fortunes by now.
 
Posts: 512
Karma: 1018067
Join Date: Mar 2008
Device: Galaxy Tab 10.1 & Note II
It seems that the forum software is being too smart. My numeric entities got converted to quote characters. By now, everyone should know where to go to find a table of extended characters, so it doesn't matter.

I don't remember the exact circumstances, but I did have display problems when using either the UTF-8 characters themselves, or the named entities. I have never had a problem using the numeric entities. It may simply be a matter of the various reading softwares not following spec.
jgray is offline   Reply With Quote
Old 03-28-2009, 05:53 PM   #13
cerement
Groupie
cerement knows what time it iscerement knows what time it iscerement knows what time it iscerement knows what time it iscerement knows what time it iscerement knows what time it iscerement knows what time it iscerement knows what time it iscerement knows what time it iscerement knows what time it iscerement knows what time it is
 
cerement's Avatar
 
Posts: 170
Karma: 2000
Join Date: Apr 2008
Location: San José, CA
Device: Amazon Kindle 1, Sony PRS-300, Amazon Kindle 3
Quote:
Originally Posted by jgray View Post
It may simply be a matter of the various reading softwares not following spec.
When you can't even get the major browsers to agree to follow spec it's no miracle that the electronic readers get "selective" about following spec ...

[And one of the biggest arguments from TeX users against XML/XHTML is the complete lack of compliance among programs, even among the major players - several people on these forums have commented that Adobe Digital Editions ePubs regularly do not pass epubcheck]
cerement is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre and Smart Quotes salasnet Calibre 9 09-27-2010 04:32 AM
Smart Quotes Toxaris ePub 2 05-31-2010 10:32 AM
Removing smart quotes horseyride Workshop 8 03-06-2008 12:08 PM
BASIC program for smart quotes Puffball Workshop 4 01-24-2007 09:43 AM
Smart quotes in RTF? ogghead Sony Reader 8 01-23-2007 06:38 PM


All times are GMT -4. The time now is 05:29 AM.


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