Scribble Abbrevs
(require scribble-abbrevs) | package: scribble-abbrevs |
1 General Scribble Utilities
(require scribble-abbrevs/scribble) | |
package: scribble-abbrevs |
procedure
(add-commas r) → string?
r : real?
> (add-commas 42) "42"
> (add-commas 42000) "42,000"
Always use the Oxford comma. Remember the Maine truck drivers! (settlement)
procedure
(format-url url) → element?
url : string?
procedure
(integer->word i [#:title? title?]) → string?
i : exact-integer? title? : boolean? = #false
> (integer->word 0) "zero"
> (integer->word 42) "forty-two"
> (integer->word -8675309) "negative-eight-million-six-hundred-seventy-five-thousand-three-hundred-nine"
The current implementation fails unless (abs i) is less than 1 quadrillion.
procedure
(Integer->word i) → string?
i : exact-integer?
procedure
n : exact-positive-integer?
Wikipedia: roman numeral
> (natural->roman-numeral 2) "II"
> (natural->roman-numeral 4) "IV"
> (natural->roman-numeral 54) "LIV"
> (natural->roman-numeral 101) "CI"
> (natural->roman-numeral 1555) "MDLV"
procedure
x : (or/c string? (listof roman-symbol?))
> (roman-numeral->natural "V") 5
> (roman-numeral->natural "IIII") 4
> (roman-numeral->natural "XLIX") 49
> (roman-numeral->natural "nulla") 0
procedure
n : exact-positive-integer?
> (natural->roman-symbol* 44) '(X L I V)
procedure
(roman-symbol? x) → boolean?
x : any/c
> (roman-symbol? 'I) #t
> (roman-symbol? 'II) #f
> (andmap roman-symbol? '(I V X L C D M)) #t
> (roman-symbol? 17) #f
2 LaTeX Renderer Utilities
(require scribble-abbrevs/latex) | package: scribble-abbrevs |
syntax
syntax
.... end of previous paragraph. |
|
@|noindent|Beginning of un-indented paragraph. |
> (exact "\\frac{2}{3}") (element (style "relax" '(exact-chars)) '("\\frac{2}{3}"))
procedure
(definition term def-elem* ...) → paragraph?
term : string? def-elem* : pre-content?
> (definition "rose" "A rose is a rose is a rose is a rose.")
(paragraph
(style #f '())
(list
(element (style "relax" '(exact-chars)) '("\\vspace{1ex}\n"))
(element 'bold '("Definition"))
(list
(element #f (list " (" (element 'emph '("rose")) ") "))
"A rose is a rose is a rose is a rose.")
(element (style "relax" '(exact-chars)) '("\\vspace{1ex}\n"))))
This usually looks good to me.
procedure
(Section-ref tag) → element?
tag : string?
procedure
(section-ref tag) → element?
tag : string?
NOTE: This function is deprecated; use secref, instead.
Renders the section number for tag prefixed with the word "Section" (respectively, "section").
These functions assume that the following LaTeX command appears somewhere between the definition of Scribble’s SecRef (see Base Latex Macros) and the first occurrence of section-ref:
\renewcommand{\SecRef}[2]{#1} |
3 Documentation Renderer Utilities
(require scribble-abbrevs/manual) | |
package: scribble-abbrevs |
procedure
(tech/guide pre-content ...) → element?
pre-content : pre-content?
procedure
(tech/reference pre-content ...) → element?
pre-content : pre-content?
procedure
(racketfile filename) → element?
filename : path-string?
4 Pict Utilities
(require scribble-abbrevs/pict) | package: scribble-abbrevs |
procedure
(codeblock-pict/numbers code #:title title #:start start #:keep-lang-line? keep-lang) → pict? code : string? title : #f start : 1 keep-lang : #t
> (require scribble-abbrevs/pict)
> (codeblock-pict/numbers (string-join '("#lang racket/base" "(require scribble-abbrevs/pict)" "(codeblock-pict/numbers \"(+ 2 \n3)\")") "\n"))
procedure
(add-border p #:margin-top margin-top #:margin-bottom margin-bottom #:margin-left margin-left #:margin-right margin-right) → pict? p : pict? margin-top : 2 margin-bottom : 2 margin-left : 2 margin-right : 2
See also frame.