commit 4faeb1744eb696a9d1db18ad0c80960501e90308
parent 5318f776fd67998f878b9494b7e85c93b58128d0
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Fri, 7 Jan 2011 07:26:53 -0700
Scribble LaTeX rendering of non-breaking hyphen; add `~' and `-~-'
original commit: 163d10cab31ce844b34e7d11f2245842bf69691b
Diffstat:
3 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/collects/scribble/base.rkt b/collects/scribble/base.rkt
@@ -262,10 +262,12 @@
;; ----------------------------------------
-(provide ._ .__)
+(provide ._ .__ ~ -~-)
(define ._ (make-element (make-style "Sendabbrev" null) "."))
(define .__ (make-element (make-style "Sendsentence" null) "."))
+(define ~ "\uA0")
+(define -~- "\u2011")
;; ----------------------------------------
diff --git a/collects/scribble/latex-render.rkt b/collects/scribble/latex-render.rkt
@@ -625,11 +625,12 @@
"{\\SCloseSq}")
c)]
[(#\# #\% #\& #\$) (format "\\~a" c)]
- [(#\uA0) "~"]
+ [(#\uA0) "~"] ; non-breaking space
[(#\uDF) "{\\ss}"]
[else
(if ((char->integer c) . > . 127)
(case c
+ [(#\u2011) "\\mbox{-}"] ; non-breaking hyphen
[(#\uB0) "$^{\\circ}$"] ; degree
[(#\uB2) "$^2$"]
[(#\u039A) "K"] ; kappa
diff --git a/collects/scribblings/scribble/base.scrbl b/collects/scribblings/scribble/base.scrbl
@@ -288,14 +288,6 @@ gets progressively larger.}
@defproc[(emph [pre-content pre-content?] ...) element?]{
The same as @racket[italic].}
-@defproc[(linebreak) element?]{
-Produces an element that forces a line break.}
-
-@defproc[(hspace [n exact-nonnegative-integer?]) element?]{
-
-Produces an element containing @racket[n] spaces and style
-@racket['hspace].}
-
@defproc[(literal [str string?] ...+) element?]{
Produces an element containing literally @racket[str]s with no
@@ -347,6 +339,29 @@ See also @racket[verbatim].}
the @racket[path] argument should not have a suffix.
}
+@; ------------------------------------------------------------------------
+@section[#:tag "spacing"]{Spacing}
+
+@defproc[(linebreak) element?]{
+Produces an element that forces a line break.}
+
+
+@defproc[(hspace [n exact-nonnegative-integer?]) element?]{
+
+Produces an element containing @racket[n] spaces and style
+@racket['hspace].}
+
+
+@defthing[~ string?]{
+
+A string containing the non-breaking space character,
+which is equivalent to @racket['nbsp] as an element.}
+
+
+@defthing[-~- string?]{
+
+A string containing the non-breaking hyphen character.}
+
@defthing[._ element?]{