commit a05ce99d9b1cb176eb648753e84bebf4aa1521c9
parent e17c2db7775f71e8f5678e77e941b50fedebea40
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Tue, 29 Jul 2014 16:51:19 +0100
scribble: recognize 'exact-chars even when a style name is #f
Patch from Tero Hasu.
original commit: 30a354c820160d8816746567403ee1a0f34f192a
Diffstat:
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/pkgs/scribble-pkgs/scribble-doc/scribblings/scribble/core.scrbl b/pkgs/scribble-pkgs/scribble-doc/scribblings/scribble/core.scrbl
@@ -876,13 +876,16 @@ The following @tech{style properties} are currently recognized:
suitable for Latex @tt{tt} mode.}
@item{@racket['exact-chars] --- For Latex output, when the @tech{style
- name} is a string, render the elements content exactly
+ name} is a string or @racket[#f], render the elements content exactly
(without escapes).}
@item{@racket[command-extras] structure --- For Latex output,
adds strings as arguments to the Latex command.}
-]}
+]
+
+@history[#:changed "1.6" @elem{Changed @racket['exact-chars] handling to
+ take effect when the style name is @racket[#f].}]}
@defstruct[(image-element element) ([path (or/c path-string?
diff --git a/pkgs/scribble-pkgs/scribble-lib/scribble/latex-render.rkt b/pkgs/scribble-pkgs/scribble-lib/scribble/latex-render.rkt
@@ -414,9 +414,9 @@
(parameterize ([rendering-tt (or tt? (rendering-tt))])
(super render-content e part ri))]))]
[wrap (lambda (e s tt?)
- (printf "\\~a{" s)
+ (when s (printf "\\~a{" s))
(core-render e tt?)
- (printf "}"))])
+ (when s (printf "}")))])
(define (finish tt?)
(cond
[(symbol? style-name)
@@ -465,6 +465,10 @@
(printf "}")))]
[else
(wrap e style-name tt?)]))]
+ [(and (not style-name)
+ style
+ (memq 'exact-chars (style-properties style)))
+ (wrap e style-name 'exact)]
[else
(core-render e tt?)]))
(let loop ([l (if style (style-properties style) null)] [tt? #f])