Scribble + LaTeX utils
This library provides support for an assortment of LaTeX environments, particularly for mathematics rendering. Most of these functions/macros render LaTeX strings rather than use Scribbleβs elements to get the same effect. This is primarily because brackets are not supported (for rendering tabular environments, say). These strings are wrapped in a LaTeX identity macro, and lead to some nasty interop with environments that parse their bodies, such as mathpar (from mathpartir) and lstlisting (from listings). Thus this collection of utils supports some of those special environments specifically.
1 Unicode Translation
(require latex-utils/scribble/unmap) | package: latex-utils |
value
value
(Ξ» (c str i) (values (format "\\hat{~a}{}" (in-math (translate-char c))) (+ i 1)))
value
procedure
(content->latex-content e [ #:operators ophash]) β content? e : content? ophash : operators/c = default-ops
procedure
(translate-char c) β string?
c : char?
procedure
(overload-op* key value ... ...) β operators/c
key : char? value : operator/c
2 Math utilities
(require latex-utils/scribble/math) | package: latex-utils |
3 General utilities
(require latex-utils/scribble/utils) | package: latex-utils |
procedure
(exact [#:operators operators] item ...) β content?
operators : operators/c = default-ops item : content?
This Unicode translation does not play nicely with delayed-element? or part-relative-element? since I donβt know how to correctly wrap these to do the translation.
procedure
(renewcommand left right) β content?
left : content? right : content?
struct
(struct bracket (element) #:extra-constructor-name make-bracket) element : content?
struct
(struct curlies (element) #:extra-constructor-name make-curlies) element : content?
struct
(struct parens (element) #:extra-constructor-name make-parens) element : content?
procedure
(env t [#:opt optional] items ...) β content?
t : content? optional : (listof (or/c brackets? curlies? parens?)) = '() items : content?
procedure
(tenv t title items ...) β content?
t : content? title : content? items : content?
4 Theorem utilities
(require latex-utils/scribble/theorem) | |
package: latex-utils |
This section provides theorem and proof tools from amsthm.
procedure
(mdef title #:tag tag items ...) β content?
title : content? tag : (or/c content? #f) items : content?
procedure
(mthm title #:tag tag items ...) β content?
title : content? tag : (or/c content? #f) items : content?
procedure
(mlem title #:tag tag items ...) β content?
title : content? tag : (or/c content? #f) items : content?
procedure
(mprop title #:tag tag items ...) β content?
title : content? tag : (or/c content? #f) items : content?
procedure
(mcor title #:tag tag items ...) β content?
title : content? tag : (or/c content? #f) items : content?
procedure
(mnotation title #:tag tag items ...) β content?
title : content? tag : (or/c content? #f) items : content?
procedure
title : content? tag : (or/c content? #f) items : content?
procedure
(tprf title items ...) β content?
title : content? items : content?
procedure
(ntthm items ...) β content?
items : content?
procedure
(ntlem items ...) β content?
items : content?
procedure
(ntprf items ...) β content?
items : content?
procedure
(parthm title #:tag tag items ...) β content?
title : content? tag : (or/c content? #f) items : content?
procedure
(parlem title #:tag tag items ...) β content?
title : content? tag : (or/c content? #f) items : content?
procedure
(parprop title #:tag tag items ...) β content?
title : content? tag : (or/c content? #f) items : content?
procedure
title : content? tag : (or/c content? #f) items : content?
procedure
(parprf #:tag tag items ...) β content?
tag : (or/c content? #f) items : content?
5 listings utilities
procedure
(lstlisting #:math-escape? math-escape? items ...) β content? math-escape? : #f items : content?
procedure
(lstset [ #:basicstyle basicstyle #:keywordstyle keywordstyle #:identifierstyle identifierstyle #:commentstyle commentstyle #:stringstyle stringstyle #:showstringspaces showstringspaces #:numbers numbers #:numberstyle numberstyle #:numberblanklines numberblanklines #:stepnumber stepnumber #:numbersep numbersep #:backgroundcolor backgroundcolor #:showspaces showspaces #:showtabs showtabs #:frame frame #:label label #:rulecolor rulecolor #:tabsize tabsize #:language language #:caption caption #:captionpos captionpos #:breaklines breaklines #:breakatwhitespace breakatwhitespace #:title title #:escapeinside escapeinside #:morekeywords morekeywords #:moredelim moredelim #:xleftmargin xleftmargin #:xrightmargin xrightmargin]) β content? basicstyle : (or/c content? #f) = #f keywordstyle : (or/c content? #f) = #f identifierstyle : (or/c content? #f) = #f commentstyle : (or/c content? #f) = #f stringstyle : (or/c content? #f) = #f showstringspaces : (or/c content? #f) = #f numbers : (or/c content? #f) = #f numberstyle : (or/c content? #f) = #f numberblanklines : (or/c content? #f) = #f stepnumber : (or/c content? #f) = #f numbersep : (or/c content? #f) = #f backgroundcolor : (or/c content? #f) = #f showspaces : (or/c content? #f) = #f showtabs : (or/c content? #f) = #f frame : (or/c content? #f) = #f label : (or/c content? #f) = #f rulecolor : (or/c content? #f) = #f tabsize : (or/c content? #f) = #f language : (or/c content? #f) = #f caption : (or/c content? #f) = #f captionpos : (or/c content? #f) = #f breaklines : (or/c content? #f) = #f breakatwhitespace : (or/c content? #f) = #f title : (or/c content? #f) = #f escapeinside : (or/c content? #f) = #f morekeywords : (or/c content? #f) = #f moredelim : (or/c content? #f) = #f xleftmargin : (or/c content? #f) = #f xrightmargin : (or/c content? #f) = #f
6 mathpartir utilities
syntax
(mathpar items ...)
7 pfsteps utilities
Jesse Tov has an excellent LaTeX package for typesetting rigorous proofs.. Given his pfsteps package is included in the extra style latex file, you can use the following forms to interact with it.
procedure
(byCases items ...) β content?
items : content?
syntax
(bc-case title items ...)
procedure
(bc-otherwise items ...) β content?
items : content?
8 Miscellaneous
Random stuff I threw in for papers.
procedure
(graybox elm) β content?
elm : content?