scribble: recognize 'exact-chars even when a style name is #f
Patch from Tero Hasu. original commit: 30a354c820160d8816746567403ee1a0f34f192a
This commit is contained in:
parent
e17c2db777
commit
a05ce99d9b
|
@ -876,13 +876,16 @@ The following @tech{style properties} are currently recognized:
|
||||||
suitable for Latex @tt{tt} mode.}
|
suitable for Latex @tt{tt} mode.}
|
||||||
|
|
||||||
@item{@racket['exact-chars] --- For Latex output, when the @tech{style
|
@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).}
|
(without escapes).}
|
||||||
|
|
||||||
@item{@racket[command-extras] structure --- For Latex output,
|
@item{@racket[command-extras] structure --- For Latex output,
|
||||||
adds strings as arguments to the Latex command.}
|
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?
|
@defstruct[(image-element element) ([path (or/c path-string?
|
||||||
|
|
|
@ -414,9 +414,9 @@
|
||||||
(parameterize ([rendering-tt (or tt? (rendering-tt))])
|
(parameterize ([rendering-tt (or tt? (rendering-tt))])
|
||||||
(super render-content e part ri))]))]
|
(super render-content e part ri))]))]
|
||||||
[wrap (lambda (e s tt?)
|
[wrap (lambda (e s tt?)
|
||||||
(printf "\\~a{" s)
|
(when s (printf "\\~a{" s))
|
||||||
(core-render e tt?)
|
(core-render e tt?)
|
||||||
(printf "}"))])
|
(when s (printf "}")))])
|
||||||
(define (finish tt?)
|
(define (finish tt?)
|
||||||
(cond
|
(cond
|
||||||
[(symbol? style-name)
|
[(symbol? style-name)
|
||||||
|
@ -465,6 +465,10 @@
|
||||||
(printf "}")))]
|
(printf "}")))]
|
||||||
[else
|
[else
|
||||||
(wrap e style-name tt?)]))]
|
(wrap e style-name tt?)]))]
|
||||||
|
[(and (not style-name)
|
||||||
|
style
|
||||||
|
(memq 'exact-chars (style-properties style)))
|
||||||
|
(wrap e style-name 'exact)]
|
||||||
[else
|
[else
|
||||||
(core-render e tt?)]))
|
(core-render e tt?)]))
|
||||||
(let loop ([l (if style (style-properties style) null)] [tt? #f])
|
(let loop ([l (if style (style-properties style) null)] [tt? #f])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user