/usr/share/doc/racket/scribble/getting-started.html is in racket-doc 6.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>1 Getting Started</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">▼</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Scribble:<span class="mywbr"> </span> The Racket Documentation Tool</a></td></tr></table></div><div class="tocviewsublisttop" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Getting Started</a></td></tr><tr><td align="right">2 </td><td><a href="reader.html" class="tocviewlink" data-pltdoc="x">@ Syntax</a></td></tr><tr><td align="right">3 </td><td><a href="generic-prose.html" class="tocviewlink" data-pltdoc="x">High-<wbr></wbr>Level Scribble API</a></td></tr><tr><td align="right">4 </td><td><a href="plt-manuals.html" class="tocviewlink" data-pltdoc="x">Scribbling Documentation</a></td></tr><tr><td align="right">5 </td><td><a href="lp.html" class="tocviewlink" data-pltdoc="x">Literate Programming</a></td></tr><tr><td align="right">6 </td><td><a href="internals.html" class="tocviewlink" data-pltdoc="x">Low-<wbr></wbr>Level Scribble API</a></td></tr><tr><td align="right">7 </td><td><a href="running.html" class="tocviewlink" data-pltdoc="x">Running <span class="stt">scribble</span></a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_1");">►</a></td><td>1 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Getting Started</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">1.1 </td><td><a href="#%28part._first-example%29" class="tocviewlink" data-pltdoc="x">A First Example</a></td></tr><tr><td align="right">1.2 </td><td><a href="#%28part._.Multiple_.Sections%29" class="tocviewlink" data-pltdoc="x">Multiple Sections</a></td></tr><tr><td align="right">1.3 </td><td><a href="#%28part._.Splitting_the_.Document_.Source%29" class="tocviewlink" data-pltdoc="x">Splitting the Document Source</a></td></tr><tr><td align="right">1.4 </td><td><a href="#%28part._.Document_.Styles%29" class="tocviewlink" data-pltdoc="x">Document Styles</a></td></tr><tr><td align="right">1.5 </td><td><a href="#%28part._.More_.Functions%29" class="tocviewlink" data-pltdoc="x">More Functions</a></td></tr><tr><td align="right">1.6 </td><td><a href="#%28part._.Text_.Mode_vs__.Racket_.Mode_for_.Arguments%29" class="tocviewlink" data-pltdoc="x">Text Mode vs. Racket Mode for Arguments</a></td></tr><tr><td align="right">1.7 </td><td><a href="#%28part._how-to~3areader%29" class="tocviewlink" data-pltdoc="x">@ Syntax Basics</a></td></tr><tr><td align="right">1.8 </td><td><a href="#%28part._.Decoding_.Sequences%29" class="tocviewlink" data-pltdoc="x">Decoding Sequences</a></td></tr><tr><td align="right">1.9 </td><td><a href="#%28part._pictures%29" class="tocviewlink" data-pltdoc="x">Pictures</a></td></tr><tr><td align="right">1.10 </td><td><a href="#%28part._roadmap%29" class="tocviewlink" data-pltdoc="x">Next Steps</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">1.1<tt> </tt></span><a href="#%28part._first-example%29" class="tocsubseclink" data-pltdoc="x">A First Example</a></td></tr><tr><td><span class="tocsublinknumber">1.2<tt> </tt></span><a href="#%28part._.Multiple_.Sections%29" class="tocsubseclink" data-pltdoc="x">Multiple Sections</a></td></tr><tr><td><span class="tocsublinknumber">1.3<tt> </tt></span><a href="#%28part._.Splitting_the_.Document_.Source%29" class="tocsubseclink" data-pltdoc="x">Splitting the Document Source</a></td></tr><tr><td><span class="tocsublinknumber">1.4<tt> </tt></span><a href="#%28part._.Document_.Styles%29" class="tocsubseclink" data-pltdoc="x">Document Styles</a></td></tr><tr><td><span class="tocsublinknumber">1.5<tt> </tt></span><a href="#%28part._.More_.Functions%29" class="tocsubseclink" data-pltdoc="x">More Functions</a></td></tr><tr><td><span class="tocsublinknumber">1.5.1<tt> </tt></span><a href="#%28part._.Centering%29" class="tocsubseclink" data-pltdoc="x">Centering</a></td></tr><tr><td><span class="tocsublinknumber">1.5.2<tt> </tt></span><a href="#%28part._.Margin_.Notes%29" class="tocsubseclink" data-pltdoc="x">Margin Notes</a></td></tr><tr><td><span class="tocsublinknumber">1.5.3<tt> </tt></span><a href="#%28part._.Itemizations%29" class="tocsubseclink" data-pltdoc="x">Itemizations</a></td></tr><tr><td><span class="tocsublinknumber">1.5.4<tt> </tt></span><a href="#%28part._.Tables%29" class="tocsubseclink" data-pltdoc="x">Tables</a></td></tr><tr><td><span class="tocsublinknumber">1.6<tt> </tt></span><a href="#%28part._.Text_.Mode_vs__.Racket_.Mode_for_.Arguments%29" class="tocsubseclink" data-pltdoc="x">Text Mode vs. Racket Mode for Arguments</a></td></tr><tr><td><span class="tocsublinknumber">1.7<tt> </tt></span><a href="#%28part._how-to~3areader%29" class="tocsubseclink" data-pltdoc="x">@ Syntax Basics</a></td></tr><tr><td><span class="tocsublinknumber">1.8<tt> </tt></span><a href="#%28part._.Decoding_.Sequences%29" class="tocsubseclink" data-pltdoc="x">Decoding Sequences</a></td></tr><tr><td><span class="tocsublinknumber">1.9<tt> </tt></span><a href="#%28part._pictures%29" class="tocsubseclink" data-pltdoc="x">Pictures</a></td></tr><tr><td><span class="tocsublinknumber">1.10<tt> </tt></span><a href="#%28part._roadmap%29" class="tocsubseclink" data-pltdoc="x">Next Steps</a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="index.html" title="backward to "Scribble: The Racket Documentation Tool"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Scribble: The Racket Documentation Tool"" data-pltdoc="x">up</a> <a href="reader.html" title="forward to "2 @ Syntax"" data-pltdoc="x">next →</a></span> </div><h3 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""getting-started"">1<tt> </tt><a name="(part._getting-started)"></a>Getting Started</h3><p>No matter what you want to do with Scribble, it’s best to start by
generating a few simple HTML and/or PDF documents. This chapter steps
you through the basics, and it ends in <a href="#%28part._roadmap%29" data-pltdoc="x">Next Steps</a> with
goal-specific advice on how to continue.</p><h4 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""first-example"">1.1<tt> </tt><a name="(part._first-example)"></a>A First Example</h4><p>Create a file <span class="stt">"mouse.scrbl"</span> with this content:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="base.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/base</span></a><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._title%29%29" class="RktValLink" data-pltdoc="x">title</a></span><span class="RktPn">{</span><span class="RktMeta">On</span><span class="hspace"> </span><span class="RktMeta">the</span><span class="hspace"> </span><span class="RktMeta">Cookie-Eating</span><span class="hspace"> </span><span class="RktMeta">Habits</span><span class="hspace"> </span><span class="RktMeta">of</span><span class="hspace"> </span><span class="RktMeta">Mice</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">If</span><span class="hspace"> </span><span class="RktMeta">you</span><span class="hspace"> </span><span class="RktMeta">give</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta">mouse</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta">cookie,</span><span class="hspace"> </span><span class="RktMeta">he's</span><span class="hspace"> </span><span class="RktMeta">going</span><span class="hspace"> </span><span class="RktMeta">to</span><span class="hspace"> </span><span class="RktMeta">ask</span><span class="hspace"> </span><span class="RktMeta">for</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">glass</span><span class="hspace"> </span><span class="RktMeta">of</span><span class="hspace"> </span><span class="RktMeta">milk.</span><span class="RktMeta"></span></td></tr></table></blockquote><p>The first line’s <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=guide&rel=Module_Syntax.html%23%2528part._hash-lang%2529&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="stt"> </span><a href="base.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/base</span></a> indicates that the file implements a
Scribble document. The document starts in “text mode,” and the
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> character escapes to operators like <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._title%29%29" class="RktValLink" data-pltdoc="x">title</a></span>,
where the curly braces return to text mode for the arguments to the
operator. The rest is document content.</p><p>Now run the <span class="stt">scribble</span> command-line program, specifying a mode
for the kind of document that you want as output:</p><ul><li><p><div class="SIntrapara">Run
</div><div class="SIntrapara"><span class="hspace"> </span><span class="stt">scribble mouse.scrbl</span></div><div class="SIntrapara">to generate HTML as <span class="stt">"mouse.html"</span>. You may
notice that the apostrophe in “he’s” turned into a
curly apostrophe.</div></p></li><li><p><div class="SIntrapara">Run
</div><div class="SIntrapara"><span class="hspace"> </span><span class="stt">scribble --htmls mouse.scrbl</span></div><div class="SIntrapara">to generate HTML as <span class="stt">"mouse/index.html"</span>.
Sub-sections (which we add next) will appear as separate
HTML files in the <span class="stt">"mouse"</span> directory.</div></p></li><li><p><div class="SIntrapara">Run
</div><div class="SIntrapara"><span class="hspace"> </span><span class="stt">scribble --pdf mouse.scrbl</span></div><div class="SIntrapara">to generate PDF as <span class="stt">"mouse.pdf"</span>. This will
work only if you have <span class="stt">pdflatex</span> installed.
If you’d like to see the intermediate Latex, try
</div><div class="SIntrapara"><span class="hspace"> </span><span class="stt">scribble --latex mouse.scrbl</span></div><div class="SIntrapara">to generate <span class="stt">"mouse.tex"</span>.</div></p></li></ul><p>See <a href="running.html" data-pltdoc="x">Running <span class="stt">scribble</span></a> for more information on the <span class="stt">scribble</span>
command-line tool.</p><h4 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""Multiple_Sections"">1.2<tt> </tt><a name="(part._.Multiple_.Sections)"></a>Multiple Sections</h4><p>Add more text to <span class="stt">"mouse.scrbl"</span> so that it looks like this:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="base.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/base</span></a><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._title%29%29" class="RktValLink" data-pltdoc="x">title</a></span><span class="RktPn">{</span><span class="RktMeta">On</span><span class="hspace"> </span><span class="RktMeta">the</span><span class="hspace"> </span><span class="RktMeta">Cookie-Eating</span><span class="hspace"> </span><span class="RktMeta">Habits</span><span class="hspace"> </span><span class="RktMeta">of</span><span class="hspace"> </span><span class="RktMeta">Mice</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">If</span><span class="hspace"> </span><span class="RktMeta">you</span><span class="hspace"> </span><span class="RktMeta">give</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta">mouse</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta">cookie,</span><span class="hspace"> </span><span class="RktMeta">he's</span><span class="hspace"> </span><span class="RktMeta">going</span><span class="hspace"> </span><span class="RktMeta">to</span><span class="hspace"> </span><span class="RktMeta">ask</span><span class="hspace"> </span><span class="RktMeta">for</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">glass</span><span class="hspace"> </span><span class="RktMeta">of</span><span class="hspace"> </span><span class="RktMeta">milk.</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._section%29%29" class="RktValLink" data-pltdoc="x">section</a></span><span class="RktPn">{</span><span class="RktMeta">The</span><span class="hspace"> </span><span class="RktMeta">Consequences</span><span class="hspace"> </span><span class="RktMeta">of</span><span class="hspace"> </span><span class="RktMeta">Milk</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">That</span><span class="hspace"> </span><span class="RktMeta">``squeak''</span><span class="hspace"> </span><span class="RktMeta">was</span><span class="hspace"> </span><span class="RktMeta">the</span><span class="hspace"> </span><span class="RktMeta">mouse</span><span class="hspace"> </span><span class="RktMeta">asking</span><span class="hspace"> </span><span class="RktMeta">for</span><span class="hspace"> </span><span class="RktMeta">milk.</span><span class="hspace"> </span><span class="RktMeta">Let's</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">suppose</span><span class="hspace"> </span><span class="RktMeta">that</span><span class="hspace"> </span><span class="RktMeta">you</span><span class="hspace"> </span><span class="RktMeta">give</span><span class="hspace"> </span><span class="RktMeta">him</span><span class="hspace"> </span><span class="RktMeta">some</span><span class="hspace"> </span><span class="RktMeta">in</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta">big</span><span class="hspace"> </span><span class="RktMeta">glass.</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">He's</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta">small</span><span class="hspace"> </span><span class="RktMeta">mouse.</span><span class="hspace"> </span><span class="RktMeta">The</span><span class="hspace"> </span><span class="RktMeta">glass</span><span class="hspace"> </span><span class="RktMeta">is</span><span class="hspace"> </span><span class="RktMeta">too</span><span class="hspace"> </span><span class="RktMeta">big---way</span><span class="hspace"> </span><span class="RktMeta">too</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">big.</span><span class="hspace"> </span><span class="RktMeta">So,</span><span class="hspace"> </span><span class="RktMeta">he'll</span><span class="hspace"> </span><span class="RktMeta">probably</span><span class="hspace"> </span><span class="RktMeta">ask</span><span class="hspace"> </span><span class="RktMeta">you</span><span class="hspace"> </span><span class="RktMeta">for</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta">straw.</span><span class="hspace"> </span><span class="RktMeta">You</span><span class="hspace"> </span><span class="RktMeta">might</span><span class="hspace"> </span><span class="RktMeta">as</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">well</span><span class="hspace"> </span><span class="RktMeta">give</span><span class="hspace"> </span><span class="RktMeta">it</span><span class="hspace"> </span><span class="RktMeta">to</span><span class="hspace"> </span><span class="RktMeta">him.</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._section%29%29" class="RktValLink" data-pltdoc="x">section</a></span><span class="RktPn">{</span><span class="RktMeta">Not</span><span class="hspace"> </span><span class="RktMeta">the</span><span class="hspace"> </span><span class="RktMeta">Last</span><span class="hspace"> </span><span class="RktMeta">Straw</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">For</span><span class="hspace"> </span><span class="RktMeta">now,</span><span class="hspace"> </span><span class="RktMeta">to</span><span class="hspace"> </span><span class="RktMeta">handle</span><span class="hspace"> </span><span class="RktMeta">the</span><span class="hspace"> </span><span class="RktMeta">milk</span><span class="hspace"> </span><span class="RktMeta">moustache,</span><span class="hspace"> </span><span class="RktMeta">it's</span><span class="hspace"> </span><span class="RktMeta">enough</span><span class="hspace"> </span><span class="RktMeta">to</span><span class="hspace"> </span><span class="RktMeta">give</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">him</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta">napkin.</span><span class="hspace"> </span><span class="RktMeta">But</span><span class="hspace"> </span><span class="RktMeta">it</span><span class="hspace"> </span><span class="RktMeta">doesn't</span><span class="hspace"> </span><span class="RktMeta">end</span><span class="hspace"> </span><span class="RktMeta">there...</span><span class="hspace"> </span><span class="RktMeta">oh,</span><span class="hspace"> </span><span class="RktMeta">no.</span><span class="RktMeta"></span></td></tr></table></blockquote><p>Now, after the first paragraph of the paper, we have two
sub-sections, each created by calling <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._section%29%29" class="RktValLink" data-pltdoc="x">section</a></span> to
generate a sub-section declaration. The first sub-section has
two paragraphs. The second section, as initiated by the result
of the second <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._section%29%29" class="RktValLink" data-pltdoc="x">section</a></span> call, has a single paragraph.</p><p>Run the <span class="stt">scribble</span> command(s) from <a href="#%28part._first-example%29" data-pltdoc="x">A First Example</a>
again. You may notice the curly double-quotes in the output, and
the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">---</span><span class="hspace"></span></span> turned into an em dash.</p><h4 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""Splitting_the_Document_Source"">1.3<tt> </tt><a name="(part._.Splitting_the_.Document_.Source)"></a>Splitting the Document Source</h4><p>As a document grows larger, it’s better to split sections into
separate source files. The <span class="RktSym"><a href="base.html#%28form._%28%28lib._scribble%2Fbase..rkt%29._include-section%29%29" class="RktStxLink" data-pltdoc="x">include-section</a></span> operation
incorporates a document defined by a <span class="stt">".scrbl"</span> file into a
larger document.</p><p>To split the example document into multiple files, change
<span class="stt">"mouse.scrbl"</span> to just</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="base.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/base</span></a><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._title%29%29" class="RktValLink" data-pltdoc="x">title</a></span><span class="RktPn">{</span><span class="RktMeta">On</span><span class="hspace"> </span><span class="RktMeta">the</span><span class="hspace"> </span><span class="RktMeta">Cookie-Eating</span><span class="hspace"> </span><span class="RktMeta">Habits</span><span class="hspace"> </span><span class="RktMeta">of</span><span class="hspace"> </span><span class="RktMeta">Mice</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">If</span><span class="hspace"> </span><span class="RktMeta">you</span><span class="hspace"> </span><span class="RktMeta">give</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta">mouse</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta">cookie,</span><span class="hspace"> </span><span class="RktMeta">he's</span><span class="hspace"> </span><span class="RktMeta">going</span><span class="hspace"> </span><span class="RktMeta">to</span><span class="hspace"> </span><span class="RktMeta">ask</span><span class="hspace"> </span><span class="RktMeta">for</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">glass</span><span class="hspace"> </span><span class="RktMeta">of</span><span class="hspace"> </span><span class="RktMeta">milk.</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28form._%28%28lib._scribble%2Fbase..rkt%29._include-section%29%29" class="RktStxLink" data-pltdoc="x">include-section</a></span><span class="RktPn">[</span><span class="RktVal">"milk.scrbl"</span><span class="RktPn">]</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28form._%28%28lib._scribble%2Fbase..rkt%29._include-section%29%29" class="RktStxLink" data-pltdoc="x">include-section</a></span><span class="RktPn">[</span><span class="RktVal">"straw.scrbl"</span><span class="RktPn">]</span><span class="RktMeta"></span></td></tr></table></blockquote><p>Create <span class="stt">"milk.scrbl"</span> and <span class="stt">"straw.scrbl"</span> in the same
directory as <span class="stt">"mouse.scrbl"</span>. In <span class="stt">"milk.scrbl"</span>, put</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="base.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/base</span></a><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._title%29%29" class="RktValLink" data-pltdoc="x">title</a></span><span class="RktPn">{</span><span class="RktMeta">The</span><span class="hspace"> </span><span class="RktMeta">Consequences</span><span class="hspace"> </span><span class="RktMeta">of</span><span class="hspace"> </span><span class="RktMeta">Milk</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">That</span><span class="hspace"> </span><span class="RktMeta">``squeak''</span><span class="hspace"> </span><span class="RktMeta">was</span><span class="hspace"> </span><span class="RktMeta">the</span><span class="hspace"> </span><span class="RktMeta">mouse</span><span class="hspace"> </span><span class="RktMeta">asking</span><span class="hspace"> </span><span class="RktMeta">for</span><span class="hspace"> </span><span class="RktMeta">milk...</span><span class="RktMeta"></span></td></tr></table></blockquote><p>and in <span class="stt">"straw.scrbl"</span>, put</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="base.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/base</span></a><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._title%29%29" class="RktValLink" data-pltdoc="x">title</a></span><span class="RktPn">{</span><span class="RktMeta">Not</span><span class="hspace"> </span><span class="RktMeta">the</span><span class="hspace"> </span><span class="RktMeta">Last</span><span class="hspace"> </span><span class="RktMeta">Straw</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">For</span><span class="hspace"> </span><span class="RktMeta">now,</span><span class="hspace"> </span><span class="RktMeta">to</span><span class="hspace"> </span><span class="RktMeta">handle</span><span class="hspace"> </span><span class="RktMeta">the</span><span class="hspace"> </span><span class="RktMeta">milk</span><span class="hspace"> </span><span class="RktMeta">moustache,</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktMeta"></span></td></tr></table></blockquote><p>Notice that the new files both start with <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=guide&rel=Module_Syntax.html%23%2528part._hash-lang%2529&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktMod">#lang</span></a>, like the
original document, and the <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._section%29%29" class="RktValLink" data-pltdoc="x">section</a></span>s from the original
document become <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._title%29%29" class="RktValLink" data-pltdoc="x">title</a></span>s in the new documents. Both
<span class="stt">"milk.scrbl"</span> and <span class="stt">"straw.scrbl"</span> are documents in
their own right with their own titles, and they can be individually
rendered using <span class="stt">scribble</span>. Running <span class="stt">scribble</span> on
<span class="stt">"mouse.scrbl"</span>, meanwhile, incorporates the smaller documents
into one document that is the same as before.</p><h4 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""Document_Styles"">1.4<tt> </tt><a name="(part._.Document_.Styles)"></a>Document Styles</h4><p>Scribble currently supports only one form of HTML output. You can
replace the <span class="stt">"scribble.css"</span> file for the generated pages, and
that’s about it. (We expect to add more styles in the future.)</p><p>For Latex-based PDF output, Scribble includes support for
multiple page-layout configurations. The <span class="stt">"mouse.scrbl"</span>
example so far uses the default Latex style. If you plan on submitting
the paper to a workshop on programming languages, then—<wbr></wbr>well, you
probably need a different topic. But you can start making the current
content look right by changing the first line to</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="SIGPLAN_Paper_Format.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/sigplan</span></a><span class="RktMeta"></span></td></tr></table></blockquote><p>If you’re instead working toward Racket library documentation,
try changing the first line to</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="manual.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/manual</span></a><span class="RktMeta"></span></td></tr></table></blockquote><p>which produces output with a separate title page, initial content on
that page (intended as a brief orientation to the document), and
top-level sections turned into chapters that each start on a new page.
If you have split the document into multiple files, the first line of
the main document file determines the output format.</p><p>Using <a href="SIGPLAN_Paper_Format.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/sigplan</span></a> or
<a href="manual.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/manual</span></a> does not change the rendered HTML for
a document—<wbr></wbr>aside from <a href="manual.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/manual</span></a> adding a
version number—<wbr></wbr>but it changes the set of bindings available in the
document body. For example, with <a href="SIGPLAN_Paper_Format.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/sigplan</span></a>, the
introductory text can be marked as an abstract:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="SIGPLAN_Paper_Format.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/sigplan</span></a><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._title%29%29" class="RktValLink" data-pltdoc="x">title</a></span><span class="RktPn">{</span><span class="RktMeta">On</span><span class="hspace"> </span><span class="RktMeta">the</span><span class="hspace"> </span><span class="RktMeta">Cookie-Eating</span><span class="hspace"> </span><span class="RktMeta">Habits</span><span class="hspace"> </span><span class="RktMeta">of</span><span class="hspace"> </span><span class="RktMeta">Mice</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="SIGPLAN_Paper_Format.html#%28def._%28%28lib._scribble%2Fsigplan..rkt%29._abstract%29%29" class="RktValLink" data-pltdoc="x">abstract</a></span><span class="RktPn">{</span><span class="RktMeta">If</span><span class="hspace"> </span><span class="RktMeta">you</span><span class="hspace"> </span><span class="RktMeta">give</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta">mouse</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta">cookie,</span><span class="hspace"> </span><span class="RktMeta">he's</span><span class="hspace"> </span><span class="RktMeta">going</span><span class="hspace"> </span><span class="RktMeta">to</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktMeta">ask</span><span class="hspace"> </span><span class="RktMeta">for</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta">glass</span><span class="hspace"> </span><span class="RktMeta">of</span><span class="hspace"> </span><span class="RktMeta">milk.</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._section%29%29" class="RktValLink" data-pltdoc="x">section</a></span><span class="RktPn">{</span><span class="RktMeta">The</span><span class="hspace"> </span><span class="RktMeta">Consequences</span><span class="hspace"> </span><span class="RktMeta">of</span><span class="hspace"> </span><span class="RktMeta">Milk</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">....</span><span class="RktMeta"></span></td></tr></table></blockquote><p>When rendered as HTML, the abstract shows up as an inset paragraph. If
you try to use <span class="RktSym"><a href="SIGPLAN_Paper_Format.html#%28def._%28%28lib._scribble%2Fsigplan..rkt%29._abstract%29%29" class="RktValLink" data-pltdoc="x">abstract</a></span> with the
<a href="base.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/base</span></a> or <a href="manual.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/manual</span></a>
language, then you get an error, because <span class="RktSym"><a href="SIGPLAN_Paper_Format.html#%28def._%28%28lib._scribble%2Fsigplan..rkt%29._abstract%29%29" class="RktValLink" data-pltdoc="x">abstract</a></span> is not
defined.</p><p>When a document is implemented across multiple files, changing the
language of the main document can set the style for all of the parts,
but it does not introduce bindings into the other part files. For
example, if you change the language of <span class="stt">"mouse.scrbl"</span> to
<a href="SIGPLAN_Paper_Format.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/sigplan</span></a>, then <span class="RktSym"><a href="SIGPLAN_Paper_Format.html#%28def._%28%28lib._scribble%2Fsigplan..rkt%29._abstract%29%29" class="RktValLink" data-pltdoc="x">abstract</a></span> becomes
available in <span class="stt">"mouse.scrbl"</span> but not in <span class="stt">"milk.scrbl"</span>
or <span class="stt">"straw.scrbl"</span>. In other words, operator names are
lexically scoped.</p><h4 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""More_Functions"">1.5<tt> </tt><a name="(part._.More_.Functions)"></a>More Functions</h4><p>The <a href="base.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/base</span></a> language provides a collection of
basic operations (and The <a href="SIGPLAN_Paper_Format.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/sigplan</span></a> and
<a href="manual.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/manual</span></a> are supersets of
<a href="base.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/base</span></a>). Many of the operations are style
variations that you can apply to text:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta"></span><span class="RktMeta">He's</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._smaller%29%29" class="RktValLink" data-pltdoc="x">smaller</a></span><span class="RktPn">{</span><span class="RktMeta">small</span><span class="hspace"> </span><span class="RktMeta">mouse</span><span class="RktPn">}</span><span class="RktMeta">.</span><span class="hspace"> </span><span class="RktMeta">The</span><span class="hspace"> </span><span class="RktMeta">glass</span><span class="hspace"> </span><span class="RktMeta">is</span><span class="hspace"> </span><span class="RktMeta">too</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._larger%29%29" class="RktValLink" data-pltdoc="x">larger</a></span><span class="RktPn">{</span><span class="RktMeta">big</span><span class="RktPn">}</span><span class="RktMeta">---</span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._bold%29%29" class="RktValLink" data-pltdoc="x">bold</a></span><span class="RktPn">{</span><span class="RktMeta">way</span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._larger%29%29" class="RktValLink" data-pltdoc="x">larger</a></span><span class="RktPn">{</span><span class="RktMeta">too</span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._larger%29%29" class="RktValLink" data-pltdoc="x">larger</a></span><span class="RktPn">{</span><span class="RktMeta">big</span><span class="RktPn">}</span><span class="RktPn">}</span><span class="RktPn">}</span><span class="RktMeta">.</span><span class="hspace"> </span><span class="RktMeta">So,</span><span class="hspace"> </span><span class="RktMeta">he'll</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._italic%29%29" class="RktValLink" data-pltdoc="x">italic</a></span><span class="RktPn">{</span><span class="RktMeta">probably</span><span class="RktPn">}</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta">ask</span><span class="hspace"> </span><span class="RktMeta">you</span><span class="hspace"> </span><span class="RktMeta">for</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta">straw.</span><span class="RktMeta"></span></td></tr></table></blockquote><p>which renders as</p><blockquote><p>He’s a <span class="Smaller">small mouse</span>. The glass is too
<span class="Larger">big</span>—<wbr></wbr><span style="font-weight: bold">way <span class="Larger">too <span class="Larger">big</span></span></span>. So, he’ll
<span style="font-style: italic">probably</span> ask you for a straw.</p></blockquote><p>As you would expect, calls to functions like <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._smaller%29%29" class="RktValLink" data-pltdoc="x">smaller</a></span>,
<span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._larger%29%29" class="RktValLink" data-pltdoc="x">larger</a></span>, and <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._bold%29%29" class="RktValLink" data-pltdoc="x">bold</a></span> can be nested in other calls. They
can also be nested within calls to <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._title%29%29" class="RktValLink" data-pltdoc="x">title</a></span> or <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._section%29%29" class="RktValLink" data-pltdoc="x">section</a></span>:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._section%29%29" class="RktValLink" data-pltdoc="x">section</a></span><span class="RktPn">{</span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._italic%29%29" class="RktValLink" data-pltdoc="x">italic</a></span><span class="RktPn">{</span><span class="RktMeta">Not</span><span class="RktPn">}</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta">the</span><span class="hspace"> </span><span class="RktMeta">Last</span><span class="hspace"> </span><span class="RktMeta">Straw</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr></table></blockquote><h5 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""Centering"">1.5.1<tt> </tt><a name="(part._.Centering)"></a>Centering</h5><p>The <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._centered%29%29" class="RktValLink" data-pltdoc="x">centered</a></span> operation centers a flow of text:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta"></span><span class="RktMeta">If</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta">mouse</span><span class="hspace"> </span><span class="RktMeta">eats</span><span class="hspace"> </span><span class="RktMeta">all</span><span class="hspace"> </span><span class="RktMeta">your</span><span class="hspace"> </span><span class="RktMeta">cookies,</span><span class="hspace"> </span><span class="RktMeta">put</span><span class="hspace"> </span><span class="RktMeta">up</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta">sign</span><span class="hspace"> </span><span class="RktMeta">that</span><span class="hspace"> </span><span class="RktMeta">says</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._centered%29%29" class="RktValLink" data-pltdoc="x">centered</a></span><span class="RktPn">{</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._bold%29%29" class="RktValLink" data-pltdoc="x">bold</a></span><span class="RktPn">{</span><span class="RktMeta">Cookies</span><span class="hspace"> </span><span class="RktMeta">Wanted</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._italic%29%29" class="RktValLink" data-pltdoc="x">italic</a></span><span class="RktPn">{</span><span class="RktMeta">Chocolate</span><span class="hspace"> </span><span class="RktMeta">chip</span><span class="hspace"> </span><span class="RktMeta">preferred!</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">and</span><span class="hspace"> </span><span class="RktMeta">see</span><span class="hspace"> </span><span class="RktMeta">if</span><span class="hspace"> </span><span class="RktMeta">anyone</span><span class="hspace"> </span><span class="RktMeta">brings</span><span class="hspace"> </span><span class="RktMeta">you</span><span class="hspace"> </span><span class="RktMeta">more.</span><span class="RktMeta"></span></td></tr></table></blockquote><p>which renders as</p><blockquote><p><div class="SIntrapara">If a mouse eats all your cookies, put up a sign that says
</div><div class="SIntrapara"><blockquote class="SCentered"><p><span style="font-weight: bold">Cookies Wanted</span></p><p><span style="font-style: italic">Chocolate chip preferred!</span></p></blockquote></div><div class="SIntrapara">and see if anyone brings you more.</div></p></blockquote><h5 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""Margin_Notes"">1.5.2<tt> </tt><a name="(part._.Margin_.Notes)"></a>Margin Notes</h5><p>The <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._margin-note%29%29" class="RktValLink" data-pltdoc="x">margin-note</a></span> operation is used in a similar way, but the
rendered text is moved to the margins.
<span class="refelem"><span class="refcolumn"><span class="refcontent">If you use <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._margin-note%29%29" class="RktValLink" data-pltdoc="x">margin-note</a></span>, then the content shows
up over here.</span></span></span></p><h5 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""Itemizations"">1.5.3<tt> </tt><a name="(part._.Itemizations)"></a>Itemizations</h5><p>The <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._itemlist%29%29" class="RktValLink" data-pltdoc="x">itemlist</a></span> operation creates a sequence of bulleted text,
where the <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._item%29%29" class="RktValLink" data-pltdoc="x">item</a></span> operation groups text to appear in a single
bullet. The <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._itemlist%29%29" class="RktValLink" data-pltdoc="x">itemlist</a></span> operation is different from the others
that we have seen before, because it only accepts values produced by
<span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._item%29%29" class="RktValLink" data-pltdoc="x">item</a></span> instead of arbitrary text. This difference is reflected
in the use of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span> for the arguments to
<span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._itemlist%29%29" class="RktValLink" data-pltdoc="x">itemlist</a></span> instead of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span>:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._centered%29%29" class="RktValLink" data-pltdoc="x">centered</a></span><span class="RktPn">{</span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._bold%29%29" class="RktValLink" data-pltdoc="x">bold</a></span><span class="RktPn">{</span><span class="RktMeta">Notice</span><span class="hspace"> </span><span class="RktMeta">to</span><span class="hspace"> </span><span class="RktMeta">Mice</span><span class="RktPn">}</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._itemlist%29%29" class="RktValLink" data-pltdoc="x">itemlist</a></span><span class="RktPn">[</span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._item%29%29" class="RktValLink" data-pltdoc="x">item</a></span><span class="RktPn">{</span><span class="RktMeta">We</span><span class="hspace"> </span><span class="RktMeta">have</span><span class="hspace"> </span><span class="RktMeta">cookies</span><span class="hspace"> </span><span class="RktMeta">for</span><span class="hspace"> </span><span class="RktMeta">you.</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._item%29%29" class="RktValLink" data-pltdoc="x">item</a></span><span class="RktPn">{</span><span class="RktMeta">If</span><span class="hspace"> </span><span class="RktMeta">you</span><span class="hspace"> </span><span class="RktMeta">want</span><span class="hspace"> </span><span class="RktMeta">to</span><span class="hspace"> </span><span class="RktMeta">eat</span><span class="hspace"> </span><span class="RktMeta">a</span><span class="hspace"> </span><span class="RktMeta">cookie,</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktMeta">you</span><span class="hspace"> </span><span class="RktMeta">must</span><span class="hspace"> </span><span class="RktMeta">bring</span><span class="hspace"> </span><span class="RktMeta">your</span><span class="hspace"> </span><span class="RktMeta">own</span><span class="hspace"> </span><span class="RktMeta">straw.</span><span class="RktPn">}</span><span class="RktPn">]</span><span class="RktMeta"></span></td></tr></table></blockquote><p>which renders as</p><blockquote><blockquote class="SCentered"><p><span style="font-weight: bold">Notice to Mice</span></p></blockquote><ul><li><p>We have cookies for you.</p></li><li><p>If you want to eat a cookie,
you must bring your own straw.</p></li></ul></blockquote><h5 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""Tables"">1.5.4<tt> </tt><a name="(part._.Tables)"></a>Tables</h5><p>The <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._tabular%29%29" class="RktValLink" data-pltdoc="x">tabular</a></span> function takes a list of lists to organize into a
two-dimensional table. By default, no spacing is added between columns,
so supply a <span class="RktPn">#:sep</span> argument to acts as a column separator.
For example,</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._tabular%29%29" class="RktValLink" data-pltdoc="x">tabular</a></span><span class="RktPn">[</span><span class="RktPn">#:sep</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._hspace%29%29" class="RktValLink" data-pltdoc="x">hspace</a></span><span class="RktPn">[</span><span class="RktVal">1</span><span class="RktPn">]</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._list%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">list</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._list%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">list</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._bold%29%29" class="RktValLink" data-pltdoc="x">bold</a></span><span class="RktPn">{</span><span class="RktMeta">Animal</span><span class="RktPn">}</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._bold%29%29" class="RktValLink" data-pltdoc="x">bold</a></span><span class="RktPn">{</span><span class="RktMeta">Food</span><span class="RktPn">}</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._list%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">list</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">"mouse"</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">"cookie"</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._list%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">list</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">"moose"</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">"muffin"</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktMeta"></span></td></tr></table></blockquote><p>renders as</p><blockquote><table cellspacing="0" cellpadding="0"><tr><td><p><span style="font-weight: bold">Animal</span></p></td><td><p><span class="hspace"> </span></p></td><td><p><span style="font-weight: bold">Food</span></p></td></tr><tr><td><p>mouse</p></td><td><p><span class="hspace"> </span></p></td><td><p>cookie</p></td></tr><tr><td><p>moose</p></td><td><p><span class="hspace"> </span></p></td><td><p>muffin</p></td></tr></table></blockquote><h4 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""Text_Mode_vs__Racket_Mode_for_Arguments"">1.6<tt> </tt><a name="(part._.Text_.Mode_vs__.Racket_.Mode_for_.Arguments)"></a>Text Mode vs. Racket Mode for Arguments</h4><p>When <span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span> surrounds the arguments of an
operation, the argument expressions are in Racket mode rather than
text mode. Even in Racket mode, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> can be used to apply
operations; once the @ syntax is enabled through a
language like <a href="base.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/base</span></a> (as opposed to
<a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=index.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">racket</span></a>), it behaves the same in both Racket mode and
text mode.</p><p>One advantage of using Racket mode for the arguments to
<span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._itemlist%29%29" class="RktValLink" data-pltdoc="x">itemlist</a></span> is that we can pass a keyword-tagged optional
argument to <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._itemlist%29%29" class="RktValLink" data-pltdoc="x">itemlist</a></span>. In particular, if you want a list with
numbers instead of bullets, supply the <span class="RktVal">'</span><span class="RktVal">ordered</span> style to
<span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._itemlist%29%29" class="RktValLink" data-pltdoc="x">itemlist</a></span> using the <span class="RktPn">#:style</span> keyword:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._itemlist%29%29" class="RktValLink" data-pltdoc="x">itemlist</a></span><span class="RktPn">[</span><span class="RktPn">#:style</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=quote.html%23%2528form._%2528%2528quote._%7E23%7E25kernel%2529._quote%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">'</a></span><span class="RktSym">ordered</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._item%29%29" class="RktValLink" data-pltdoc="x">item</a></span><span class="RktPn">{</span><span class="RktMeta">Eat</span><span class="hspace"> </span><span class="RktMeta">cookie.</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._item%29%29" class="RktValLink" data-pltdoc="x">item</a></span><span class="RktPn">{</span><span class="RktMeta">Drink</span><span class="hspace"> </span><span class="RktMeta">milk.</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._item%29%29" class="RktValLink" data-pltdoc="x">item</a></span><span class="RktPn">{</span><span class="RktMeta">Wipe</span><span class="hspace"> </span><span class="RktMeta">mouth.</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._item%29%29" class="RktValLink" data-pltdoc="x">item</a></span><span class="RktPn">{</span><span class="RktMeta">...</span><span class="RktPn">}</span><span class="RktPn">]</span><span class="RktMeta"></span></td></tr></table></blockquote><p>An operation doesn’t care whether it’s used with
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span> or <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span>. Roughly,
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span> forms an argument that is a
string. (Only roughly, though. Newlines or uses of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span>
within <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span> complicate the picture, and we’ll
get back to that soon.) So,</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._italic%29%29" class="RktValLink" data-pltdoc="x">italic</a></span><span class="RktPn">{</span><span class="RktMeta">Yummy!</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr></table></blockquote><p>is equivalent to</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._italic%29%29" class="RktValLink" data-pltdoc="x">italic</a></span><span class="RktPn">[</span><span class="RktVal">"Yummy!"</span><span class="RktPn">]</span><span class="RktMeta"></span></td></tr></table></blockquote><p>which is equivalent to the Racket expression</p><blockquote class="SCodeFlow"><p><span class="RktPn">(</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._italic%29%29" class="RktValLink" data-pltdoc="x">italic</a></span><span class="hspace"> </span><span class="RktVal">"Yummy!"</span><span class="RktPn">)</span></p></blockquote><p>These equivalences explain why Scribble functions are documented in
Racket notation. If you’re reading this in HTML format, you can click
<span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._italic%29%29" class="RktValLink" data-pltdoc="x">italic</a></span> above to access its documentation. The documentation
won’t completely make sense, yet, but it will by the end of this
chapter.</p><p>What if you want to provide arguments in text mode, but you also want
to supply other optional arguments? You can use both
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span> and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span> for an
operation, as long as the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span> is first, and as
long as no character separate the closing <span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span> from the
opening <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>. For example, calling <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._italic%29%29" class="RktValLink" data-pltdoc="x">italic</a></span> is the
same as using <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._elem%29%29" class="RktValLink" data-pltdoc="x">elem</a></span> with the <span class="RktVal">'</span><span class="RktVal">italic</span> style:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._elem%29%29" class="RktValLink" data-pltdoc="x">elem</a></span><span class="RktPn">[</span><span class="RktPn">#:style</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=quote.html%23%2528form._%2528%2528quote._%7E23%7E25kernel%2529._quote%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">'</a></span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._italic%29%29" class="RktValLink" data-pltdoc="x">italic</a></span><span class="RktPn">]</span><span class="RktPn">{</span><span class="RktMeta">Yummy!</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr></table></blockquote><p>You can also <span style="font-style: italic">omit</span> both <span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span> and
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span>. In that case, the Racket expression
after <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> is used directly instead of applied as an
operation. For example,</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta"></span><span class="RktMeta">1</span><span class="hspace"> </span><span class="RktMeta">plus</span><span class="hspace"> </span><span class="RktMeta">2</span><span class="hspace"> </span><span class="RktMeta">is</span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number-%7E3estring%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number->string</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%252B%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">+</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">1</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta">.</span><span class="RktMeta"></span></td></tr></table></blockquote><p>renders as</p><blockquote><p>1 plus 2 is 3.</p></blockquote><p>The call to <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number-%7E3estring%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number->string</a></span> is needed because a naked number
is not valid as document content.</p><h4 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""how-to:reader"">1.7<tt> </tt><a name="(part._how-to~3areader)"></a>@ Syntax Basics</h4><p>The @ notation provided by Scribble is just another way of
writing Racket expressions. Scribble documents could be constructed
using normal Racket notation, without using @ at all, but
that would be inconvenient for most purposes. The @
notation makes dealing with textual content much easier.</p><p>Whether in text mode or Racket mode, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> in a document
provides an escape to Racket mode. The basic syntax of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> is</p><blockquote class="SCodeFlow"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">cmd</span>›</span><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">datum</span>›</span><span class="sroman">*</span><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">text-body</span>›</span><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></p></blockquote><p>where all three parts after <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> are optional, but at least
one must be present. No spaces are allowed between</p><ul><li><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> and <span class="sroman">‹<span style="font-style: italic">cmd</span>›</span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span>, or <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span></p></li><li><p><span class="sroman">‹<span style="font-style: italic">cmd</span>›</span> and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span> or <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>; or</p></li><li><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span> and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>.</p></li></ul><p>A <span class="sroman">‹<span style="font-style: italic">cmd</span>›</span> or <span class="sroman">‹<span style="font-style: italic">datum</span>›</span> is normal Racket notation, while a
<span class="sroman">‹<span style="font-style: italic">text-body</span>›</span> is itself in text mode. A <span class="sroman">‹<span style="font-style: italic">cmd</span>›</span> obviously
must not start with <span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span> or <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>, even though Racket
forms could otherwise start with those characters.</p><p>The expansion of just <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">cmd</span>›</span> into Racket code is</p><blockquote class="SCodeFlow"><p><span class="sroman">‹<span style="font-style: italic">cmd</span>›</span></p></blockquote><p>When either <span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span> or <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span>
are used, the expansion is</p><blockquote class="SCodeFlow"><p><span class="RktPn">(</span><span class="sroman">‹<span style="font-style: italic">cmd</span>›</span><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">datum</span>›</span><span class="sroman">*</span><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">parsed-body</span>›</span><span class="sroman">*</span><span class="RktPn">)</span></p></blockquote><p>where <span class="sroman">‹<span style="font-style: italic">parsed-body</span>›</span><span class="sroman">*</span> is the parse result of the
<span class="sroman">‹<span style="font-style: italic">text-body</span>›</span>. The <span class="sroman">‹<span style="font-style: italic">parsed-body</span>›</span><span class="sroman">*</span> part often
turns out to be a sequence of Racket strings.</p><p>In practice, the <span class="sroman">‹<span style="font-style: italic">cmd</span>›</span> is normally a Racket identifier that is
bound to a procedure or syntactic form. If the procedure or form
expects further text to typeset, then <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span>
supplies the text. If the form expects other data, typically
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span> is used to surround Racket arguments,
instead. Even if an operation’s argument is a string, if the string is
not used as content text (but instead used as, say, a hyperlink
label), then the string is typically provided through
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span> instead of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span>.
Sometimes, both <span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span> and
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span> are used, where the former surround
Racket arguments that precede text to typeset. Finally, if a form is a
purely Racket-level form with not typeset result, such as a
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span> to import more operations, then typically just
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> is used.</p><p>For example the text-mode stream</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym">scriblib/figure</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._section%29%29" class="RktValLink" data-pltdoc="x">section</a></span><span class="RktPn">[</span><span class="RktPn">#:tag</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">"poetry"</span><span class="RktPn">]</span><span class="RktPn">{</span><span class="RktMeta">Of</span><span class="hspace"> </span><span class="RktMeta">Mice</span><span class="hspace"> </span><span class="RktMeta">and</span><span class="hspace"> </span><span class="RktMeta">Cookies</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">See</span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._secref%29%29" class="RktValLink" data-pltdoc="x">secref</a></span><span class="RktPn">[</span><span class="RktVal">"milk"</span><span class="RktPn">]</span><span class="RktMeta">.</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._section%29%29" class="RktValLink" data-pltdoc="x">section</a></span><span class="RktPn">[</span><span class="RktPn">#:tag</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">"milk"</span><span class="RktPn">]</span><span class="RktPn">{</span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._italic%29%29" class="RktValLink" data-pltdoc="x">italic</a></span><span class="RktPn">{</span><span class="RktMeta">Important</span><span class="RktPn">}</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta">Milk</span><span class="hspace"> </span><span class="RktMeta">Supplies</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=scriblib&rel=figure.html%23%2528def._%2528%2528lib._scriblib%252Ffigure..rkt%2529._figure%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">figure</a></span><span class="RktPn">[</span><span class="RktVal">"straw"</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._elem%29%29" class="RktValLink" data-pltdoc="x">elem</a></span><span class="RktPn">{</span><span class="RktMeta">A</span><span class="hspace"> </span><span class="RktMeta">straw</span><span class="RktPn">}</span><span class="RktPn">]</span><span class="RktPn">{</span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._image%29%29" class="RktValLink" data-pltdoc="x">image</a></span><span class="RktPn">[</span><span class="RktVal">"straw.png"</span><span class="RktPn">]</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr></table></blockquote><p>is equivalent to the Racket-mode sequence</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="hspace"> </span><span class="RktSym">scriblib/figure</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="RktVal">"\n"</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._section%29%29" class="RktValLink" data-pltdoc="x">section</a></span><span class="hspace"> </span><span class="RktPn">#:tag</span><span class="hspace"> </span><span class="RktVal">"poetry"</span><span class="hspace"> </span><span class="RktVal">"Of Mice and Cookies"</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="RktVal">"See "</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._secref%29%29" class="RktValLink" data-pltdoc="x">secref</a></span><span class="hspace"> </span><span class="RktVal">"milk"</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">"."</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="RktVal">"\n"</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._section%29%29" class="RktValLink" data-pltdoc="x">section</a></span><span class="hspace"> </span><span class="RktPn">#:tag</span><span class="hspace"> </span><span class="RktVal">"milk"</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._italic%29%29" class="RktValLink" data-pltdoc="x">italic</a></span><span class="hspace"> </span><span class="RktVal">"Important"</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">" Milk Supplies"</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=scriblib&rel=figure.html%23%2528def._%2528%2528lib._scriblib%252Ffigure..rkt%2529._figure%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">figure</a></span><span class="hspace"> </span><span class="RktVal">"straw"</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._elem%29%29" class="RktValLink" data-pltdoc="x">elem</a></span><span class="hspace"> </span><span class="RktVal">"A straw"</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._image%29%29" class="RktValLink" data-pltdoc="x">image</a></span><span class="hspace"> </span><span class="RktVal">"straw.png"</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">"\n"</span></td></tr></table></blockquote><p>Besides showing how different argument conventions are used for
different operations, the above example illustrates how whitespace is
preserved in the Racket form of a text-mode stream—<wbr></wbr>including
newlines preserved as their own strings. Notice how the second
<span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._section%29%29" class="RktValLink" data-pltdoc="x">section</a></span> gets two arguments for its content, since the
argument content for <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._section%29%29" class="RktValLink" data-pltdoc="x">section</a></span> in the source stream includes
both the use of an operator and additional text. When an operation
like <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._section%29%29" class="RktValLink" data-pltdoc="x">section</a></span> or <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._italic%29%29" class="RktValLink" data-pltdoc="x">italic</a></span> accepts content to typeset,
it normally accepts an arbitrary number of arguments that together
form the content.</p><p>In addition to its role for command, a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> can be followed
by <span class="RktInBG"><span class="hspace"></span><span class="RktIn">;</span><span class="hspace"></span></span> to start a <a name="(idx._(gentag._0._(lib._scribblings/scribble/scribble..scrbl)))"></a>comment. If the character after <span class="RktInBG"><span class="hspace"></span><span class="RktIn">;</span><span class="hspace"></span></span> is
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>, then the comment runs until a matching <span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span>,
otherwise the comment runs until the end-of-line:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@;{</span><span class="hspace"></span></span><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">comment</span>›</span><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></td></tr><tr><td><span class="RktInBG"><span class="hspace"></span><span class="RktIn">@;</span><span class="hspace"></span></span><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">line-comment</span>›</span></td></tr></table></blockquote><p>For more information on the syntax of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span>, see
<a href="reader.html" data-pltdoc="x">@ Syntax</a>. The full syntax includes a few more details, such
as brackets like <span class="RktInBG"><span class="hspace"></span><span class="RktIn">|{</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">}|</span><span class="hspace"></span></span> for text-mode
arguments while disabling <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> between the brackets.</p><h4 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""Decoding_Sequences"">1.8<tt> </tt><a name="(part._.Decoding_.Sequences)"></a>Decoding Sequences</h4><p>In a document that starts <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=guide&rel=Module_Syntax.html%23%2528part._hash-lang%2529&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="stt"> </span><a href="base.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/base</span></a>, the top level is a text-mode stream,
just like the <span class="sroman">‹<span style="font-style: italic">text-body</span>›</span> in a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">@</span><span class="hspace"></span></span> form. As
illustrated in the previous section, such a top-level sequence
corresponds to a mixture of Racket-mode strings and operation
applications. There’s an implicit operation, <span class="RktSym"><a href="decode.html#%28def._%28%28lib._scribble%2Fdecode..rkt%29._decode%29%29" class="RktValLink" data-pltdoc="x">decode</a></span>, that
wraps the whole document to consume this mixture of strings and other
values and turn them into a document description.</p><p>The <span class="RktSym"><a href="decode.html#%28def._%28%28lib._scribble%2Fdecode..rkt%29._decode%29%29" class="RktValLink" data-pltdoc="x">decode</a></span> operation implements <span style="font-style: italic">flow decoding</span>,
which takes a document stream and breaks it up into sections and
paragraphs. Blank lines delimit paragraphs, and the results of
operations like <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._title%29%29" class="RktValLink" data-pltdoc="x">title</a></span> and <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._section%29%29" class="RktValLink" data-pltdoc="x">section</a></span> generate “here’s
the title” or “a new section starts here” declarations that are
recognized by <span class="RktSym"><a href="decode.html#%28def._%28%28lib._scribble%2Fdecode..rkt%29._decode%29%29" class="RktValLink" data-pltdoc="x">decode</a></span>.</p><p>A different but related <span style="font-style: italic">content decoding</span> takes place within
a paragraph or section title. Content decoding is responsible for
converting <span class="RktInBG"><span class="hspace"></span><span class="RktIn">---</span><span class="hspace"></span></span> to an em dash or for converting <span class="RktInBG"><span class="hspace"></span><span class="RktIn">"</span><span class="hspace"></span></span>
and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">'</span><span class="hspace"></span></span> to suitable curly quotes.</p><p>The decoding process for document’s stream is ultimately determined by
the <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=guide&rel=Module_Syntax.html%23%2528part._hash-lang%2529&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktMod">#lang</span></a> line that starts the document. The
<a href="base.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/base</span></a>, <a href="manual.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/manual</span></a>, and
<a href="SIGPLAN_Paper_Format.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/sigplan</span></a> languages all use the same
<span class="RktSym"><a href="decode.html#%28def._%28%28lib._scribble%2Fdecode..rkt%29._decode%29%29" class="RktValLink" data-pltdoc="x">decode</a></span> operation. The <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=scribble-pp&rel=text.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">scribble/text</span></a> language,
however, acts more like a plain-text generator and preprocessor, and it
does not perform any such decoding rules. (For more on
<a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=scribble-pp&rel=text.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">scribble/text</span></a>, see <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=scribble-pp&rel=index.html&version=6.1" class="Sq" data-pltdoc="x">Scribble as Preprocessor</a>.)</p><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p>More precisely, languages like
<a href="base.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/base</span></a> apply <span class="RktSym"><a href="decode.html#%28def._%28%28lib._scribble%2Fdecode..rkt%29._decode%29%29" class="RktValLink" data-pltdoc="x">decode</a></span> only after
lifting out all definitions and imports from the document
stream.</p></blockquote></blockquote></blockquote><p>When the flow decoder is used, after it breaks the input stream into
paragraphs, it applies content decoding to strings within the
paragraph. When content is wrapped with an operation, however, content
decoding does not apply automatically. An operation is responsible for
calling a content or flow decoder as it sees fit. Most operations call
the decoder; for example, <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._italic%29%29" class="RktValLink" data-pltdoc="x">italic</a></span>, <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._bold%29%29" class="RktValLink" data-pltdoc="x">bold</a></span>,
<span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._smaller%29%29" class="RktValLink" data-pltdoc="x">smaller</a></span>, etc., all decode their arguments. Similarly,
<span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._title%29%29" class="RktValLink" data-pltdoc="x">title</a></span> and <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._section%29%29" class="RktValLink" data-pltdoc="x">section</a></span> decode the given content for the
title or section name. The <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._literal%29%29" class="RktValLink" data-pltdoc="x">literal</a></span> and <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._verbatim%29%29" class="RktValLink" data-pltdoc="x">verbatim</a></span>
operators, however, do not decode the given strings. For example,</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._verbatim%29%29" class="RktValLink" data-pltdoc="x">verbatim</a></span><span class="RktPn">{</span><span class="RktMeta">---</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr></table></blockquote><p>renders as</p><blockquote><table cellspacing="0" cellpadding="0"><tr><td><p><span class="stt">---</span></p></td></tr></table></blockquote><p>Don’t confuse decoding with the expansion of @
notation. The source form</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._verbatim%29%29" class="RktValLink" data-pltdoc="x">verbatim</a></span><span class="RktPn">{</span><span class="RktPn">@</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number-%7E3estring%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number->string</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%252B%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">+</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">1</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr></table></blockquote><p>renders as</p><blockquote><table cellspacing="0" cellpadding="0"><tr><td><p><span class="stt">3</span></p></td></tr></table></blockquote><p>because the source is equivalent to</p><blockquote class="SCodeFlow"><p><span class="RktPn">(</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._verbatim%29%29" class="RktValLink" data-pltdoc="x">verbatim</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number-%7E3estring%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number->string</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%252B%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">+</a></span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote><p>where <span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number-%7E3estring%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number->string</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._%252B%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">+</a></span><span class="stt"> </span><span class="RktVal">1</span><span class="stt"> </span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">)</span> is evaluated to produce the
argument to <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._verbatim%29%29" class="RktValLink" data-pltdoc="x">verbatim</a></span>. The <span class="RktInBG"><span class="hspace"></span><span class="RktIn">|{</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">}|</span><span class="hspace"></span></span>
style of brackets is often used with <span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._verbatim%29%29" class="RktValLink" data-pltdoc="x">verbatim</a></span>, because
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">|{</span><span class="hspace"></span></span>...<span class="RktInBG"><span class="hspace"></span><span class="RktIn">}|</span><span class="hspace"></span></span> disables @ notation for
arguments. For example,</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktSym"><a href="base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._verbatim%29%29" class="RktValLink" data-pltdoc="x">verbatim</a></span><span class="RktPn">|{</span><span class="RktMeta">@(number->string</span><span class="hspace"> </span><span class="RktMeta">(+</span><span class="hspace"> </span><span class="RktMeta">1</span><span class="hspace"> </span><span class="RktMeta">2))</span><span class="RktPn">}|</span><span class="RktMeta"></span></td></tr></table></blockquote><p>renders as</p><blockquote><table cellspacing="0" cellpadding="0"><tr><td><p><span class="stt">@(number->string (+ 1 2))</span></p></td></tr></table></blockquote><h4 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""pictures"">1.9<tt> </tt><a name="(part._pictures)"></a>Pictures</h4><p>Any value that is convertable to an image can be used directly within
a Scribble document. Functions from the <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=pict&rel=index.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">pict</span></a>
and <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?tag=%28mod-path._.%272htdp%2Fimage.%27%29&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">2htdp/image</span></a> libraries, for example, generate
images. For example,</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=pict&rel=Pict_Datatype.html%23%2528def._%2528%2528lib._pict%252Fmain..rkt%2529._pict%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">pict</a></span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta"> </span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktMeta">This</span><span class="hspace"> </span><span class="RktMeta">cookie</span><span class="hspace"> </span><span class="RktMeta">has</span><span class="hspace"> </span><span class="RktMeta">lost</span><span class="hspace"> </span><span class="RktMeta">its</span><span class="hspace"> </span><span class="RktMeta">chocolate</span><span class="hspace"> </span><span class="RktMeta">chips:</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">@</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=pict&rel=Pict_Drawing_Adjusters.html%23%2528def._%2528%2528lib._pict%252Fmain..rkt%2529._colorize%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">colorize</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=pict&rel=Basic_Pict_Constructors.html%23%2528def._%2528%2528lib._pict%252Fmain..rkt%2529._filled-ellipse%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">filled-ellipse</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">40</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">40</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">"beige"</span><span class="RktPn">)</span><span class="RktMeta">.</span><span class="RktMeta"></span></td></tr></table></blockquote><p>renders as</p><blockquote><p>This cookie has lost its chocolate chips:
<img style="vertical-align: 0px; margin: -3px -3px -3px -3px;" src="pict.png" alt="image" width="46" height="46"/>.</p></blockquote><h4 x-source-module="(lib "scribblings/scribble/scribble.scrbl")" x-part-tag=""roadmap"">1.10<tt> </tt><a name="(part._roadmap)"></a>Next Steps</h4><p>If your immediate goal is to document a Racket library or write
literate programs, skip to <a href="how-to-doc.html" data-pltdoc="x">Getting Started with Documentation</a>, and then go back to
<a href="reader.html" data-pltdoc="x">@ Syntax</a> and other chapters.</p><p>If you are more interested in producing documents unrelated to
Racket, continue with <a href="reader.html" data-pltdoc="x">@ Syntax</a> and then
<a href="generic-prose.html" data-pltdoc="x">High-Level Scribble API</a>. Move on to <a href="internals.html" data-pltdoc="x">Low-Level Scribble API</a> when you
need more power.</p><p>If you are interested in text generation and preprocessing, continue
with <a href="reader.html" data-pltdoc="x">@ Syntax</a>, but then switch to
<a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=scribble-pp&rel=index.html&version=6.1" class="Sq" data-pltdoc="x">Scribble as Preprocessor</a>.</p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="index.html" title="backward to "Scribble: The Racket Documentation Tool"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Scribble: The Racket Documentation Tool"" data-pltdoc="x">up</a> <a href="reader.html" title="forward to "2 @ Syntax"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|