commit 4563ae1d7b559c1b384d3b1b1dba6ad7e78faa45
parent 1b4c0c027c17561b7dc8fec0f64d9c52cc3f387b
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Sat, 28 Feb 2009 15:27:09 +0000
fix latex rendering of superscripts; fix CSS inclusion in subsections rendered on separate pages
svn: r13880
original commit: 95cc90e0e47271e75ac65d54e37e48a66d288173
Diffstat:
4 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/collects/scribble/base-render.ss b/collects/scribble/base-render.ss
@@ -47,11 +47,17 @@
;; ----------------------------------------
- (define/public (extract-part-style-files d tag stop-at-part?)
- (let loop ([p d])
+ (define/public (extract-part-style-files d ri tag stop-at-part?)
+ (let loop ([p d][up? #t][only-up? #f])
(let ([s (part-style p)])
(apply
append
+ (if up?
+ (let ([p (collected-info-parent (part-collected-info p ri))])
+ (if p
+ (loop p #t #t)
+ null))
+ null)
(if (list? s)
(filter
values
@@ -63,11 +69,13 @@
(cadr s)))
s))
null)
- (map (lambda (p)
- (if (stop-at-part? p)
- null
- (loop p)))
- (part-parts p))))))
+ (if only-up?
+ null
+ (map (lambda (p)
+ (if (stop-at-part? p)
+ null
+ (loop p #f #f)))
+ (part-parts p)))))))
;; ----------------------------------------
diff --git a/collects/scribble/html-render.ss b/collects/scribble/html-render.ss
@@ -614,6 +614,7 @@
(append style-extra-files
(extract-part-style-files
d
+ ri
'css
(lambda (p) (part-whole-page? p ri)))))
,(scribble-js-contents script-file script-path))
diff --git a/collects/scribble/latex-render.ss b/collects/scribble/latex-render.ss
@@ -52,6 +52,7 @@
(append style-extra-files
(extract-part-style-files
d
+ ri
'tex
(lambda (p) #f)))))
(printf "\\begin{document}\n\\preDoc\n")
diff --git a/collects/scribble/scribble.tex b/collects/scribble/scribble.tex
@@ -40,8 +40,8 @@
\newcommand{\schemeerrorcol}[1]{\inColor{red}{#1}}
\newcommand{\schemeerror}[1]{{\schemeerrorcol{\textrm{\textit{#1}}}}}
\newcommand{\schemeopt}[1]{#1}
-\newcommand{\textsub}[1]{$_{#1}$}
-\newcommand{\textsuper}[1]{$^{#1}$}
+\newcommand{\textsub}[1]{$_{\hbox{\textsmaller{#1}}}$}
+\newcommand{\textsuper}[1]{$^{\hbox{\textsmaller{#1}}}$}
\newcommand{\refcolumn}[1]{#1}
\newcommand{\refcontent}[1]{#1}
\newcommand{\intextcolor}[2]{\textcolor{#1}{#2}}