pax_global_header 0000666 0000000 0000000 00000000064 13211305443 0014506 g ustar 00root root 0000000 0000000 52 comment=5e4f0ca67bac448e19a24c09f12fc16d24cd6b6d stex-1.2.1+git20171204.g5e4f0ca/ 0000775 0000000 0000000 00000000000 13211305443 0015367 5 ustar 00root root 0000000 0000000 stex-1.2.1+git20171204.g5e4f0ca/.gitignore 0000664 0000000 0000000 00000000017 13211305443 0017355 0 ustar 00root root 0000000 0000000 *~ .*.sw? .sw? stex-1.2.1+git20171204.g5e4f0ca/Makefile 0000664 0000000 0000000 00000004646 13211305443 0017041 0 ustar 00root root 0000000 0000000 VERSION=1.2 # override PREFIX, Scheme, and LIB as necessary PREFIX=/usr # scheme executable Scheme=$(PREFIX)/bin/scheme # target location for stex LIB=$(PREFIX)/lib/stex$(VERSION) m := $(shell echo '(machine-type)' | $(Scheme) -q) Install=./sbin/install exec = $m/scheme-prep $m/html-prep $m/fixbibtex all: $(exec) $m/scheme-prep: src/dsm.ss src/preplib.ss src/script.ss src/scheme-prep.ss if [ ! -d $m ] ; then mkdir $m ; fi sed -e 's;^#! /usr/bin/scheme --program;#! $(Scheme) --program;' src/scheme-prep.ss > $m/scheme-prep.ss echo '(reset-handler abort) (library-directories (quote "src::$m")) (compile-imported-libraries #t) (generate-wpo-files #t) (compile-program "$m/scheme-prep.ss") (compile-whole-program "$m/scheme-prep.wpo" "$m/scheme-prep")' | $(Scheme) -q chmod 755 $m/scheme-prep $m/html-prep: src/dsm.ss src/preplib.ss src/script.ss src/html-prep.ss if [ ! -d $m ] ; then mkdir $m ; fi sed -e 's;^#! /usr/bin/scheme --program;#! $(Scheme) --program;' src/html-prep.ss > $m/html-prep.ss echo '(reset-handler abort) (library-directories (quote "src::$m")) (compile-imported-libraries #t) (generate-wpo-files #t) (compile-program "$m/html-prep.ss") (compile-whole-program "$m/html-prep.wpo" "$m/html-prep")' | $(Scheme) -q chmod 755 $m/html-prep $m/fixbibtex: src/fixbibtex.ss -if [ ! -d $m ] ; then mkdir $m ; fi sed -e 's;^#! /usr/bin/scheme --program;#! $(Scheme) --program;' src/fixbibtex.ss > $m/fixbibtex.ss echo '(reset-handler abort) (library-directories (quote "src::$m")) (compile-imported-libraries #t) (generate-wpo-files #t) (compile-program "$m/fixbibtex.ss") (compile-whole-program "$m/fixbibtex.wpo" "$m/fixbibtex")' | $(Scheme) -q chmod 755 $m/fixbibtex install: $(exec) $(Install) -o root -g root -m 755 -d $(LIB) $(Install) -o root -g root -m 755 -d $(LIB)/inputs $(Install) -o root -g root -m 644 inputs/* $(LIB)/inputs $(Install) -o root -g root -m 755 -d $(LIB)/gifs $(Install) -o root -g root -m 644 gifs/* $(LIB)/gifs $(Install) -o root -g root -m 755 -d $(LIB)/math $(Install) -o root -g root -m 644 math/* $(LIB)/math $(Install) -o root -g root -m 755 -d $(LIB)/$m $(Install) -o root -g root -m 644 $(exec) $(LIB)/$m (umask 022; sed -e 's;^LIB=.*;LIB=$(LIB);' Mf-stex > $(LIB)/Mf-stex) (umask 022; sed -e 's;include ~/stex/Mf-stex;include $(LIB)/Mf-stex;' Makefile.template > $(LIB)/Makefile.template) uninstall: /bin/rm -rf $(LIB) clean: /bin/rm -f Make.out distclean: clean /bin/rm -rf $m stex-1.2.1+git20171204.g5e4f0ca/Makefile.template 0000664 0000000 0000000 00000001113 13211305443 0020635 0 ustar 00root root 0000000 0000000 VERSION=1.2 Scheme=scheme STEXLIB=/usr/lib/stex$(VERSION) # define default document pathname here # override on command line with 'make x=newdoc' x = ??? # define latex processor: latex or pdflatex latex = pdflatex # define stex macro files here stexmacrofiles = # list bibliography files here bib = # define index if an index is to be generated # index=yes include $(STEXLIB)/Mf-stex # define or override suffixes here # define any additional targets here # define any dependencies here # define cleanup targets here: $(x).clean: $(x).reallyclean: $(x).reallyreallyclean: stex-1.2.1+git20171204.g5e4f0ca/Mf-stex 0000664 0000000 0000000 00000007022 13211305443 0016636 0 ustar 00root root 0000000 0000000 # Mf-stex expects to be included in a make file that defines: # Scheme the path of the Chez Scheme executable # STEXLIB the path to the stex library (the library containing this file) m := $(shell echo '(machine-type)' | $(Scheme) -q) TEXINPUTS:=.:$(STEXLIB)/inputs: export TEXINPUTS ifeq ($(wildcard $(STEXLIB)/$m/scheme-prep),) Sprep = $(Scheme) --libdirs "$(STEXLIB)/src" --program $(STEXLIB)/src/scheme-prep.ss else Sprep = $(STEXLIB)/$m/scheme-prep endif ifeq ($(wildcard $(STEXLIB)/$m/html-prep),) Hprep = $(Scheme) --libdirs "$(STEXLIB)/src" --program $(STEXLIB)/src/html-prep.ss else Hprep = $(STEXLIB)/$m/html-prep endif ifeq ($(wildcard $(STEXLIB)/$m/fixbibtex),) fixbibtex = $(Scheme) --libdirs "$(STEXLIB)/src" --program $(STEXLIB)/src/fixbibtex.ss else fixbibtex = $(STEXLIB)/$m/fixbibtex endif mathdir=math/$(x) mathfiles=$(mathdir)/mathfiles # solaris /bin/sh doesn't support '!' in test SHELL=bash stexsrc = $(x).stex texsrc = $(x).tex spellobj = $(x).spell .SUFFIXES: .SUFFIXES: .stex .tex .spell .fig .ps .png .pdf .eps .stex.tex: $(Sprep) $(stexmacrofiles) $* chmod -w $*.tex .tex.spell: latexspell $*.tex .fig.ps: fig2dev -Leps $*.fig $*.ps .fig.png: fig2dev -Lppm $*.fig | pnmcrop | pnmtopng -transparent white > $*.png chmod go=r $*.png .ps.png: echo | gs -q -dNOPAUSE -dSAFER -sDEVICE=ppmraw -sOutputFile=- -r90x90 $*.ps | pnmcrop | pnmtopng -transparent white > $*.png # need to generate eps first to compute bounding box # need --gs on my machine at home or it fails to find bounding box .ps.eps: ps2epsi $*.ps $*.eps .eps.pdf: epstopdf --gs $*.eps .fig.pdf: fig2dev -Leps $*.fig | epstopdf --filter > $*.pdf ifeq "$(latex)" "latex" doitformebaby: $(x).ps $(x).html $(x).ps: $(x).thirdrun dvips -o $(x).ps $(x).dvi $(x).pdf: $(x).ps ps2pdf $*.ps $*.pdf chmod 644 $*.pdf else doitformebaby: $(x).pdf $(x).html $(x).pdf: $(x).thirdrun chmod 644 $(x).pdf endif $(x).dvi: $(x).thirdrun $(x).thirdrun: $(x).secondrun ifdef index makeindex $(x) endif $(latex) $(x) touch $(x).thirdrun $(x).secondrun: $(x).firstrun $(bib) ifneq ($(strip $(bib)),) bibtex $(x) $(fixbibtex) $(x).bbl endif ifdef index makeindex $(x) endif $(latex) $(x) touch $(x).secondrun $(x).firstrun: $(texsrc) touch $(x).htoc $(latex) $(x) touch $(x).firstrun all.tex: $(texsrc) $(x).html: $(x).mathrun $(x).mathrun: gifs $(mathfiles) @(cd $(mathdir); make) touch $(x).mathrun gifs: (cd $(STEXLIB); tar -cf - gifs) | tar -xpf - math: (cd $(STEXLIB); tar -cf - math) | tar -xpf - $(mathfiles): $(x).hthirdrun $(figps) echo -n gifs= > $(mathfiles) (cd $(mathdir); echo *.tex | sed -e "s/\.tex/.gif/g") >> $(mathfiles) $(x).hthirdrun: $(x).hsecondrun $(Hprep) --mathdir $(mathdir) $(x) chmod 444 *.html touch $(x).hthirdrun $(x).hsecondrun: $(x).hfirstrun $(Hprep) --mathdir $(mathdir) $(x) chmod 444 *.html touch $(x).hsecondrun $(x).hfirstrun: math $(x).thirdrun (if [ ! -e $(mathdir) ] ; then mkdir -p -m u=rwx,g=srx,o=rx $(mathdir); ln -s ../Makefile ../mathmacros $(mathdir); fi) $(Hprep) --mathdir $(mathdir) $(x) touch $(x).hfirstrun spell: $(spellobj) $(x).spell: $(x).bbl $(x).tex latexspell $(x).bbl latexspell $(x).tex clean: $(x).clean -/bin/rm -f *.log *.dvi *.aux *.out *.toc *.tmp *.idx *.ilg *.ind *.blg *.bbl *.rfm *.sfm *.firstrun *.secondrun *.thirdrun -/bin/rm -f *.haux *.htoc *.hidx *.hfirstrun *.hsecondrun *.hthirdrun *.mathrun -/bin/rm -f *.tex reallyclean: clean $(x).reallyclean -/bin/rm -f *.html *.ps *.pdf *.png reallyreallyclean: reallyclean $(x).reallyreallyclean -/bin/rm -rf $(mathdir) stex-1.2.1+git20171204.g5e4f0ca/ReadMe 0000664 0000000 0000000 00000003542 13211305443 0016453 0 ustar 00root root 0000000 0000000 stex: stex => latex and latex => html converters and associated tools Copyright (c) 1998-2016 R. Kent Dybvig and Oscar Waddell Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- This directory contains the following files and subdirectories as of April 2016: doc a short stex overview gifs/ support for building 'ghost' right arrows inputs/ sample class files, style files, etc. Makefile for compiling stex itself Makefile.template template make file for stex-based docs Mf-stex common (included) makefile for stex-based docs math/ base math subdirectory for stex-based docs ReadMe this file sbin/ helper scripts src/ stex sources See doc/stex.html for a brief overview of stex and how to use it. stex-1.2.1+git20171204.g5e4f0ca/doc/ 0000775 0000000 0000000 00000000000 13211305443 0016134 5 ustar 00root root 0000000 0000000 stex-1.2.1+git20171204.g5e4f0ca/doc/Makefile 0000664 0000000 0000000 00000001037 13211305443 0017575 0 ustar 00root root 0000000 0000000 # define default document pathname here # override on command line with 'make x=newdoc' x = stex # define latex processor: latex or pdflatex latex = pdflatex # define stex macro files here stexmacrofiles = # list bibliography files here bib = # define index if an index is to be generated # index=yes include ~/stex/Mf-stex # define or override suffixes here # define any additional targets here # define any dependencies here # define cleanup targets here: $(x).clean: -rm -f $x.rawsst $(x).reallyclean: $(x).reallyreallyclean: stex-1.2.1+git20171204.g5e4f0ca/doc/stex.css 0000664 0000000 0000000 00000002265 13211305443 0017636 0 ustar 00root root 0000000 0000000 BODY {background-color: #FFFFFF} a:link, a:active, a:visited { color:#6d380b; text-decoration:underline } a:hover { color:white; text-decoration:underline; background:#6d380b } a.plain:link, a.plain:active, a.plain:visited { color:#6d380b; text-decoration:none } a.plain:hover { color:white; text-decoration:none; background:#6d380b } a.toc:link, a.toc:active, a.toc:visited {font-family: sans-serif; color:#6d380b; text-decoration:none} a.toc:hover {font-family: sans-serif; color:white; text-decoration:none; background:#6d380b} a.image:link, a.image:active, a.image:visited, a.image:hover { color: #6d380b; background: #FFFFFF; } ul.tocchapter { list-style: none; } ul.tocsection { list-style: circle; color: #923a3a } hr.copyright { width: 50% } input.default { background: #ffffff; color: #000000; vertical-align: middle} h1, h2, h3, h4 {font-family: sans-serif; color: #6d380b} h1 {font-size: 2em} h2 {margin-top: 30px; font-size: 1.5em} h3 {margin-top: 30px; font-size: 1.17em} h1, h2, h3, h4 {font-weight: bold} .title { font-family: sans-serif; font-weight: bold; font-size: 2.5em; color: #6d380b; white-space: nowrap} .formdef { color: #6d380b } table.indent {margin-left: 20px} stex-1.2.1+git20171204.g5e4f0ca/doc/stex.html 0000664 0000000 0000000 00000057677 13211305443 0020033 0 ustar 00root root 0000000 0000000
1. | Overview | ||||||||||||
2. | Installation | ||||||||||||
3. | Usage notes | ||||||||||||
4. | Basic stex commands | ||||||||||||
| |||||||||||||
5. | Scheme transcripts | ||||||||||||
| |||||||||||||
6. | html-prep support for the tabular environment |
The stex package consists of two main programs and some supporting items, such as make files, make-file templates, class files, and style files. The two main programs are scheme-prep and html-prep. scheme-prep performs a conversion from "stex"-formatted files into latex-formatted files, while html-prep converts (some) latex-formatted files into html-formatted files.
An stex file is really just a latex file extended with a handful of commands for including Scheme code (or pretty much any other kind of code, as long as you don't plan to use the Scheme-specific transcript support) in a document, plus a couple of additional features rather arbitrarily thrown in.
The subset of latex-formatted files html-prep is capable of handling is rather small but has nevertheless been useful for our purposes, which include producing html versions of a couple of books (The Scheme Programming Language, Editions 2-4 and the Chez Scheme User's Guides for Versions 6-9), the scheme.com web site, class websites, class assignments, and various other documents.
A prerequisite to building and using stex is to have Chez Scheme or Petite Chez Scheme installed on your system. You'll also need pdflatex, dvips, ghostscript, and netbpm. We've run stex under Linux and OS X but have not tried to run it under Windows.
The simplest way to install stex for your personal use is to clone the stex directory into your home directory, cd into the stex directory, and run make:
make BIN=bindir
where bindir is the directory where make will find the scheme or petite executables.
This will create a subdirectory, named for the installed Chez Scheme machine type, containing binary versions of the programs.
You can also use "make install" to make stex available for other users.
sudo make install BIN=bindir LIB=libdir
where bindir is as described above, and libdir is the directory where the stex library directory should be installed.
The simplest way to get started with stex is to get this document to build (in the doc directory) and create your own document by cloning this document's source file (stex.stex) and make file (Makefile). If you've installed stex in your home directory, you should be able to build this document by running "make" without arguments in the doc directory. If you've installed stex elsewhere, you'll first have to modify the include for Mf-stex to reflect its installed location.
Makefile is where you declare your stex sources and various other things, like bibtex and graphics files. If you don't have anything much more complicated than this document, you might just need to change the line that declares the main stex entry point, i.e., the line that reads x = stex, to reflect the name of your document.
The make is orchestrated by Mf-stex, which knows how to run scheme-prep, html-prep, pdflatex (multiple times), and various other commands to produce both pdf and html versions of the stex document.
You can also consult the more elaborate stex source and make files for the Chez Scheme User's Guide in the csug directory of a Chez Scheme release.
An stex document includes inline Scheme (or other) code via the \scheme command, e.g.:
When called with two arguments, \scheme{cons} creates a pair of the two arguments, e.g., \scheme{(cons 3 4)} produces \scheme{(3 . 4)}.
produces:
When called with two arguments, cons creates a pair of the two arguments, e.g., (cons 3 4) produces (3 . 4).
An stex document includes out-of-line Scheme (or other) code via \schemedisplay and \endschemedisplay, e.g.:
\schemedisplay (define fact (lambda (x) "a light year is a measure of distance")) (define fib (lambda (x) "a light year is a measure of time")) \endschemedisplay
produces:
(define fact
(lambda (x)
"a light year is a measure of distance"))
(define fib
(lambda (x)
"a light year is a measure of time"))
Within a Scheme display, ;=> is converted into a double right arrow
(), ;-> into a single right arrow (
), and
;== into a phantom of the same size.
This is useful for showing what a piece of code translates or evaluates to,
e.g.:
A \scheme{let} expression expands into a call to a \scheme{lambda} expression, e.g.: \schemedisplay (let ([a 17]) ;-> ((lambda (a) (+ a a)) (+ a a)) ;== 17) \endschemedisplay A \scheme{let} expression first evaluates the right-hand-side expression, then evaluates the body in an environment that binds the left-hand-side variable to the resulting value, e.g.: \schemedisplay (let ([a 17]) ;=> 17 (+ a a)) \endschemedisplay
produces
A let expression expands into a call to a lambda expression, e.g.:(let ([a 17])
((lambda (a) (+ a a))
(+ a a))17)
A let expression first evaluates the right-hand-side expression, then evaluates the body in an environment that binds the left-hand-side variable to the resulting value, e.g.:
(let ([a 17])
17
(+ a a))
Code can include emphasized variables via the \var command, e.g.:
\scheme{(let ([\var{x} \var{e}]) \var{body})} binds the variable \var{x} to the value of \var{e} in \var{body}.
produces:
(let ([x e]) body) binds the variable x to the value of e in body.
If the text within a \var form contains an underscore, the following character or bracketed subform is converted into a subscript, e.g., \var{abc_3} produces abc3, and \var{7e5_16} produces 7e516.
\var forms may appear within a \scheme form, within a Scheme display formed by \schemedisplay and \endschemedisplay commands, or by itself outside of either.
Raw text can be included in code via the \raw command. For example:
\schemedisplay (sqrt \raw{$x$}) \is \raw{$\sqrt{x}$}. \endschemedisplay
produces:
(sqrt x)
![]()
.
Output generated by a Scheme program can be inserted into the output via \generated and \endgenerated commands, e.g.:
\generated (let () (define fibs (lambda (x y n) (if (= n 0) '() (cons x (fibs y (+ x y) (- n 1)))))) (let ([n 5]) (printf "first ~r primes: ~{~s~^, ~}\n" n (fibs 0 1 n)))) \endgenerated
produces:
first five primes: 0, 1, 1, 2, 3
When special features, like \var forms, need to be suppressed within a Scheme display, a document can use \schemeverbatim and \endschemeverbatim instead of \schemedisplay and \endschemedisplay. This document makes extensive use of this feature.
The scheme-prep package supports a \transcript command for automatically generating Scheme transcripts from input supplied in the document source. All text from the \transcript marker up to and including the \endtranscript marker is replaced with a transcript generated by supplying the intervening text as the input to a Scheme café (REPL). If the Scheme transcript needs to contain the sequence \endtranscript, a different terminator may be specified as an optional argument to \transcript. The terminator must be a backslash followed by one or more alphabetic characters, and is specified without the backslash in the optional argument.
Three pairs of commands may be redefined to customize the typesetting of different elements within generated transcripts. To modify the typesetting of error messages, redefine \transerr and \endtranserr. To modify the typesetting of user input read from the current input port of the café, redefine \transin and \endtransin. To modify the typesetting of program output written to the current output port of new café, redefine \transout and \endtransout.
For example, the following:
\transcript (define f (lambda (x) ; indentation and comments are (if (zero? x) ; preserved in the transcript 1 (* x (f (- x 1)))))) (values f (f 0) (f 5) (f 20)) (trace f) (f 4) \endtranscript
produces:
> (define f
(lambda (x) ; indentation and comments are
(if (zero? x) ; preserved in the transcript
1
(* x (f (- x 1))))))
> (values f (f 0) (f 5) (f 20))
#<procedure f>
1
120
2432902008176640000
> (trace f)
(f)
> (f 4)
|(f 4)
| (f 3)
| |(f 2)
| | (f 1)
| | |(f 0)
| | |1
| | 1
| |2
| 6
|24
24
The following example shows how to specify a different transcript terminator and shows the default formatting imposed by \transerr, \transin, and \transout.
\transcript[\stopthistranscript] #e4.5 (begin (display "Enter a character: ") (read-char)) (begin (display "Enter a character: ") (read-char))Z (begin (clear-input-port) (display "Enter a character: ") (read-char)) Z (list (read-char) (read-char) (read-char))abc def (define silly-repl (lambda (prompt) (display prompt) (let ([x (read)]) (unless (eof-object? x) (let ([result (eval x)]) (unless (eq? result (void)) (pretty-print result)) (silly-repl prompt)))))) (silly-repl "Enter a Scheme expression: ") (list 1 2 3) (silly-repl "Now what? ") (define interview (lambda () (let* ([fname (begin (display "First name: ") (read))] [lname (begin (display "Last name: ") (read))]) (printf "Hello ~a ~a!~%" fname lname)))) (interview) john doe #!eof (printf "good to be back~%") #!eof \stopthistranscript
produces:
> #e4.5
9/2
> (begin (display "Enter a character: ") (read-char))
Enter a character: #\newline
> (begin (display "Enter a character: ") (read-char))Z
Enter a character: #\Z
> (begin (clear-input-port) (display "Enter a character: ") (read-char))
Enter a character: Z
#\Z
> (list (read-char) (read-char) (read-char))abc def
(#\b #\c #\a)
>
Exception: variable def is not bound
Type (debug) to enter the debugger.
> (define silly-repl
(lambda (prompt)
(display prompt)
(let ([x (read)])
(unless (eof-object? x)
(let ([result (eval x)])
(unless (eq? result (void))
(pretty-print result))
(silly-repl prompt))))))
> (silly-repl "Enter a Scheme expression: ")
Enter a Scheme expression: (list 1
2
3)
(1 2 3)
Enter a Scheme expression: (silly-repl "Now what? ")
Now what? (define interview
(lambda ()
(let* ([fname (begin (display "First name: ") (read))]
[lname (begin (display "Last name: ") (read))])
(printf "Hello ~a ~a!~%" fname lname))))
Now what? (interview)
First name: john
Last name: doe
Hello john doe!
Now what? #!eof
Enter a Scheme expression: (printf "good to be back~%")
good to be back
Enter a Scheme expression: #!eof
Transcripts do not include a trailing prompt by design. This is done in such a way that an explicitly displayed string that happens to look like the prompt is not suppressed. For example:
\transcript (begin (display "> \n") (exit)) \endtranscript
should leave the apparent prompt alone since it is generated as program output.
> (begin (display "> \n") (exit))
>
Prompt suppression works even with changes to waiter-prompt-string. For example:
\transcript (waiter-prompt-string "antelope? ") "no thanks" \endtranscript
produces no trailing "antelope? " prompt:
> (waiter-prompt-string "antelope? ")
antelope? "no thanks"
"no thanks"
The stex commands \schemeinit and \endschemeinit are used to bracket Scheme expressions that should be evaluated without generating a transcript of the results. This is useful, for example, when writing the description of a programming assignment. The solutions can be loaded via \schemeinit and a transcript showing how the solutions behave can be generated using the \transcript command.
For example, the following text:
\schemeinit (waiter-prompt-string ">") ; restore the original prompt setting so we ; don't get "antelope?" as the prompt (define compute-length (lambda (x) (cond [(list? x) (length x)] [(vector? x) (vector-length x)] [(string? x) (string-length x)] [else (errorf 'compute-length "cannot handle ~s" ls)]))) \endschemeinit \emph{The \scheme{compute-length} procedure behaves as follows:} \transcript (compute-length '()) (compute-length '(a b c)) (compute-length "abcd") (compute-length (vector 1 2 3 4 5 6)) (compute-length compute-length) \endtranscript
produces the output shown below.
The compute-length procedure behaves as follows:
> (compute-length '())
0
> (compute-length '(a b c))
3
> (compute-length "abcd")
4
> (compute-length (vector 1 2 3 4 5 6))
6
> (compute-length compute-length)
Exception in compute-length: cannot handle #<procedure compute-length>
Type (debug) to enter the debugger.
the last line of input intentionally causes an error, which is displayed just as it would be displayed in a café.
Support for tables comes with a few caveats:
The following code:
\begin{tabular}{rcl|r} y &=& f(x) & without loss of generality \\ z & \multicolumn{2}{r}{whee} & this is fun? \\ \multicolumn{4}{c}{ \begin{tabular}{cc} 1 & 2 \\ 3 & 4 \end{tabular} } \\ a & b & c & d \\ 12345 & z & \multicolumn{2}{l}{\scheme{(define~x~"foo")}} \end{tabular}
generates this table:
y = f(x) without loss of generality z whee this is fun?
1 2 3 4 a b c d 12345 z (define x "foo")
© 1998-2016 R. Kent Dybvig and Oscar Waddell
stex-1.2.1+git20171204.g5e4f0ca/doc/stex.pdf 0000664 0000000 0000000 00000434773 13211305443 0017634 0 ustar 00root root 0000000 0000000 %PDF-1.5
%
3 0 obj
<<
/Length 2717
/Filter /FlateDecode
>>
stream
xڍYK۸W|1Ue1$gN6[V