From ab1fe071d1c7d3f61e8e60ec02f940cff3461109 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 7 Jan 2011 09:15:12 -0700 Subject: [PATCH] Scribble soft-hyphen support for Latex rendering; `?-' in `scribble/base' original commit: 21d324a1696daa84954959696052163fa5488021 --- collects/scribble/base.rkt | 3 ++- collects/scribble/latex-render.rkt | 1 + collects/scribblings/scribble/base.scrbl | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/collects/scribble/base.rkt b/collects/scribble/base.rkt index 98732fd0..cd9a456a 100644 --- a/collects/scribble/base.rkt +++ b/collects/scribble/base.rkt @@ -262,11 +262,12 @@ ;; ---------------------------------------- -(provide ._ .__ ~ -~-) +(provide ._ .__ ~ ?- -~-) (define ._ (make-element (make-style "Sendabbrev" null) ".")) (define .__ (make-element (make-style "Sendsentence" null) ".")) (define ~ "\uA0") +(define ?- "\uAD") (define -~- "\u2011") ;; ---------------------------------------- diff --git a/collects/scribble/latex-render.rkt b/collects/scribble/latex-render.rkt index c3647619..f88f3042 100644 --- a/collects/scribble/latex-render.rkt +++ b/collects/scribble/latex-render.rkt @@ -626,6 +626,7 @@ c)] [(#\# #\% #\& #\$) (format "\\~a" c)] [(#\uA0) "~"] ; non-breaking space + [(#\uAD) "\\-"] ; soft hyphen; unfortunately, also disables auto-hyphen [(#\uDF) "{\\ss}"] [else (if ((char->integer c) . > . 127) diff --git a/collects/scribblings/scribble/base.scrbl b/collects/scribblings/scribble/base.scrbl index 16c008aa..4e0716cb 100644 --- a/collects/scribblings/scribble/base.scrbl +++ b/collects/scribblings/scribble/base.scrbl @@ -367,6 +367,12 @@ which is equivalent to @racket['nbsp] as an element.} A string containing the non-breaking hyphen character.} +@defthing[?- string?]{ + +A string containing the soft-hyphen character (i.e., a suggestion of +where to hyphenate a word to break it across lines when rendering).} + + @defthing[._ element?]{ Generates a period that ends an abbreviation in the middle of a