On 27 July 2015 at 02:55, Ken McGlothlen <[email protected]> wrote: > The ellipsis character in some fonts occasionally shows a lack of attention, > and the spacing is often too tight. I'd rather just use normal non-breaking > interword spaces between the dots of an ellipsis, and I'd like to handle > end-of-sentence ellipses properly as well: > > xxx xxx ... xxx ⟶ xxx xxx . . . xxx > xxx xxx.... Xxx ⟶ xxx xxx. . . . Xxx > xxx xxx!... Xxx ⟶ xxx xxx! . . . Xxx > xxx xxx?... Xxx ⟶ xxx xxx? . . . Xxx > > > (Typography geek note: Note that the dots in the “....” and “!...” are > pretty much equidistant, but that “?...” isn't. That's something else I > wanted to fix, even though it's more or less font-specific.) > > So this was my first attempt: > > # Ellipses > > # (1) Make "..." go back to default behavior. > > (?<!\\)\.\.\.=... > > # (2) "...." and "!..." > > ([.!])\.\.\.=\1 . . . > # (3) "?...", with slight kern to adjust for width of "?" > > [?]\.\.\.=<span style="letter-spacing: > -0.1em;">?</span> . . . > > # (4) Normal non-escape ellipses again. > > (?<!\\)\.\.\.=. . . > # (5) Escaped ellipses. > > \\\.\.\.=... >
A pattern can only occur once in replacements, otherwise you would not be able to change the original definition of ... but it keeps the position of the original definition, which is of course right at the beginning since its from the system config files, ie a replacement replaces a replacement (sorry couldn't resist :). (untried) You could make (1) replace ... with some unique sequence (whilst there is no such sequence in general, I'm sure you can find one that doesn't occur in your document) and make (2) (3) and (4) search for that. Cheers Lex > > Given the source paragraph > > So ... how does this work now?... Hey, pretty good!... Excellent.... \... > yes? > > > I get: > > <div class="paragraph"><p>So . . . how does this work > now?. . . Hey, pretty good!. . . > Excellent. . .. ... yes?</p></div> > > The first normal ellipsis works, but unfortunately, the "normal non-escape > ellipses" (expression 4) seems to take precedence over the other > end-of-sentence replacements (expressions 2 and 3), thus screwing up the > spacing. > > This confuses me a bit, because according to the user guide's relevant > section, > > Replacements are performed in the same order they appear in the > configuration file replacements section. > > > Anyone have an idea of what I'm doing wrong? > > -- > You received this message because you are subscribed to the Google Groups > "asciidoc" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/asciidoc. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "asciidoc" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/asciidoc. For more options, visit https://groups.google.com/d/optout.
