bkyk8rc3zvpnsf5inmcqq4n3k98cv6hj-my-site-hyper-literate-git.test.suzanne.soy-0.0.1

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

config.scrbl (31928B)


      1 #lang scribble/doc
      2 @(require scribble/manual scribble/core scribble/decode
      3           scribble/html-properties scribble/latex-properties
      4           "utils.rkt"
      5           (for-label racket/base
      6                      scribble/latex-prefix))
      7 
      8 @(define (fake-title . str) (apply bold str))
      9 
     10 @(define (css s) (tt s))
     11 @(define spacer @hspace[1])
     12 @(define baseline (style #f '(baseline)))
     13 @(define-syntax-rule (css-table [name desc] ...)
     14    (tabular 
     15     #:style (style #f (list (table-columns (list baseline baseline baseline baseline))))
     16     (list (list spacer name spacer @smaller[desc]) ...)))
     17 
     18 @; ------------------------------------------------------------
     19 
     20 @title[#:tag "config" #:style 'toc]{Extending and Configuring Scribble Output}
     21 
     22 Sometimes, Scribble's primitives and built-in styles are insufficient
     23 to produce the output that you need. The cases in which you need to
     24 extend or configure Scribble fall into two groups:
     25 
     26 @itemize[
     27 
     28  @item{You may need to drop into the back-end ``language'' of CSS or
     29        Latex to create a specific output effect. For this kind of
     30        extension, you will mostly likely attach a
     31        @racket[css-addition] or @racket[tex-addition] @tech{style property}
     32        to style, where the addition implements the style name. This
     33        kind of extension is described in @secref["extra-style"].}
     34 
     35  @item{You may need to produce a document whose page layout is
     36        different from the Racket documentation style. For that
     37        kind of configuration, you can run the @exec{scribble} command-line
     38        tool and supply flags like @DFlag{prefix} or @DPFlag{style}, or
     39        you can associate a @racket[html-defaults] or
     40        @racket[latex-defaults] @tech{style property} to the main document's
     41        style. This kind of configuration is described in
     42        @secref["config-style"].}
     43 
     44 ]
     45 
     46 @local-table-of-contents[]
     47 
     48 @; ------------------------------------------------------------
     49 
     50 @section[#:tag "extra-style" 
     51          #:style (make-style #f (list (make-css-addition "inbox.css")
     52                                       (make-tex-addition "inbox.tex")))
     53         ]{Implementing Styles}
     54 
     55 When a string is used as a style in an @racket[element], 
     56 a @racket[multiarg-element], @racket[paragraph], @racket[table],
     57 @racket[itemization], @racket[nested-flow], or
     58 @racket[compound-paragraph], it corresponds to a CSS class for HTML
     59 output or a Latex macro/environment for Latex output. In Latex output,
     60 the string is used as a command name for a @racket[paragraph]
     61 and an environment name for a @racket[table], @racket[itemization],
     62 @racket[nested-flow], or @racket[compound-paragraph]; if the style has
     63 a @racket['command] @tech{style property} for a @racket[nested-flow] or
     64 @racket[compound-paragraph], then the style name is used as a command
     65 instead of an environment; and if the style has
     66 a @racket['multicommand] @tech{style property} for a @racket[nested-flow],
     67 then the style name is used as a command with multiple arguments.
     68 In addition, for an itemization, the style
     69 string is suffixed with @racket["Item"] and used as a CSS class or Latex
     70 macro name to use for the itemization's items (in place of @ltx{item}
     71 in the case of Latex).
     72 
     73 To add a mapping from your own style name to a CSS configuration, add
     74 a @racket[css-addition] structure instance to a style's @tech{style property}
     75 list. To map a style name to a Latex macro or environment, add a
     76 @racket[tex-addition] structure instance. A @racket[css-addition] or
     77 @racket[tex-addition] is normally associated with the style whose name
     78 is implemented by the addition, but it can also be added to the style
     79 for an enclosing part.
     80 
     81 Scribble includes a number of predefined styles that are used by the
     82 exports of @racket[scribble/base]. You can use them or redefine
     83 them. The styles are specified by @filepath{scribble.css} and
     84 @filepath{scribble.tex} in the @filepath{scribble} collection.
     85 
     86 The styles used by @racketmodname[scribble/manual] are implemented by
     87 @filepath{racket.css} and @filepath{racket.tex} in the
     88 @filepath{scribble} collection. Other libraries, such as
     89 @racketmodname[scriblib/autobib], similarly implement styles through files
     90 that are associated by @racket[css-addition] and @racket[tex-addition]
     91 @tech{style properties}.
     92 
     93 To avoid collisions with future additions to Scribble, start your
     94 style name with an uppercase letter that is not @litchar{S}. An
     95 uppercase letter helps to avoid collisions with macros defined by
     96 Latex packages, and future styles needed by @racketmodname[scribble/base] and
     97 @racketmodname[scribble/manual] will start with @litchar{S}.
     98 
     99 For example, a Scribble document
    100 
    101 @verbatim[#:indent 2]|{
    102  #lang scribble/manual
    103  @(require scribble/core
    104            scribble/html-properties
    105            scribble/latex-properties)
    106 
    107  @(define inbox-style
    108     (make-style "InBox"
    109                 (list (make-css-addition "inbox.css")
    110                       (make-tex-addition "inbox.tex"))))
    111 
    112  @title{Quantum Pet}
    113 
    114  Do not open: @elem[#:style inbox-style]{Cat}
    115 }|
    116 
    117 combined with an @filepath{inbox.css} that contains
    118 
    119 @verbatim[#:indent 2]|{
    120   .InBox {
    121     padding: 0.2em;
    122     border: 1px solid #000000;
    123   }
    124 }|
    125 
    126 and an @filepath{inbox.tex} that contains
    127 
    128 @verbatim[#:indent 2]|{
    129   \newcommand{\InBox}[1]{\fbox{#1}}
    130 }|
    131 
    132 generates
    133 
    134 @nested[#:style 'inset]{
    135  @fake-title{Quantum Pet}
    136 
    137  Do not open: @elem[#:style "InBox"]{Cat}
    138 }
    139 
    140 @index["HTML Tags and Attributes"]{
    141 Scribble documents can also embed specific html tags and
    142 attributes.} For example, this Scribble document:
    143 @codeblock|{
    144 #lang scribble/base
    145 
    146 @(require scribble/core
    147           scribble/html-properties)
    148 
    149 @(define external-image 
    150    (elem
    151     #:style
    152     (style #f
    153            (list (alt-tag "img")
    154                  (attributes
    155                   '((src . "http://racket-lang.org/icon.png")))))))
    156 
    157 @external-image
    158 }|
    159 
    160 renders as the the Racket logo at the url
    161 @url{http://racket-lang.org/logo.png}
    162 when producing html.
    163 
    164 @; ------------------------------------------------------------
    165 
    166 @section[#:tag "config-style"]{Configuring Output}
    167 
    168 The implementation of styles used by libraries depends to some degree
    169 on separately configurable parameters, and configuration is also
    170 possible by replacing style implementations. Latex output is more
    171 configurable in the former way, since a document class determines a
    172 set of page-layout and font properties that are used by other
    173 commands. The style-replacement kind of configuration corresponds to
    174 re-defining Latex macros or overriding CSS class attributes.  When
    175 @exec{raco setup} builds PDF documentation, it uses both kinds of
    176 configuration to produce a standard layout for Racket manuals;
    177 that is, it selects a particular page layout, and it replaces some
    178 @racketmodname[racket/base] styles.
    179 
    180 Two kinds of files implement the two kinds of configuration:
    181 
    182 @itemize[
    183 
    184  @item{A @deftech{prefix file} determines the @tt{DOCTYPE} line for
    185        HTML output or the @ltx{documentclass} configuration (and
    186        perhaps some addition package uses or other configurations) for
    187        Latex output.
    188 
    189        The default prefix files are @filepath{scribble-prefix.html}
    190        and @filepath{scribble-prefix.tex} in the @filepath{scribble}
    191        collection.}
    192 
    193  @item{A @deftech{style file} refines the implementation of styles
    194        used in the document---typically just the ``built-in'' styles
    195        used by @racketmodname[scribble/base].
    196 
    197        The default style files, @filepath{scribble-style.css} and
    198        @filepath{scribble-style.tex} in the @filepath{scribble}
    199        collection, change no style implementations.}
    200 
    201 ]
    202 
    203 For a given configuration of output, typically a particular prefix
    204 file works with a particular style file. Some prefix or style files
    205 may be more reusable. For now, reading the default files is the best
    206 way to understand how they interact. A prefix and/or style file may
    207 also require extra accomanying files; for example, a prefix file for
    208 Latex mode may require a corresponding Latex class file. The default
    209 prefix and style files require no extra files.
    210 
    211 When rendering a document through the @exec{scribble} command-line
    212 tool, use flags to select a prefix file, style file, and additional
    213 accompanying files:
    214 
    215 @itemize[
    216 
    217  @item{Select the prefix file using the @as-index{@DFlag{prefix}}
    218        flag. (Selecting the prefix file also cancels the default list
    219        of accompanying files, if any.)}
    220 
    221  @item{Replace the style file using the @as-index{@DFlag{style}}
    222        flag. Add additional style definitions and re-definitions using
    223        the @as-index{@DPFlag{style}} flag.}
    224 
    225  @item{Add additional accompanying files with @as-index{@DPFlag{extra}}.}
    226 
    227 ]
    228 
    229 When using the @exec{scribble} command-line utility, a document can
    230 declare its default style, prefix, and extra files through a
    231 @racket[html-defaults] and/or @racket[latex-defaults]
    232 @tech{style property}. In particular, when using the @exec{scribble}
    233 command-line tool to generate Latex or PDF a document whose main part
    234 is implemented with @racket[#, @hash-lang[] #,
    235 @racketmodname[scribble/manual]], the result has the standard
    236 Racket manual configuration, because @racketmodname[scribble/manual]
    237 associates a @racket[latex-defaults] @tech{style property} with the exported
    238 document. The @racketmodname[scribble/sigplan] language similarly
    239 associates a default configuration with an exported document.  As
    240 libraries imported with @racket[require], however,
    241 @racketmodname[scribble/manual] and @racketmodname[scribble/sigplan]
    242 simply implement new styles in a composable way.
    243 
    244 Whether or not a document has a default prefix- and style-file
    245 configuration through a @tech{style property}, the defaults can be
    246 overridden using @exec{scribble} command-line flags. Furthermore,
    247 languages like @racketmodname[scribble/manual] and
    248 @racketmodname[scribble/sigplan] add a @racket[html-defaults] and/or
    249 @racket[latex-defaults] @tech{style property} to a main-document part only if
    250 it does not already have such a property added through the
    251 @racket[#:style] argument of @racket[title].
    252 
    253 @; ------------------------------------------------------------
    254 
    255 @section[#:tag "builtin-css"]{Base CSS Style Classes}
    256 
    257 The following renderings of @elem[#:style (style #f (list
    258 (link-resource "demo.scrbl")))]{@filepath{demo.scrbl}} demonstrate all
    259 of the CSS style classes used by @racketmodname[scribble/base] forms and
    260 functions:
    261 
    262 @itemlist[
    263 
    264  @item{@other-doc['(lib "scribblings/scribble/demo-s1.scrbl")] shows
    265        the default style in a single-page rendering without a search
    266        box.}
    267 
    268  @item{@other-doc['(lib "scribblings/scribble/demo-m1.scrbl")] shows
    269        the default style in a multi-page rendering without a search
    270        box.}
    271 
    272  @item{@other-doc['(lib "scribblings/scribble/demo-s2.scrbl")] shows
    273        the current manual style's adjustments in a single-page
    274        rendering with a search box.}
    275 
    276  @item{@other-doc['(lib "scribblings/scribble/demo-m2.scrbl")] shows
    277        the current manual style's adjustments in a multi-page
    278        rendering with a search box.}
    279 
    280 ]
    281 
    282 The style classes:
    283 
    284 @(css-table
    285   [@css{maincolumn} @elem{Outer wrapper for all content in the main column.}]
    286   [@css{main} @elem{Inner wrapper for all content in the main column, including navigation bars.}]
    287 
    288   [@spacer @spacer]
    289 
    290   [@css{refpara} @elem{Outer wrapper for right-hand @racket[margin-note] notes.}]
    291   [@css{refparaleft} @elem{Outer wrapper for left-hand @racket[margin-note] notes.}]
    292   [@css{refelem} @elem{Outer wrapper for right @racket[margin-note*] notes.}]
    293   [@css{refelemleft} @elem{Outer wrapper for left-hand @racket[margin-note*] notes.}]
    294   [@css{refcolumn} @elem{Middle wrapper for right-hand @racket[margin-note] and @racket[margin-note*] notes.}]
    295   [@css{refcolumnleft} @elem{Middle wrapper for left-hand @racket[margin-note] and @racket[margin-note*] notes.}]
    296   [@css{refcontent} @elem{Inner wrapper for @racket[margin-note] and @racket[margin-note*] notes.}]
    297 
    298   [@spacer @spacer]
    299 
    300   [@css{tocset} @elem{Groups table-of-contents panels: main and ``on this page.''}]
    301 
    302   [@spacer @spacer]
    303 
    304   [@css{tocview} @elem{Wraps the main (multi-page mode) or only (single-page mode) table-of-contents panel.}]
    305   [@css{tocviewlist} @elem{A hierarchical layer of content in a main table-of-contents panel.}]
    306   [@css{tocviewlisttopspace} @elem{With @css{tocviewlist} for the first layer.}]
    307   [@css{tocviewtoggle} @elem{The always-visible name of a layer.}]
    308   [@css{tocviewtitle} @elem{With @css{tocviewtoggle} for the first layer.}]
    309   [@css{tocviewsublist} @elem{An item in a layer that has multiple items and more items before and after.}]
    310   [@css{tocviewsublistonly} @elem{An item in a single-item layer.}]
    311   [@css{tocviewsublisttop} @elem{The first item in a multi-item layer.}]
    312   [@css{tocviewsublistbottom} @elem{The last item in a multi-item layer.}]
    313   [@css{tocviewlink} @elem{Inner wrapper for an item in a layer when linked to a different page.}]
    314   [@css{tocviewselflink} @elem{Inner wrapper for every item in a layer when linked to the same page.}]
    315 
    316   [@spacer @spacer]
    317 
    318   [@css{tocsub} @elem{Wraps the ``on this page'' (multi-page mode only) table-of-contents panel.}]
    319   [@css{tocsubtitle} @elem{Wraps the words ``on this page''.}]
    320   [@css{tocsublist} @elem{Inner table for the ``on this page'' panel.}]
    321   [@css{tocsublinknumber} @elem{Number for an entry in an ``on this page'' panel.}]
    322   [@css{tocsubseclink} @elem{Title for a @emph{section} entry in an ``on this page'' panel.}]
    323   [@css{tocsubnonseclink} @elem{Title for a @emph{non-section} entry in an ``on this page'' panel
    324                                  that has some section links.}]
    325   [@css{tocsublink} @elem{Title for a @emph{non-section} entry in an ``on this page'' panel
    326                                  that has no section links.}]
    327 
    328   [@css{toctoplink} @elem{Top-level entry in an inline (not the panel) table of contents.}]
    329   [@css{toclink} @elem{Nested entry in an inline (not the panel) table of contents.}]
    330 
    331   [@spacer @spacer]
    332 
    333   [@css{versionbox} @elem{Outer wrapper for version}]
    334   [@css{version} @elem{Inner wrapper for version in the case of search box and/or navigation.}]
    335   [@css{versionNoNav} @elem{Inner wrapper for version in the case of no search box and navigation.}]
    336 
    337   [@spacer @spacer]
    338 
    339   [@css{SAuthorListBox} @elem{Outer wrapper for the author list.}]
    340   [@css{SAuthorList} @elem{Inner wrapper for the author list.}]
    341   [@css{author} @elem{Wrapper for an individual author.}]
    342 
    343   [@spacer @spacer]
    344 
    345   [@css{navsettop} @elem{Wraps the top navigation bar (in multi-page mode or when a search bar is present).}]
    346   [@css{navsetbottom} @elem{Wraps the bottom navigation bar (in multi-page mode or when a search bar is present).}]
    347   [@css{navleft} @elem{Wraps left-side elements within a navigation bar.}]
    348   [@css{navright} @elem{Wraps right-side elements within a navigation bar.}]
    349   [@css{nonavigation} @elem{Disabled links within a navigation bar.}]
    350   [@css{searchform} @elem{Outer wrapper for a search box within the top navigation bar.}]
    351   [@css{searchbox} @elem{Inner wrapper for a search box within the top navigation bar.}]
    352   [@css{nosearchform} @elem{Takes the place of an absent search box within the top navigation bar.}]
    353 
    354   [@spacer @spacer]
    355 
    356   [@css{SSubSubSubSection} @elem{Deeply nested subsection (below @tt{<h5>}).}]
    357 
    358   [@spacer @spacer]
    359 
    360   [@css{SIntrapara} @elem{Used with @tt{<div>} instead of @tt{<p>} for a paragraph
    361                        within a @racket[compound-paragraph].}]
    362 
    363   [@spacer @spacer]
    364 
    365   [@css{SubFlow} @elem{For a @racket[nested-flow] with no style name: no inset.}]
    366   [@css{SCodeFlow} @elem{For a @racket[nested-flow] with the @racket['code-inset] style name:
    367                           inset suitable for code.}]
    368   [@css{SVInsetFlow} @elem{For a @racket[nested-flow] with the @racket['vertical-inset] style name:
    369                           add space before and after suitable for code.}]
    370   [@css{SCentered} @elem{For a @racket[nested-flow] created by @racket[centered]: horizontally
    371                           centered.}]
    372   [@css{SVerbatim} @elem{For a @racket[table] created by @racket[verbatim]: disables line breaks.}]
    373 
    374   [@spacer @spacer]
    375 
    376   [@css{boxed} @elem{For a @racket[table] with the @racket['boxed] style name: as a definition box.}]
    377 
    378   [@spacer @spacer]
    379 
    380   [@css{compact} @elem{For an @racket[itemlist] with the @racket['compact] style name.}]
    381 
    382   [@spacer @spacer]
    383 
    384   [@css{techoutside} @elem{Outer wrapper for a technical-term reference.}]
    385   [@css{techinside} @elem{Inner wrapper for a technical-term reference.}]
    386 
    387   [@spacer @spacer]
    388 
    389   [@css{indexlink} @elem{For an entry in the index.}]
    390 
    391   [@spacer @spacer]
    392 
    393   [@css{stt} @elem{Fixed-width text.}]
    394   [@css{sroman} @elem{Serif text.}]
    395   [@css{ssanserif} @elem{Sans serif text.}]
    396   [@css{slant} @elem{Oblique (as opposed to italic) text.}]
    397   [@css{Smaller} @elem{Smaller text (as created by @racket[smaller]).}]
    398   [@css{Larger} @elem{Smaller text (as created by @racket[larger]).}]
    399   [@css{hspace} @elem{For whitespace produced by @racket[hspace].}]
    400   [@css{nobreak} @elem{Disable link breaks.}]
    401   [@css{badlink} @elem{Broken cross-reference.}]
    402   [@css{plainlink} @elem{Hyperlink without an underline.}])
    403 
    404 In addition, the @css{SIEHidden} style class is built in to all
    405 Scribble HTML output to hide an element on Internet Explorer 6.
    406 
    407 @; ------------------------------------------------------------
    408 
    409 @section[#:tag "manual-css"]{Manual CSS Style Classes}
    410 
    411 The following renderings of @elem[#:style (style #f (list
    412 (link-resource "demo-manual.scrbl")))]{@filepath{demo-manual.scrbl}}
    413 demonstrate all of the CSS style classes used by
    414 @racketmodname[scribble/manual] forms and functions in addition to the
    415 @seclink["builtin-css"]{base style classes}.
    416 
    417 @itemlist[
    418 
    419  @item{@other-doc['(lib "scribblings/scribble/demo-manual-s1.scrbl")] shows
    420        the original style in a single-page rendering without a search
    421        box.}
    422 
    423  @item{@other-doc['(lib "scribblings/scribble/demo-manual-m1.scrbl")] shows
    424        the original style in a multi-page rendering without a search
    425        box.}
    426 
    427  @item{@other-doc['(lib "scribblings/scribble/demo-manual-s2.scrbl")] shows
    428        the current manual style's adjustments in a single-page
    429        rendering with a search box.}
    430 
    431  @item{@other-doc['(lib "scribblings/scribble/demo-manual-m2.scrbl")] shows
    432        the current manual style's adjustments in a multi-page
    433        rendering with a search box.}
    434 
    435 ]
    436 
    437 The style classes:
    438 
    439 @(css-table
    440   [@css{RktSym} @elem{Identifiers with no @racket[for-label] binding.}]
    441   [@css{RktValLink} @elem{Identifier with @racket[for-label] binding to a variable definition.}]
    442   [@css{RktValDef} @elem{Definition site of a variable, normally combined with @css{RktValLink}.}]
    443   [@css{RktStxLink} @elem{Identifier with @racket[for-label] binding to a syntactic-form definition.}]
    444   [@css{RktStxDef} @elem{Definition site of a syntactic form, normally combined with @css{RktStxLink}.}]
    445   [@css{RktSymDef} @elem{Definition site of an identifier without binding (normally a mistake), combined with @css{RktSym}.}]
    446   [@css{RktVar} @elem{Local variable or meta-variable.}]
    447   [@css{RktRes} @elem{REPL result.}]
    448   [@css{RktOut} @elem{Output written to the current output port.}]
    449   [@css{RktErr} @elem{Output written to the current error port.}]
    450   [@css{RktCmt} @elem{A comment in Racket code.}]
    451   [@css{RktVal} @elem{A literal value in Racket code.}]
    452   [@css{RktPn} @elem{Parentheses, keywords, and similar delimiters in Racket code.}]
    453   [@css{RktRdr} @elem{Reader shorthands in Racket code, except for commas.}]
    454   [@css{RktMeta} @elem{An unquoting comma in Racket code.}]
    455   [@css{highlighted} @elem{Hilighlted code (via @racket[code:highlight] in @racket[racketblock], for example).}]
    456   [@css{RktIn} @elem{Foreground for literal characters written with @racket[litchar].}]
    457   [@css{RktInBG} @elem{Background for literal characters written with @racket[litchar].}]
    458   [@css{RktModLink} @elem{A module name linked to the module's definition.}]
    459   [@css{RktMod} @elem{A module name (normally @css{RktModLink}, instead).}]
    460   [@css{RktKw} @elem{A ``keyword;'' not normally used.}]
    461   [@css{RktOpt} @elem{Brackets for optional arguments (in function definitions).}]
    462 
    463   [@spacer @spacer]
    464 
    465   [@css{RktBlk} @elem{Wrapper for multi-linke Racket code blocks.}]
    466 
    467   [@spacer @spacer]
    468 
    469   [@css{defmodule} @elem{Module definition block.}]
    470   [@css{RpackageSpec} @elem{Package specification within a module-definition block.}]
    471 
    472   [@spacer @spacer]
    473 
    474   [@css{RBoxed} @elem{Definition block; always combined with @css{boxed}.}]
    475   [@css{together} @elem{Table within a @racket[together] grouping.}]
    476   [@css{RBackgroundLabel} @elem{Wrapper for ``procedure,'' ``syntax,'' etc., backing in a definition box.}]
    477   [@css{RBackgroundLabelInner} @elem{Wrapper within @css{RBackgroundLabel}.}]
    478   [@css{RForeground} @elem{Wrapper for element to appear over a @css{RBackgroundLabel}.}]
    479   [@css{prototype} @elem{Wrapper for a multi-line procedure-definition prototype.}]
    480   [@css{argcontract} @elem{Wrapper for a multi-line argument contract and default value.}]
    481   [@css{specgrammar} @elem{Wrapper for a grammar with a syntactic-form definition box.}]
    482   [@css{inherited} @elem{Wrapper for a margin ``inherited methods'' table.}]
    483   [@css{inheritedlbl} @elem{Wrapper for ``Inherited methods:'' and ``from'' labels.}]
    484 
    485   [@spacer @spacer]
    486 
    487   [@css{leftindent} @elem{Left-indented block, such as form @racket[specsubform].}]
    488   [@css{insetpara} @elem{Inset block.}]
    489 
    490   [@spacer @spacer]
    491 
    492   [@css{Rfilebox} @elem{Wrapper for a file box (via @racket[filebox]),}]
    493   [@css{Rfiletitle} @elem{Outer wrapper for a file box title.}]
    494   [@css{Rfilename} @elem{Inner wrapper for a file box title.}]
    495   [@css{Rfilecontent} @elem{Wrapper for file box content.}]
    496 
    497   [@spacer @spacer]
    498 
    499   [@css{SHistory} @elem{Wrapper for @racket[history] paragraphs.}]
    500 
    501   [@spacer @spacer]
    502 
    503   [@css{RBibliography} @elem{Wrapper for a @racket[bibliography] section.}])
    504 
    505 @; ------------------------------------------------------------
    506 
    507 @section[#:tag "builtin-latex"]{Base Latex Macros}
    508 
    509 The @filepath{scribble.tex} Latex configuration includes several
    510 macros and environments that you can redefine to adjust the output
    511 style:
    512 
    513 @itemlist[
    514 
    515  @item{@ltxd[0]{preDoc} --- called before the document content; the 
    516        default does nothing, while the @racketmodname[scribble/manual]
    517        configuration enabled @ltx{sloppy}.}
    518 
    519  @item{@ltxd[0]{postDoc} --- called after the document content; the 
    520        default does nothing.}
    521 
    522  @item{A set of commands that control the basic set of Latex packages that are loaded:
    523   @itemlist[@item{@ltxd[0]{packageGraphicx}, defaults to @tt{\usepackage{graphicx}}}
    524             @item{@ltxd[0]{packageHyperref}, defaults to @tt{\usepackage{hyperref}}}
    525             @item{@ltxd[0]{renewrmdefault}, defaults to @tt{\renewcommand{\rmdefault}{ptm}}}
    526             @item{@ltxd[0]{packageRelsize}, defaults to @tt{\usepackage{relsize}}}
    527             @item{@ltxd[0]{packageAmsmath}, defaults to @tt{\usepackage{amsmath}}}
    528             @item{@ltxd[0]{packageMathabx}, defaults to @tt{\usepackage{mathabx}}}
    529             @item{@ltxd[0]{packageWasysym}, defaults to @tt{\let\leftmoon\relax \let\rightmoon\relax \let\fullmoon\relax \let\newmoon\relax \let\diameter\relax \usepackage[nointegrals]{wasysym}}}
    530             @item{@ltxd[0]{packageTxfonts}, defaults to @tt{\let\widering\relax \usepackage{newtxmath}}}
    531             @item{@ltxd[0]{packageTextcomp}, defaults to @tt{\usepackage{textcomp}}}
    532             @item{@ltxd[0]{packageFramed}, defaults to @tt{\usepackage{framed}}}
    533             @item{@ltxd[0]{packageHyphenat}, defaults to @tt{\usepackage[htt]{hyphenat}}}
    534             @item{@ltxd[0]{packageColor}, defaults to @tt{\usepackage[usenames,dvipsnames]{color}}}
    535             @item{@ltxd[0]{doHypersetup}, defaults to @tt{\hypersetup{bookmarks=true,bookmarksopen=true,bookmarksnumbered=true}}}
    536             @item{@ltxd[0]{packageTocstyle}, defaults to @tt{\IfFileExists{tocstyle.sty}{\usepackage{tocstyle}\usetocstyle{standard}}{}}}
    537             @item{@ltxd[0]{packageCJK}, defaults to @tt{\IfFileExists{CJK.sty}{\usepackage{CJK}}{}}}]
    538   @history[#:changed "1.36" @list{Added @ltx{packageTxfonts}}]
    539   @history[#:changed "1.37" @list{
    540               Added @ltx{packageAmsmath};
    541               changed @ltx{packageWasysym} to use @tt{nointegrals} option;
    542               changed @ltx{packageTxfonts} to load @tt{newtxmath}.
    543               Note that documents could look different due to
    544               the new @tt{wasysym} option and the inclusion of @tt{newtxmath}.
    545               See @hyperlink["https://github.com/racket/scribble/pull/274"]{
    546               racket/scribble#274} for examples.}]}
    547 
    548  @item{@ltxd[0]{sectionNewpage} --- called before each top-level
    549        section starts; the default does nothing, while the
    550        @racketmodname[scribble/manual] configuration uses
    551        @ltx{newpage} to start each chapter on a new page.}
    552 
    553  @item{@ltxd[3]{SecRefLocal} --- the first argument is a Latex label,
    554        the second argument is a section number, and the third argument
    555        is a section title. This macro is used by @racket[secref] to
    556        reference a section (other than a document or top-level section
    557        within a document) that has a number and that is local to the
    558        current document. The default expands to @ltx{SecRef}, passing
    559        along just the second and third arguments (so that the label is
    560        ignored).}
    561 
    562  @item{@ltxd[2]{SecRef} --- like @ltx{SecRefLocal}, but used when the
    563        referenced section is in a different document, so that no label
    564        is available. The default shows ``section'' followed by the
    565        section number (ignoring the title). The
    566        @racketmodname[scribble/manual] redefinition of this macro
    567        shows ``ยง'', the section number, and the title in quotes.}
    568 
    569  @item{@ltxd[3]{ChapRefLocal} and @ltxd[2]{ChapRef} --- like
    570        @ltx{SecRefLocal} and @ltx{SecRef}, but for a top-level section
    571        within a document. The default implementation defers to
    572        @ltx{SecRefLocal} or @ltx{SecRef}.}
    573 
    574  @item{@ltxd[3]{PartRefLocal} and @ltxd[2]{PartRef} --- like
    575        @ltx{SecRefLocal} and @ltx{SecRef}, but for a top-level section
    576        within a document whose part has the @racket['grouper] style
    577        property. The default @ltx{PartRef} shows ``part'' followed by
    578        the section number (ignoring the title).}
    579 
    580  @item{@ltxd[3]{BookRefLocal} and @ltxd[2]{BookRef} --- like
    581        @ltx{SecRefLocal} and @ltx{SecRef}, but for a document (as
    582        opposed to a section within the document). The default
    583        @ltx{BookRef} implementation shows the title in italic.}
    584 
    585  @item{@ltxd[3]{SecRefLocalUC} and @ltxd[2]{SecRefUC} --- like
    586        @ltx{SecRefLocal} and @ltx{SecRef}, but for @racket[Secref].
    587        The default @ltx{SecRefUC} shows ``Section'' followed by the
    588        section number.}
    589 
    590  @item{@ltxd[3]{ChapRefLocalUC} and @ltxd[2]{ChapRefUC} --- like
    591        @ltx{ChapRefLocal} and @ltx{ChapRef}, but for
    592        @racket[Secref]. The default @ltx{ChapRefUC}implementation
    593        defers to @ltx{SecRefUC}.}
    594 
    595  @item{@ltxd[3]{PartRefLocalUC} and @ltxd[2]{PartRefUC} --- like
    596        @ltx{PartRefLocal} and @ltx{PartRef}, but for @racket[Secref].
    597        The default @ltx{PartRefUC} shows ``Part'' followed by the
    598        section number.}
    599 
    600  @item{@ltxd[3]{BookRefLocalUC} and @ltxd[2]{BookRefUC} --- like
    601        @ltx{BookRefLocal} and @ltx{BookRef}, but for @racket[Secref].
    602        The default @ltx{BookRefUC} defers to @ltx{BookRef}.}
    603 
    604  @item{@ltxd[2]{SecRefLocalUN}, @ltxd[1]{SecRefUCUN},
    605        @ltxd[2]{SecRefLocalUCUN}, @ltxd[1]{SecRefUN},
    606        @ltxd[2]{PartRefLocalUN}, @ltxd[1]{PartRefUN},
    607        @ltxd[2]{PartRefLocalUCUN}, @ltxd[1]{PartRefUCUN},
    608        @ltxd[2]{BookRefLocalUN}, @ltxd[1]{BookRefUN},
    609        @ltxd[2]{BookRefLocalUCUN}, @ltxd[1]{BookRefUCUN},
    610        @ltxd[2]{ChapRefLocalUN}, @ltxd[1]{ChapRefUN},
    611        @ltxd[2]{ChapRefLocalUCUN}, and @ltxd[1]{ChapRefUCUN} --- like
    612        @ltx{SecRefLocal}, etc., but in the case that a
    613        section/part/chapter number is unavailable. The default
    614        implementation of @ltx{BookRefUN} uses @ltx{BookRef} with an
    615        empty first argument. The default @ltx{SecRefLocalUN} expands
    616        to its second argument in quotes followed by ``on page'' as a
    617        @ltx{pageref} using the first argument, while the default
    618        @ltx{SecRefUN} expands to its only argument in quotes. The
    619        default @ltx{PartRef} and @ltx{ChapRef} variants expand to the
    620        corresponding @ltx{SecRef} variant.}
    621 
    622  @item{@ltxd[2]{Ssection}, @ltxd[2]{Ssubsection},
    623         @ltxd[2]{Ssubsubsection}, @ltxd[2]{Ssubsubsubsection},
    624         @ltxd[2]{Ssubsubsubsubsection} --- for a top-level section, a
    625         second-level section, etc., where the last variant is used for
    626         all sections that are deeper than four levels. The first
    627         argument corresponds to the optional argument to
    628         @ltx{section}, which is used for the table of contents.}
    629 
    630  @item{@ltxd[1]{Ssectionstar}, @ltxd[1]{Ssubsectionstar},
    631         @ltxd[1]{Ssubsubsectionstar}, @ltxd[1]{Ssubsubsubsectionstar},
    632         @ltxd[1]{Ssubsubsubsubsectionstar} --- like @ltx{Ssection},
    633         etc., but for unnumbered sections that are omitted from the
    634         table of contents.}
    635 
    636  @item{@ltxd[2]{Ssectionstarx}, @ltxd[1]{Ssubsectionstarx},
    637         @ltxd[2]{Ssubsubsectionstarx},
    638         @ltxd[2]{Ssubsubsubsectionstarx},
    639         @ltxd[2]{Ssubsubsubsubsectionstarx} --- like @ltx{Ssection},
    640         etc., but for unnumbered sections (that nevertheless appear in
    641         the table of contents).}
    642 
    643  @item{@ltxd[0]{Sincsection}, @ltxd[0]{Sincsubsection},
    644        @ltxd[0]{Sincsubsubsection}, @ltxd[0]{Sincsubsubsubsection},
    645        @ltxd[0]{Sincsubsubsubsubsection} --- increments the section
    646        counter.}
    647 
    648  @item{@ltxd[2]{Spart}, @ltxd[1]{Spartstar}, @ltxd[2]{Spartstarx},
    649        @ltxd[0]{Sincpart} --- like the section commands, but used for
    650        in place of @ltxd[2]{Ssection}, @ltxd[1]{Ssectionstar}, @|etc|
    651        for a part with the @racket['grouper] style property.}
    652 
    653  @item{@ltxe{SInsetFlow} environment --- for a @racket[nested-flow]
    654        with the @racket['inset] style name.}
    655 
    656  @item{@ltxe{SCodeFlow} environment --- for a @racket[nested-flow]
    657        with the @racket['code-inset] style name.}
    658 
    659  @item{@ltxe{SVInsetFlow} environment --- for a @racket[nested-flow]
    660             with the @racket['vertical-inset] style name.}
    661 
    662  @item{@ltxe{SVerbatim} environment --- for a @racket[table] created
    663             by @racket[verbatim].}
    664 
    665  @item{@ltxd[1]{SCodeBox}, @ltxd[1]{SVInsetBox} --- for a
    666        @racket[nested-flow] with the @racket['code-inset] or
    667        @racket['vertical-inset] style name, respectively, and as the
    668        content of a table cell. The content is installed into a TeX
    669        box using @tt{\setbox1}.}
    670 
    671  ]
    672 
    673 Additionally, the @filepath{racket.tex} Latex configuration
    674 includes several macros that you can redefine to adjust the
    675 output style of Racket code:
    676 
    677 @itemlist[
    678  @item{@ltxd[2]{SColorize} --- Sets the color scheme of
    679   Racket code. Can be redefined to create black and white
    680   code. The first argument is the requested color, and the
    681   second argument is the text for that color.}
    682  @item{@ltxd[1]{SHyphen} --- Enables or Disables the ability
    683   for identifiers and keywords in Racket code from being
    684   hyphenated. Defaults to enabled (for compatibility).
    685   Redefine to disable or change the hyphenation behavior. For
    686   example, to cause the text to overfill rather than hyphen,
    687   it can be redefined to:
    688   @tt["\\renewcommand{\\SHyphen}[1]{\\mbox{#1}}"]. The first
    689   argument is an identifier or keyword inside of a code
    690   block.}]
    691 
    692 @; ------------------------------------------------------------
    693 
    694 @section[#:tag "latex-prefix"]{Latex Prefix Support}
    695 
    696 @defmodule[scribble/latex-prefix]{Provides a string that is useful for
    697 constructing a Latex document prefix.}
    698 
    699 @defthing[unicode-encoding-packages string?]{
    700 
    701 A string containing Latex code that is useful after a
    702 @tt{\documentclass} declaration to make Latex work with Unicode
    703 characters.}