7.0

## Scribble Abbrevs

 (require scribble-abbrevs) package: scribble-abbrevs
Helpers for making Scribble documents. The scribble-abbrevs module provides all the bindings documented on this page.

### 1General Scribble Utilities

 (require scribble-abbrevs/scribble) package: scribble-abbrevs
General utilities, for any Scribble document.

 procedure r : real?
Similar to number->string, but adds commas to numbers with more than three digits.

Examples:

 procedure(authors s ...) → (or/c string? element?) s : string?
Renders a sequence of author names (with Oxford comma).

Examples:
 > (authors "Charles Darwin") "Charles Darwin" > (authors "Thomas Jefferson" "Alexander Hamilton") '("Thomas Jefferson" " and " "Alexander Hamilton") > (authors "Ed" "Ed" "Eddy") '("Ed" ", " "Ed" ", and " "Eddy")

 procedure(authors* s*) → element? s* : (listof string?)
 procedure(oxfordize s*) → element? s* : (listof string?)
Same as (apply authors s*).

Always use the Oxford comma. Remember the Maine truck drivers! (settlement)

 procedure(sf x) → element? x : pre-content?
Renders the given content in "sfstyle" (serif-style).

 procedure(parag s ...) → element? s : string?
Renders the given strings as a paragraph title.

 procedure(format-url url) → element? url : string?
Renders a clickable URL. Strips prefixes like "www." and "http://".

 procedure(integer->word i [#:title? title?]) → string? i : exact-nonnegative-integer? title? : boolean? = #false
Returns the English word for the given integer.

Examples:
 > (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 i : exact-nonnegative-integer?
Alias for (integer->word i #:title? #true).

 syntax
 syntax
 syntax
 syntax
 syntax
Each identifier id renders like the string "id", except that it might be prettier (avoid bad line breaks, bad spacing).

### 2LaTeX Renderer Utilities

 (require scribble-abbrevs/latex) package: scribble-abbrevs
Utilities for Scribble code that generates LaTeX output.

 syntax
Typesets \appendix in a paragraph with the 'pretitle style. In LaTeX, this marks the current "section" as the start of an appendix.

 procedure(sc x) → element? x : pre-content?
Renders the given content in small caps style.

 procedure(exact s ...) → element? s : string?
Renders the given strings as-is in the output.

Example:
 > (exact  "\\frac{2}{3}") (element (style "relax" '(exact-chars)) '("\\frac{2}{3}"))

 procedure($s ...) → element? s : string? Same as (exact "$" s ... "\$").

 procedure(definition term def-elem* ...) → paragraph? term : string? def-elem* : pre-content?
Renders an un-numbered definition for a technical term.

Example:
> (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 'italic '("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}

### 3Documentation Renderer Utilities

 (require scribble-abbrevs/manual) package: scribble-abbrevs
Utilities for Scribble code that generates Racket documentation.

 procedure(tech/guide pre-content ...) → element? pre-content : pre-content?
Similar to tech, but links to The Racket Guide.

 procedure(tech/reference pre-content ...) → element? pre-content : pre-content?
Similar to tech, but links to The Racket Reference.

 procedure(racketfile filename) → element? filename : path-string?
Typesets the contents of the given file as if its contents were wrapped in a racketblock.

### 4Pict 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
Similar to codeblock, but with line numbers.

Examples:
> (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
Adds a thin black border around the given pict.