07-29-2014, 03:30 AM | #31 |
frumious Bandersnatch
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
The only cases I can think of where entities/characters would matter are:
- A buggy reader that does not handle utf-8. (Or as a convenience for later edition.) - Different entities being used for the same character in different situations, like #8217 and rsquo for the curly apostrophe / right single quote. If you convert to characters you lose the distinction, which may again affect later edition. (I did get the joke.) |
07-29-2014, 08:40 AM | #32 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Well, if you plan to remove the DOCTYPE it might be a good idea to go for characters... Not all parsers understand entities without the DOCTYPE...
|
Advert | |
|
06-09-2020, 02:25 PM | #33 | |
Junior Member
Posts: 5
Karma: 10
Join Date: Apr 2020
Device: none
|
Hi... I wonder if this could be considered a good practice to avoid widows in modern days. Quote:
Thanks in advance. |
|
06-09-2020, 03:51 PM | #34 | |
Grand Sorcerer
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
Quote:
Most Kindle books are rendered justified. The avoidance of line breaks between the final words could result in extra wide spaces being used to fill in the penultimate line. In addition most Kindle books are now rendered with "enhanced typesetting" which does automatic hyphenation. You might avoid a break between the last two words, but wind up with one of them being hyphenated instead. |
|
06-09-2020, 04:01 PM | #35 | |
Resident Curmudgeon
Posts: 73,896
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
Advert | |
|
06-09-2020, 04:50 PM | #36 | ||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Many worse issues would occur, especially at large font sizes + small screens. (And welcome to MobileRead!) Quote:
If it's actual language conventions, perhaps there can be an argument made for using   in rare cases. (In Polish, single-letter words like 'z' or 'w' at the end of a line = wrong.) ... but if it's "just for looks"... no, I wouldn't use non-breaking spaces in that way. Side Note: In CSS4, there's an issue noted for "Last Line Minimum Length", but nothing came out of it so far: https://www.w3.org/TR/css-text-4/#last-line-limits |
||
06-09-2020, 05:43 PM | #37 | ||||
Junior Member
Posts: 5
Karma: 10
Join Date: Apr 2020
Device: none
|
Quote:
Quote:
Quote:
Thanks a lot. Quote:
my GREP queries for this are two: Code:
(?i)(?<=\w[[:punct:]]) (?=\w+[[:punct:]]*\r) (?i)(?<=\w) (?=\w+[[:punct:]]*\r) |
||||
06-09-2020, 07:43 PM | #38 | ||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
I'm assuming it then wraps a character style around the final two words of the paragraph? Similar to this: HTML: Code:
<p>Example with last two words stuck together: <span class="nowrap">final words</span>.</p> Code:
.nowrap { white-space: nowrap; } Biggest reason why these "last-line hacks" work reasonably better in InDesign is because it has access to better hyphenation and justification (H&J) algorithms. If that final line is going to be ugly, InDesign readjusts spacing throughout the entire paragraph. In ebooks, you're typically working with much smaller devices (and larger fonts), so the "single word on last line" crops up much more often. Justification also happens at the line-level, so you can get especially egregious spacing on the 2nd-to-last line if you force words together. Many devices also don't have hyphenation (or good hyphenation dictionaries)... so that exaggerates poor spacing even more. Side Note: For even more trying-to-keep-things-together-across-line-breaks, also see: "No break space and alignment" from earlier this year + "Keeping punctuation from splitting across text-wrap linebreak" which happened a few days after this thread. Quote:
I wish that Word/LibreOffice had something a bit more powerful like that too. The Regular Expression modes are... definitely not as good as I'm used to in Sigil/Calibre/Notepad++. :P |
||
06-09-2020, 09:00 PM | #39 | |||
Junior Member
Posts: 5
Karma: 10
Join Date: Apr 2020
Device: none
|
Quote:
HTML: Code:
<p>Example…: final<span class="nobreak"> </span>words.</p> Code:
.nobreak {white-space: nowrap;} Quote:
Quote:
Well... InDesign uses GREP, but I think its too limited. Sometimes I have to copy the text and place it into Sigil to use its RegEx engine in order to find some things. I don't know if there's a better software for this, never looked into it, but Sigil works for this. |
|||
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pages Not Breaking | msmith65 | Sigil | 8 | 08-21-2012 12:32 PM |
Space Captain Smith of the British Space Empire | Kacetwo | Deals and Resources (No Self-Promotion or Affiliate Links) | 4 | 07-02-2012 03:41 AM |
Breaking DRM | maurices5000 | Sony Reader | 40 | 02-02-2011 07:14 PM |
Non breaking spaces? | troymc | Sigil | 6 | 05-22-2010 07:47 AM |