fix batch-io teachpack doc rendering, especially for PDF
This commit is contained in:
parent
ad00bccecd
commit
cf44b9cf16
|
@ -1,16 +1,20 @@
|
||||||
#lang scribble/doc
|
#lang scribble/doc
|
||||||
|
|
||||||
@(require (for-label scheme teachpack/2htdp/batch-io))
|
@(require (for-label scheme teachpack/2htdp/batch-io))
|
||||||
@(require scheme/sandbox scribble/manual scribble/eval scribble/core)
|
@(require scheme/sandbox scribble/manual scribble/eval scribble/core
|
||||||
|
scribble/html-properties scribble/latex-properties)
|
||||||
@(require "shared.ss")
|
@(require "shared.ss")
|
||||||
|
|
||||||
@(require 2htdp/batch-io)
|
@(require 2htdp/batch-io)
|
||||||
@(require scheme/runtime-path)
|
@(require scheme/runtime-path)
|
||||||
@(define-runtime-path here ".")
|
@(define-runtime-path here ".")
|
||||||
|
@(define io-style-extras
|
||||||
|
(list (make-css-addition (build-path here "io.css"))
|
||||||
|
(make-tex-addition (build-path here "io.tex"))))
|
||||||
@(define (file-is f)
|
@(define (file-is f)
|
||||||
(define x (parameterize ([current-directory here]) (read-file f)))
|
(define x (parameterize ([current-directory here]) (read-file f)))
|
||||||
(centered
|
(centered
|
||||||
(tabular #:style "searchbox"
|
(tabular #:style (make-style "FileBox" io-style-extras)
|
||||||
(list (list (verbatim x))))))
|
(list (list (verbatim x))))))
|
||||||
|
|
||||||
@(define-syntax examples-batch-io
|
@(define-syntax examples-batch-io
|
||||||
|
@ -22,7 +26,7 @@
|
||||||
(interaction-eval #:eval me (require 2htdp/batch-io))
|
(interaction-eval #:eval me (require 2htdp/batch-io))
|
||||||
(interaction-eval #:eval me d)
|
(interaction-eval #:eval me d)
|
||||||
...)
|
...)
|
||||||
(current-directory here)
|
(me `(,current-directory ,here))
|
||||||
(interaction-eval #:eval me (require lang/htdp-intermediate-lambda))
|
(interaction-eval #:eval me (require lang/htdp-intermediate-lambda))
|
||||||
me)]))
|
me)]))
|
||||||
|
|
||||||
|
@ -139,5 +143,6 @@ There is only one writer function at the moment:
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
@(delete-file "output.txt")
|
@(parameterize ([current-directory here])
|
||||||
|
(delete-file "output.txt"))
|
||||||
|
|
||||||
|
|
10
collects/teachpack/2htdp/scribblings/io.css
Normal file
10
collects/teachpack/2htdp/scribblings/io.css
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
.FileBox {
|
||||||
|
width: 16em;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
background-color: #eee;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
text-align: center;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
4
collects/teachpack/2htdp/scribblings/io.tex
Normal file
4
collects/teachpack/2htdp/scribblings/io.tex
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
\usepackage{framed}
|
||||||
|
|
||||||
|
\newenvironment{FileBox}{\begin{minipage}{4in}\begin{framed}}{\end{framed}\end{minipage}}
|
Loading…
Reference in New Issue
Block a user