commit 37c398ffbf871c6c5a757d02efd89a558fbb92cc
parent a5f9e4bee82562e651f852b5f7f570acd735154c
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Fri, 31 Aug 2012 07:23:55 -0600
propagate prefix repair to to `scribble/jfp' and `scribble/lncs'
original commit: d841ec1bd0aac12c7d977f4be419f8c2728a6d17
Diffstat:
6 files changed, 34 insertions(+), 7 deletions(-)
diff --git a/collects/scribble/jfp/lang.rkt b/collects/scribble/jfp/lang.rkt
@@ -6,6 +6,7 @@
"../private/defaults.rkt"
net/ftp
racket/file
+ scribble/latex-prefix
(for-syntax scheme/base))
(provide (except-out (all-from-out scribble/doclang) #%module-begin)
(all-from-out scribble/jfp)
@@ -32,7 +33,8 @@
(define ((post-process) doc)
(add-defaults doc
(string->bytes/utf-8
- (format "\\documentclass{jfp1}\n\\usepackage{times}\n\\usepackage{qcourier}\n"))
+ (format "\\documentclass{jfp1}\n~a\\usepackage{times}\n\\usepackage{qcourier}\n"
+ unicode-encoding-packages))
(scribble-file "jfp/style.tex")
(list cls-file)
#f))
diff --git a/collects/scribble/latex-prefix.rkt b/collects/scribble/latex-prefix.rkt
@@ -0,0 +1,8 @@
+#lang racket/base
+
+(provide unicode-encoding-packages)
+
+(define unicode-encoding-packages
+ (string-append
+ "\\usepackage[utf8]{inputenc}\n"
+ "\\usepackage[T1]{fontenc}\n"))
diff --git a/collects/scribble/lncs/lang.rkt b/collects/scribble/lncs/lang.rkt
@@ -9,6 +9,7 @@
setup/main-collects
scribble/html-properties
scribble/latex-properties
+ scribble/latex-prefix
racket/stxparam
net/ftp
file/gunzip
@@ -43,7 +44,8 @@
(define ((post-process) doc)
(add-defaults doc
- (string->bytes/utf-8 "\\documentclass{llncs}\n")
+ (string->bytes/utf-8 (string-append "\\documentclass{llncs}\n"
+ unicode-encoding-packages))
(scribble-file "lncs/style.tex")
(list cls-file)
#f))
diff --git a/collects/scribble/sigplan/lang.rkt b/collects/scribble/sigplan/lang.rkt
@@ -3,6 +3,7 @@
scribble/core
scribble/base
scribble/sigplan
+ scribble/latex-prefix
racket/list
"../private/defaults.rkt"
(for-syntax scheme/base))
@@ -66,10 +67,9 @@ Read here for more:
(add-sigplan-styles
(add-defaults doc
(string->bytes/utf-8
- (format "\\documentclass~a{sigplanconf}\n~a~a~a~a"
+ (format "\\documentclass~a{sigplanconf}\n~a~a~a"
options
- "\\usepackage[utf8]{inputenc}"
- "\\usepackage[T1]{fontenc}"
+ unicode-encoding-packages
(if times?
"\\usepackage{times}\n"
"")
diff --git a/collects/scribblings/scribble/config.scrbl b/collects/scribblings/scribble/config.scrbl
@@ -2,7 +2,8 @@
@(require scribble/manual scribble/core scribble/decode
scribble/html-properties scribble/latex-properties
"utils.rkt"
- (for-label racket/base))
+ (for-label racket/base
+ scribble/latex-prefix))
@(define (fake-title . str) (apply bold str))
@@ -264,3 +265,15 @@ style:
]
+@; ------------------------------------------------------------
+
+@section[#:tag "latex-prefix"]{Latex Prefix Support}
+
+@defmodule[scribble/latex-prefix]{Provides a string that is useful for
+constructing a Latex document prefix.}
+
+@defthing[unicode-encoding-packages string?]{
+
+A string containing Latex code that is useful after a
+@tt{\documentclass} declaration to make Latex work with Unicode
+characters.}
diff --git a/collects/scribblings/scribble/core.scrbl b/collects/scribblings/scribble/core.scrbl
@@ -1456,7 +1456,9 @@ be a result of @racket[path->main-collects-relative].
Languages (used with @hash-lang[]) like
@racketmodname[scribble/manual] and @racketmodname[scribble/sigplan]
add this property to a document to specify appropriate files for Latex
-rendering.}
+rendering.
+
+See also @racketmodname[scribble/latex-prefix].}
@defstruct[latex-auto-extra-files ([paths (listof (or/c path-string?