Better robustness when backends encounter a Unicode character not
[sgt/halibut] / doc / input.but
CommitLineData
11f2edfa 1\C{input} Halibut input format
2
3This chapter describes the format in which you should write
4documents to be processed by Halibut.
5
6\H{input-basics} The basics
7
8Halibut's input files mostly look like ordinary ASCII text files;
9you can edit them with any text editor you like.
10
339cbe09 11Writing \i{paragraphs of ordinary text} is very simple: you just
12write ordinary text in the ordinary way. You can wrap a paragraph
13across more than one line using \i{line breaks} in the text file,
14and Halibut will ignore this when it \I{wrapping paragraphs}rewraps
15the paragraph for each output format. To separate paragraphs, use a
16\i{blank line} (i.e. two consecutive line breaks). For example, a
17fragment of Halibut input looking like this:
11f2edfa 18
19\c This is a line of text.
20\c This is another line of text.
21\c
22\c This line is separated from the previous one by a blank line.
23
24will produce two paragraphs looking like this:
25
26\quote{
27This is a line of text.
28This is another line of text.
29
30This line is separated from the previous one by a blank line.
31}
32
33The first two lines of the input have been merged together into a
34single paragraph, and the line break in the input file was treated
35identically to the spaces between the individual words.
36
339cbe09 37Halibut is designed to have very few \I{escaping, special
38characters}\i{special characters}. The only printable characters in
39Halibut input which will not be treated exactly literally in the
40output are the \i{backslash} (\c{\\}) and the \i{braces} (\c{\{} and
41\c{\}}). If you do not use these characters, \e{everything} else you
42might type in normal ASCII text is perfectly safe. If you do need to
43use any of those three characters in your document, you will have to
44precede each one with a backslash. Hence, for example, you could
45write
11f2edfa 46
47\c This \\ is a backslash, and these are \{braces\}.
48
49and Halibut would generate the text
50
51\quote{
52This \\ is a backslash, and these are \{braces\}.
53}
54
339cbe09 55\H{input-inline} Simple \i{inline formatting commands}
11f2edfa 56
57Halibut formatting commands all begin with a backslash, followed by
58a word or character identifying the command. Some of them then use
59braces to surround one or more pieces of text acted on by the
60command. (In fact, the \c{\\\\}, \c{\\\{} and \c{\\\}} sequences you
61met in \k{input-basics} are themselves formatting commands.)
62
63This section describes some simple formatting commands you can use
64in Halibut documents. The commands in this section are \e{inline}
65commands, which means you can use them in the middle of a paragraph.
66\K{input-para} describes some \e{paragraph} commands, which affect a
67whole paragraph at a time.
68
c63ce2c7 69Many of these commands are followed by a pair of braces surrounding
339cbe09 70some text. In all cases, it is perfectly safe to have a \i{line break}
c63ce2c7 71(in the input file) within those braces; Halibut will treat that
72exactly the same as a space. For example, these two paragraphs will
73be treated identically:
74
75\c Here is some \e{emphasised
76\c text}.
77\c
78\c Here is some \e{emphasised text}.
79
11f2edfa 80\S{input-emph} \c{\\e}: Emphasising text
81
fc8e7adb 82Possibly the most obvious piece of formatting you might want
83to use in a document is \i\e{emphasis}.
84To emphasise text, you use the \i\c{\\e} command, and follow it up
85with the text to be emphasised in braces. For example, the first
86sentence in this paragraph was generated using the Halibut input
11f2edfa 87
fc8e7adb 88\c Possibly the most obvious piece of formatting you might want
89\c to use in a document is \e{emphasis}.
11f2edfa 90
339cbe09 91\S{input-code} \c{\\c} and \c{\\cw}: Displaying \i{computer code} inline
11f2edfa 92
93Halibut was primarily designed to produce software manuals. It can
94be used for other types of document as well, but software manuals
95are its speciality.
96
97In software manuals, you often want to format text in a way that
339cbe09 98indicates that it is something you might see displayed \i{verbatim}
99on a computer screen. In printed manuals, this is typically done by
100setting that text in a font which is obviously \I{fixed-width
101font}fixed-width. This provides a visual cue that the text being
102displayed is code, and it also ensures that punctuation marks are
103clearly separated and shown individually (so that a user can copy
104the text accurately and conveniently).
11f2edfa 105
106Halibut provides \e{two} commands for this, which are subtly
339cbe09 107different. The names of those commands are \i\c{\\c} (\q{code}) and
108\i\c{\\cw} (\q{\i{weak code}}). You use them just like \c{\\e}, by
11f2edfa 109following them with some text in braces. For example, this...
110
111\c This sentence contains some \c{code} and some \cw{weak code}.
112
113... produces this:
114
115\quote{
116This sentence contains some \c{code} and some \cw{weak code}.
117}
118
119The distinction between code and weak code is mainly important when
120producing plain text output. Plain text output is typically viewed
121in a fixed-width font, so there is no need (and no way) to change
122font in order to make the order of punctuation marks clear. However,
123marking text as code is also \e{sometimes} done to provide a visual
124distinction between it and the text around it, so that the reader
125knows where the literal computer text starts and stops; and in plain
126text, this cannot be done by changing font, so there needs to be an
127alternative way.
128
e21ccf73 129So in the plain text output format, things marked as code (\c{\\c})
130will be surrounded by quote marks, so that it's obvious where they
131start and finish. Things marked as weak code (\c{\\cw}) will not
132look any different from normal text.
11f2edfa 133
134I recommend using weak code for any application where it is
135\e{obvious} that the text is literal computer input or output. For
136example, if the text is capitalised, that's usually good enough. If
137I talk about the Pentium's \cw{EAX} and \cw{EDX} registers, for
138example, you don't need quotes to notice that those are special; so
139I would write that in Halibut as \q{\c{the Pentium's \\cw\{EAX\} and
140\\cw\{EDX\} registers}}. But if I'm talking about the Unix command
141\c{man}, which is an ordinary English word in its own right, a reader
142might be slightly confused if it appeared in the middle of a
143sentence undecorated; so I would write that as \q{\c{the Unix command
144\\c\{man\}}}.
145
146In summary:
147
148\b \c{\\c} means \q{this text \e{must} be visually distinct from the
149text around it}. Halibut's various output formats will do this by
150changing the font if possible, or by using quotes if not.
151
152\b \c{\\cw} means \q{it would be nice to display this text in a
153fixed-width font if possible, but it's not essential}.
154
fc8e7adb 155In really extreme cases, you might want Halibut to use \i{quotation
156marks} even in output formats which can change font. In
157\k{input-date}, for example, I mention the special formatting
158command \q{\cw{\\.}}. If that appeared at the end of a sentence
159\e{without} the quotes, then the two adjacent full stops would look
160pretty strange even if they were obviously in different fonts. So I
161used the \c{\\q} command to provide my own set of quotes, and then
162used \c{\\cw} rather than \c{\\c} to ensure that none of Halibut's
163output formats would add another set of quotes:
164
165\c the special formatting command \q{\cw{\\.}}.
166
11f2edfa 167There is a separate mechanism for displaying computer code in an
168entire paragraph; see \k{input-codepara} for that one.
169
339cbe09 170\S{input-quotes} \c{\\q}: \ii{Quotation marks}
11f2edfa 171
172Halibut's various output formats don't all use the same conventions
173for displaying text in ordinary quotation marks (\q{like these}).
174Some output formats have access to proper matched quote characters,
175whereas others are restricted to using plain ASCII. Therefore, it is
176not ideal to use the ordinary ASCII double quote character in your
177document (although you can if you like).
178
339cbe09 179Halibut provides the formatting command \i\c{\\q} to indicate quoted
11f2edfa 180text. If you write
181
182\c Here is some \q{text in quotes}.
183
184then Halibut will print
185
186\quote{
187Here is some \q{text in quotes}.
188}
189
190and in every output format Halibut generates, it will choose the
191best quote characters available to it in that format.
192
339cbe09 193You can still use ordinary ASCII \i{double quotes} if you prefer; or
194you could even use the \c{\\u} command (see \k{input-unicode}) to
195generate \i{Unicode matched quotes} (single or double) and fall back
196to the normal ASCII one if they aren't available. But I recommend
197using the built-in \c{\\q} command in most cases, because it's
198simple and does the best it can everywhere.
11f2edfa 199
200(Note that if you're using the \c{\\c} or \c{\\cw} commands to
201display literal computer code, you probably \e{will} want to use
339cbe09 202literal \i{ASCII quote characters}, because it is likely to matter
11f2edfa 203precisely which quote character you use.)
204
339cbe09 205\S{input-nonbreaking} \c{\\-} and \c{\\_}: \ii{Non-breaking hyphens}
206and \I{non-breaking spaces}spaces
11f2edfa 207
208If you use an ordinary hyphen in the middle of a word (such as
209\q{built-in}), Halibut's output formats will feel free to break a
339cbe09 210line after that hyphen when \i{wrapping paragraphs}. This is fine
211for a word like \q{built-in}, but if you were displaying some
212literal computer code such as the Emacs command
11f2edfa 213\c{M\-x\_psychoanalyze\-pinhead}, you might prefer to see the whole
214hyphenated word treated as an unbreakable block. In some cases, you
215might even want to prevent the \e{space} in that command from
216becoming a line break.
217
339cbe09 218For these purposes, Halibut provides the commands \i\c{\\-} and
219\i\c{\\_}, which generate a non-breaking hyphen and a non-breaking
11f2edfa 220space respectively. So the above Emacs command might be written as
221
222\c the Emacs command \c{M\-x\_psychoanalyze\-pinhead}
223
224Unfortunately, some of Halibut's output formats do not support
225non-breaking hyphens, and others don't support \e{breaking} hyphens!
226So Halibut cannot promise to honour these commands in all situations.
227All it can do is make a best effort.
228
339cbe09 229\S{input-date} \c{\\date}: Automatic \i{date} generation
11f2edfa 230
231Sometimes you might want your document to give an up-to-date
232indication of the date on which it was run through Halibut.
233
339cbe09 234Halibut supplies the \i\c{\\date} command to do this. In its
235simplest form, you simply say
11f2edfa 236
237\c This document was generated on \date.
238
239and Halibut generates something like
240
241\quote{
242This document was generated on \date.
243}
244
acbb8b72 245You can follow the \c{\\date} command directly with punctuation (as
246in this example, where it is immediately followed by a full stop),
247but if you try to follow it with an alphabetic or numeric character
248(such as writing \c{\\dateZ}) then Halibut will assume you are
249trying to invoke the name of a macro command you have defined
250yourself, and will complain if no such command exists. To get round
fc8e7adb 251this you can use the special \q{\cw{\\.}} do-nothing command. See
acbb8b72 252\k{input-macro} for more about general Halibut command syntax and
fc8e7adb 253\q{\cw{\\.}}.
acbb8b72 254
11f2edfa 255If you would prefer the date to be generated in a specific format,
256you can follow the \c{\\date} command with a format specification in
257braces. The format specification will be run through the standard C
339cbe09 258function \i\c{strftime}, so any format acceptable to that function
259is acceptable here as well. I won't document the format here,
260because the details vary from computer to computer (although there
261is a standard core which should be supported everywhere). You should
262look at your local system's manual for \c{strftime} for details.
11f2edfa 263
264Here's an example which generates the date in the international
339cbe09 265standard \i{ISO 8601} format:
11f2edfa 266
267\c This document was generated on \date{%Y-%m-%d %H:%M:%S}.
268
269And here's some sample output from that command:
270
271\quote{
272This document was generated on \date{%Y-%m-%d %H:%M:%S}.
273}
274
339cbe09 275\S{input-weblink} \c{\\W}: \i{WWW hyperlinks}
11f2edfa 276
339cbe09 277Since one of Halibut's output formats is \i{HTML}, it's obviously
278useful to be able to provide \I{linking to web sites}links to
279arbitrary \i{web sites} in a Halibut document.
11f2edfa 280
339cbe09 281This is done using the \i\c{\\W} command. \c{\\W} expects to be
11f2edfa 282followed by \e{two} sets of braces. In the first set of braces you
339cbe09 283put a \i{URL}; in the second set you put the text which should be a
284\i{hyperlink}. For example, you might write
11f2edfa 285
286\c Try searching on \W{http://www.google.com/}{Google}.
287
288and Halibut would generate
289
290\quote{
291Try searching on \W{http://www.google.com/}{Google}.
292}
293
294Note that hyperlinks, like the non-breaking commands discussed in
295\k{input-nonbreaking}, are \e{discretionary}: if an output format
296does not support them then they will just be left out completely. So
297unless you're \e{only} intending to use the HTML output format, you
298should avoid storing vital content in the URL part of a \c{\\W}
299command. The Google example above is reasonable (because most users
300are likely to be able to find Google for themselves even without a
301convenient hyperlink leading straight there), but if you really need
302to direct users to a specific web site, you will need to give the
303URL in actual displayed text (probably displayed as code as well).
304However, there's nothing to stop you making it a hyperlink \e{as
305well} for the convenience of HTML readers.
306
307The \c{\\W} command supports a piece of extra syntax to make this
308convenient for you. You can specify \c{\\c} or \c{\\cw} \e{between}
309the first and second pairs of braces. For example, you might write
310
311\c Google is located at \W{http://www.google.com/}\cw{www.google.com}.
312
313and Halibut would produce
314
315\quote{
316Google is located at \W{http://www.google.com/}\cw{www.google.com}.
317}
318
b80802ba 319If you want the link text to be an index term as well, you can also
320specify \c{\\i} or \c{\\ii}; this has to come before \c{\\c} or
321\c{\\cw} if both are present. (See \k{input-index} for more about
322indexing.)
323
339cbe09 324\S{input-unicode} \c{\\u}: Specifying arbitrary \i{Unicode}
325characters
11f2edfa 326
327When Halibut is finished, it should have full Unicode support. You
339cbe09 328should be able to specify any (reasonably well known) \i{character
329set} for your input document, and Halibut should convert it all to
11f2edfa 330Unicode as it reads it in. Similarly, you should be able to specify
331the character set you want for each output format and have all the
332conversion done automatically.
333
334Currently, none of this is actually supported. Input text files are
339cbe09 335assumed to be in \i{ISO 8859-1}, and each output format has its own
11f2edfa 336non-configurable character set (although the HTML output can use the
337\c{Ӓ} mechanism to output any Unicode character it likes).
338
339If you need to specify a Unicode character in your input document
340which is not supported by the input character set, you can use the
339cbe09 341\i\c{\\u} command to do this. \c{\\u} expects to be followed by a
11f2edfa 342sequence of hex digits; so that \c{\\u0041}, for example, denotes
343the Unicode character \cw{0x0041}, which is the capital letter A.
344
345If a Unicode character specified in this way is not supported in a
346particular \e{output} format, you probably don't just want it to be
347omitted. So you can put a pair of braces after the \c{\\u} command
339cbe09 348containing \i{fallback text}. For example, to specify an amount of
349money in euros, you might write this:
11f2edfa 350
16ea3abe 351\c This is likely to cost \u20AC{EUR\_}2500 at least.
11f2edfa 352
353Halibut will render that as a Euro sign \e{if available}, and
16ea3abe 354the text \q{EUR\_} if not. In the output format you're currently
11f2edfa 355reading in, the above input generates this:
356
357\quote{
16ea3abe 358This is likely to cost \u20AC{EUR\_}2500 at least.
11f2edfa 359}
360
361If you read it in other formats, you may see different results.
362
339cbe09 363\S{input-xref} \i\c{\\k} and \i\c{\\K}: \ii{Cross-references} to
364other sections
11f2edfa 365
339cbe09 366\K{intro-features} mentions that Halibut \I{section numbers}numbers
367the sections of your document automatically, and can generate
368cross-references to them on request. \c{\\k} and \c{\\K} are the
369commands used to generate those cross-references.
11f2edfa 370
371To use one of these commands, you simply follow it with a pair of
372braces containing the keyword for the section in question. For
373example, you might write something like
374
375\c \K{input-xref} expands on \k{intro-features}.
376
377and Halibut would generate something like
378
379\quote{
380\K{input-xref} expands on \k{intro-features}.
381}
382
339cbe09 383The \i{keywords} \c{input-xref} and \c{intro-features} are
384\i{section keywords} used in this manual itself. In your own
385document, you would have supplied a keyword for each one of your own
386sections, and you would provide your own keywords for the \c{\\k}
387command to work on.
11f2edfa 388
389The difference between \c{\\k} and \c{\\K} is simply that \c{\\K}
390starts the cross-reference text with a capital letter; so you would
391use \c{\\K} at the beginning of a sentence, and \c{\\k} everywhere
392else.
393
394In output formats which permit it, cross-references act as
339cbe09 395\i{hyperlinks}, so that clicking the mouse on a cross-reference
396takes you straight to the referenced section.
11f2edfa 397
398The \c{\\k} commands are also used for referring to entries in a
339cbe09 399\i{bibliography} (see \k{input-biblio} for more about
400bibliographies), and can also be used for referring to an element of
401a \i{numbered list} by its number (see \k{input-list-number} for
402more about numbered lists).
11f2edfa 403
404See \k{input-sections} for more about chapters and sections.
405
339cbe09 406\S{input-inline-comment} \i\c{\\#}: Inline comments
11f2edfa 407
339cbe09 408If you want to include \i{comments} in your Halibut input, to be seen
11f2edfa 409when reading it directly but not copied into the output text, then
410you can use \c{\\#} to do this. If you follow \c{\\#} with text in
411braces, that text will be ignored by Halibut.
412
413For example, you might write
414
fc8e7adb 415\c The typical behaviour of an antelope \#{do I mean
416\c gazelle?} is...
11f2edfa 417
418and Halibut will simply leave out the aside about gazelles, and will
419generate nothing but
420
421\quote{
fc8e7adb 422The typical behaviour of an antelope \#{do I mean
423gazelle?} is...
11f2edfa 424}
425
acbb8b72 426This command will respect nested braces, so you can use it to
427comment out sections of Halibut markup:
428
429\c This function is \#{very, \e{very}} important.
430
431In this example, the comment lasts until the final closing brace (so
432that the whole \q{very, \e{very}} section is commented out).
433
11f2edfa 434The \c{\\#} command can also be used to produce a whole-paragraph
435comment; see \k{input-commentpara} for details of that.
436
339cbe09 437\H{input-para} \ii{Paragraph-level commands}
11f2edfa 438
439This section describes Halibut commands which affect an entire
440paragraph, or sometimes even \e{more} than one paragraph, at a time.
441
339cbe09 442\S{input-codepara} \i\c{\\c}: Displaying whole \I{code
443paragraphs}paragraphs of \i{computer code}
11f2edfa 444
445\K{input-code} describes a mechanism for displaying computer code in
446the middle of a paragraph, a few words at a time.
447
448However, this is often not enough. Often, in a computer manual, you
339cbe09 449really want to show several lines of code in a \i{display
450paragraph}.
11f2edfa 451
452This is also done using the \c{\\c} command, in a slightly different
453way. Instead of using it in the middle of a paragraph followed by
454braces, you can use it at the start of each line of a paragraph. For
455example, you could write
456
457\c \c #include <stdio.h>
458\c \c
459\c \c int main(int argc, char **argv) {
460\c \c printf("hello, world\n");
461\c \c return 0;
462\c \c }
463
464and Halibut would generate
465
466\quote{
467
468\c #include <stdio.h>
469\c
470\c int main(int argc, char **argv) {
471\c printf("hello, world\n");
472\c return 0;
473\c }
474
475}
476
477Note that the above paragraph makes use of a backslash and a pair of
478braces, and does \e{not} need to escape them in the way described in
479\k{input-basics}. This is because code paragraphs formatted in this
480way are a special case; the intention is that you can just copy and
fc8e7adb 481paste a lump of code out of your program, put \q{\cw{\\c }} at the
11f2edfa 482start of every line, and simply \e{not have to worry} about the
483details - you don't have to go through the whole block looking for
484characters to escape.
485
486Since a backslash inside a code paragraph generates a literal
487backslash, this means you cannot use any other Halibut formatting
488commands inside a code paragraph. In particular, if you want to
489emphasise a particular word in the paragraph, you can't do that
490using \c{\\e} (\k{input-emph}) in the normal way.
491
339cbe09 492Therefore, Halibut provides an alternative means of \i{emphasis in
493code paragraphs}. Each line beginning with \c{\\c} can optionally be
11f2edfa 494followed by a single line beginning with \c{\\e}, indicating the
495emphasis in that line. The emphasis line contains the letters \c{b}
496and \c{i} (for \q{bold} and \q{italic}, although some output formats
339cbe09 497might render \c{i} as underlining instead of italics), positioned to
498line up under the parts of the text that you want emphasised.
11f2edfa 499
339cbe09 500For example, if you wanted to do \i{syntax highlighting} on the
501above C code by highlighting the preprocessor command in italic and
502the keywords in bold, you might do it like this:
11f2edfa 503
504\c \c #include <stdio.h>
505\c \e iiiiiiiiiiiiiiiiii
506\c \c
507\c \c int main(int argc, char **argv) {
508\c \e bbb bbb bbbb
509\c \c printf("hello, world\n");
510\c \c return 0;
511\c \e bbbbbb
512\c \c }
513
514and Halibut would generate:
515
516\quote{
517
518\c #include <stdio.h>
519\e iiiiiiiiiiiiiiiiii
520\c
521\c int main(int argc, char **argv) {
522\e bbb bbb bbbb
523\c printf("hello, world\n");
524\c return 0;
525\e bbbbbb
526\c }
527
528}
529
530Note that not every \c{\\c} line has to be followed by a \c{\\e}
531line; they're optional.
532
533Also, note that highlighting within a code paragraph is
534\e{discretionary}. Not all of Halibut's output formats can support
535it (plain text, in particular, has no sensible way to do it). Unless
536you know you are using a restricted range of output formats, you
537should use highlighting in code paragraphs \e{only} as a visual aid,
538and not rely on it to convey any vital semantic content.
539
339cbe09 540\S{input-lists} \c{\\b}, \c{\\n}, \c{\\dt}, \c{\\dd}, \c{\\lcont}:
541\ii{Lists}
11f2edfa 542
543Halibut supports bulletted lists, numbered lists and description
544lists.
545
339cbe09 546\S2{input-list-bullet} \i\c{\\b}: \ii{Bulletted lists}
11f2edfa 547
548To create a bulletted list, you simply prefix each paragraph
549describing a bullet point with the command \c{\\b}. For example, this
550Halibut input:
551
552\c Here's a list:
553\c
554\c \b One.
555\c
556\c \b Two.
557\c
558\c \b Three.
559
560would produce this Halibut output:
561
562\quote{
563Here's a list:
564
565\b One.
566
567\b Two.
568
569\b Three.
570}
571
339cbe09 572\S2{input-list-number} \i\c{\\n}: \ii{Numbered lists}
11f2edfa 573
574Numbered lists are just as simple: instead of \c{\\b}, you use
575\c{\\n}, and Halibut takes care of getting the numbering right for
576you. For example:
577
578\c Here's a list:
579\c
580\c \n One.
581\c
582\c \n Two.
583\c
584\c \n Three.
585
586This produces the Halibut output:
587
588\quote{
589Here's a list:
590
591\n One.
592
593\n Two.
594
595\n Three.
596}
597
598The disadvantage of having Halibut sort out the list numbering for
599you is that if you need to refer to a list item by its number, you
fc8e7adb 600can't reliably know the number in advance (because if you later add
601another item at the start of the list, the numbers will all change).
602To get round this, Halibut allows an optional keyword in braces
603after the \c{\\n} command. This keyword can then be referenced using
604the \c{\\k} or \c{\\K} command (see \k{input-xref}) to provide the
605number of the list item. For example:
11f2edfa 606
607\c Here's a list:
608\c
609\c \n One.
610\c
611\c \n{this-one} Two.
612\c
613\c \n Three.
614\c
615\c \n Now go back to step \k{this-one}.
616
617This produces the following output:
618
619\quote{
620Here's a list:
621
622\n One.
623
624\n{this-one} Two.
625
626\n Three.
627
628\n Now go back to step \k{this-one}.
629}
630
acbb8b72 631The keyword you supply after \c{\\n} is allowed to contain escaped
632special characters (\c{\\\\}, \c{\\\{} and \c{\\\}}), but should not
633contain any other Halibut markup. It is intended to be a word or two
634of ordinary text. (This also applies to keywords used in other
635commands, such as \c{\\B} and \c{\\C}).
636
339cbe09 637\S2{input-list-description} \i\c{\\dt} and \i\c{\\dd}:
638\ii{Description lists}
11f2edfa 639
339cbe09 640To write a description list, you prefix alternate paragraphs with
641the \c{\\dt} (\q{described thing}) and \c{\\dd} (description)
642commands. For example:
11f2edfa 643
644\c \dt Pelican
645\c
646\c \dd This is a large bird with a big beak.
647\c
648\c \dt Panda
649\c
650\c \dd This isn't.
651
652This produces the following output:
653
654\quote{
655
656\dt Pelican
657
658\dd This is a large bird with a big beak.
659
660\dt Panda
661
662\dd This isn't.
663
664}
665
339cbe09 666\S2{input-list-continuation} \ii{Continuing list items} into further
11f2edfa 667paragraphs
668
669All three of the above list types assume that each list item is a
670single paragraph. For a short, snappy list in which each item is
671likely to be only one or two words, this is perfectly sufficient;
672but occasionally you will find you want to include several
339cbe09 673paragraphs in a single list item, or even to \I{nested lists}nest
674other types of paragraph (such as code paragraphs, or other lists)
675inside a list item.
11f2edfa 676
339cbe09 677To do this, you use the \i\c{\\lcont} command. This is a command
678which can span \e{multiple} paragraphs.
11f2edfa 679
680After the first paragraph of a list item, include the text
681\c{\\lcont\{}. This indicates that the subsequent paragraph(s) are a
682\e{continuation} of the list item that has just been seen. So you
683can include further paragraphs, and eventually include a closing
684brace \c{\}} to finish the list continuation. After that, you can
685either continue adding other items to the original list, or stop
686immediately and return to writing normal paragraphs of text.
687
688Here's a (long) example.
689
690\c Here's a list:
691\c
692\c \n One. This item is followed by a code paragraph:
693\c
694\c \lcont{
695\c
696\c \c code
697\c \c paragraph
698\c
699\c }
700\c
701\c \n Two. Now when I say \q{two}, I mean:
702\c
703\c \lcont{
704\c
705\c \n Two, part one.
706\c
707\c \n Two, part two.
708\c
709\c \n Two, part three.
710\c
711\c }
712\c
713\c \n Three.
714
715The output produced by this fragment is:
716
717\quote{
718
719Here's a list:
720
721\n One. This item is followed by a code paragraph:
722
723\lcont{
724
725\c code
726\c paragraph
727
728}
729
730\n Two. Now when I say \q{two}, I mean:
731
732\lcont{
733
734\n Two, part one.
735
736\n Two, part two.
737
738\n Two, part three.
739
740}
741
742\n Three.
743
744}
745
fc8e7adb 746This syntax might seem a little bit inconvenient, and perhaps
11f2edfa 747counter-intuitive: you might expect the enclosing braces to have to
748go around the \e{whole} list item, rather than everything except the
749first paragraph.
750
751\c{\\lcont} is a recent addition to the Halibut input language;
752previously, \e{all} lists were required to use no more than one
753paragraph per list item. So it's certainly true that this feature
754looks like an afterthought because it \e{is} an afterthought, and
755it's possible that if I'd been designing the language from scratch
756with multiple-paragraph list items in mind, I would have made it
757look different.
758
759However, the advantage of doing it this way is that no enclosing
760braces are required in the \e{common} case: simple lists with only
761one paragraph per item are really, really easy to write. So I'm not
762too unhappy with the way it turned out; it obeys the doctrine of
763making simple things simple, and difficult things possible.
764
765Note that \c{\\lcont} can only be used on \c{\\b}, \c{\\n} and
766\c{\\dd} paragraphs; it cannot be used on \c{\\dt}.
767
339cbe09 768\S{input-rule} \i\c{\\rule}: \ii{Horizontal rules}
11f2edfa 769
770The command \c{\\rule}, appearing on its own as a paragraph, will
771cause a horizontal rule to be drawn, like this:
772
773\c Some text.
774\c
775\c \rule
776\c
777\c Some more text.
778
779This produces the following output:
780
781\quote{
782
783Some text.
784
785\rule
786
787Some more text.
788
789}
790
339cbe09 791\S{input-quote} \i\c{\\quote}: \ii{Indenting multiple paragraphs} as a
792long \i{quotation}
11f2edfa 793
794Quoting verbatim text using a code paragraph (\k{input-codepara}) is
795not always sufficient for your quoting needs. Sometimes you need to
796quote some normally formatted text, possibly in multiple paragraphs.
339cbe09 797This is similar to HTML's \i\cw{<BLOCKQUOTE>} command.
11f2edfa 798
799To do this, you can use the \c{\\quote} command. Like \c{\\lcont},
800this is a command which expects to enclose at least one paragraph
801and possibly more. Simply write \c{\\quote\{} at the beginning of
802your quoted section, and \c{\}} at the end, and the paragraphs in
803between will be formatted to indicate that they are a quotation.
804
805(This very manual, in fact, uses this feature a lot: all of the
fc8e7adb 806examples of Halibut input followed by Halibut output have the output
807quoted using \c{\\quote}.)
11f2edfa 808
809Here's some example Halibut input:
810
811\c In \q{Through the Looking Glass}, Lewis Carroll wrote:
812\c
813\c \quote{
814\c
815\c \q{The question is,} said Alice, \q{whether you \e{can} make
816\c words mean so many different things.}
817\c
fc8e7adb 818\c \q{The question is,} said Humpty Dumpty, \q{who is to be
819\c master - that's all.}
11f2edfa 820\c
821\c }
822\c
823\c So now you know.
824
825The output generated by this is:
826
827\quote{
828
829In \q{Through the Looking Glass}, Lewis Carroll wrote:
830
831\quote{
832
833\q{The question is,} said Alice, \q{whether you \e{can} make
834words mean so many different things.}
835
fc8e7adb 836\q{The question is,} said Humpty Dumpty, \q{who is to be
837master - that's all.}
11f2edfa 838
839}
840
841So now you know.
842
843}
844
339cbe09 845\S{input-sections} \i\c{\\C}, \i\c{\\H}, \i\c{\\S}, \i\c{\\A},
846\i\c{\\U}: Chapter and \i{section headings}
11f2edfa 847
339cbe09 848\K{intro-features} mentions that Halibut \I{section
849numbering}numbers the sections of your document automatically, and
850can generate cross-references to them on request; \k{input-xref}
851describes the \c{\\k} and \c{\\K} commands used to generate the
852cross-references. This section describes the commands used to set up
853the sections in the first place.
11f2edfa 854
855A paragraph beginning with the \c{\\C} command defines a chapter
856heading. The \c{\\C} command expects to be followed by a pair of
857braces containing a keyword for the chapter; this keyword can then
858be used with the \c{\\k} and \c{\\K} commands to generate
859cross-references to the chapter. After the closing brace, the rest
860of the paragraph is used as the displayed chapter title. So the
861heading for the current chapter of this manual, for example, is
862written as
863
864\c \C{input} Halibut input format
865
866and this allows me to use the command \c{\\k\{input\}} to generate a
867cross-reference to that chapter somewhere else.
868
acbb8b72 869The \I{keyword syntax}keyword you supply after one of these commands
870is allowed to contain escaped special characters (\c{\\\\}, \c{\\\{}
871and \c{\\\}}), but should not contain any other Halibut markup. It
872is intended to be a word or two of ordinary text. (This also applies
873to keywords used in other commands, such as \c{\\B} and \c{\\n}).
874
11f2edfa 875The next level down from \c{\\C} is \c{\\H}, for \q{heading}. This
876is used in exactly the same way as \c{\\C}, but section headings
877defined with \c{\\H} are considered to be part of a containing
878chapter, and will be numbered with a pair of numbers. After \c{\\H}
879comes \c{\\S}, and if necessary you can then move on to \c{\\S2},
880\c{\\S3} and so on.
881
882For example, here's a sequence of heading commands. Normally these
883commands would be separated at least by blank lines (because each is
884a separate paragraph), and probably also by body text; but for the
885sake of brevity, both of those have been left out in this example.
886
887\c \C{foo} Using Foo
888\c \H{foo-intro} Introduction to Foo
889\c \H{foo-running} Running the Foo program
890\c \S{foo-inter} Running Foo interactively
891\c \S{foo-batch} Running Foo in batch mode
892\c \H{foo-trouble} Troubleshooting Foo
893\c \C{bar} Using Bar instead of Foo
894
895This would define two chapters with keywords \c{foo} and \c{bar},
896which would end up being called Chapter 1 and Chapter 2 (unless
897there were other chapters before them). The sections \c{foo-intro},
898\c{foo-running} and \c{foo-trouble} would be referred to as Section
8991.1, Section 1.2 and Section 1.3 respectively; the subsections
900\c{foo-inter} and \c{foo-batch} would be Section 1.2.1 and Section
339cbe09 9011.2.2. If there had been a \i\c{\\S2} command within one of those,
902it would have been something like Section 1.2.1.1.
11f2edfa 903
904If you don't like the switch from \c{\\H} to \c{\\S}, you can use
905\c{\\S1} as a synonym for \c{\\S} and \c{\\S0} as a synonym for
906\c{\\H}. Chapters are still designated with \c{\\C}, because they
907need to be distinguished from other types of chapter such as
908appendices. (Personally, I like the \c{\\C},\c{\\H},\c{\\S} notation
909because it encourages me to think of my document as a hard disk :-)
910
339cbe09 911You can define an \i{appendix} by using \c{\\A} in place of \c{\\C}.
11f2edfa 912This is no different from a chapter except that it's given a letter
913instead of a number, and cross-references to it will say \q{Appendix
914A} instead of \q{Chapter 9}. Subsections of an appendix will be
915numbered \q{A.1}, \q{A.2}, \q{A.2.1} and so on.
916
339cbe09 917\I{renaming sections}If you want a particular section to be referred
918to as something other than a \q{chapter}, \q{section} or
919\q{appendix}, you can include a second pair of braces after the
920keyword. For example, if you're \i{writing a FAQ} chapter and you
921want cross-references between questions to refer to \q{question
9221.2.3} instead of \q{section 1.2.3}, you can write each section
923heading as
11f2edfa 924
925\c \S{question-about-fish}{Question} What about fish?
926
927(The word \q{Question} should be given with an initial capital
928letter. Halibut will lower-case it when you refer to it using
929\c{\\k}, and will leave it alone if you use \c{\\K}.)
930
931This technique allows you to change the designation of
932\e{particular} sections. To make an overall change in what \e{every}
933section is called, see \k{input-config}.
934
339cbe09 935Finally, the \c{\\U} command defines an \I{unnumbered
936chapter}\e{unnumbered} chapter. These sometimes occur in books, for
937specialist purposes such as \q{Bibliography} or
938\q{Acknowledgements}. \c{\\U} does not expect a keyword argument,
939because there is no sensible way to generate an automatic
940cross-reference to such a chapter anyway.
11f2edfa 941
8902e0ed 942\S{input-blurb} \c{\\copyright}, \c{\\title}, \c{\\versionid}:
339cbe09 943Miscellaneous \i{blurb commands}
11f2edfa 944
339cbe09 945These three commands define a variety of \i{special paragraph
946types}. They are all used in the same way: you put the command at
947the start of a paragraph, and then just follow it with normal text,
948like this:
11f2edfa 949
950\c \title My First Manual
951
8902e0ed 952The three special paragraph types are:
11f2edfa 953
339cbe09 954\dt \i\cw{\\title}
11f2edfa 955
956\dd This defines the overall title of the entire document. This
957title is treated specially in some output formats (for example, it's
958used in a \cw{<title>} tag in the HTML output), so it needs a
959special paragraph type to point it out.
960
339cbe09 961\dt \i\cw{\\copyright}
11f2edfa 962
963\dd This command indicates that the paragraph attached to it
339cbe09 964contains a \i{copyright statement} for the document. This text is
9057a0a8 965displayed inline where it appears, exactly like a normal paragraph;
966but in some output formats it is given additional special treatment.
967For example, Windows Help files have a standard slot in which to
968store a copyright notice, so that other software can display it
969prominently.
11f2edfa 970
339cbe09 971\dt \i\cw{\\versionid}
11f2edfa 972
973\dd This command indicates that the paragraph contains a version
974identifier, such as those produced by CVS (of the form \c{$\#{hope this
975defuses CVS}Id: thingy.but,v 1.6 2004/01/01 16:47:48 simon Exp $}).
976This text will be tucked away somewhere unobtrusive, so that anyone
977wanting to (for example) report errors to the document's author can
339cbe09 978pick out the \i{version IDs} and send them as part of the report, so
11f2edfa 979that the author can tell at a glance which revision of the document
980is being discussed.
981
339cbe09 982\S{input-commentpara} \i\c{\\#}: Whole-paragraph \i{comments}
11f2edfa 983
984\K{input-inline-comment} describes the use of the \c{\\#} command to
985put a short comment in the middle of a paragraph.
986
987If you need to use a \e{long} comment, Halibut also allows you to
988use \c{\\#} without braces, to indicate that an entire paragraph is
989a comment, like this:
990
991\c Here's a (fairly short) paragraph which will be displayed.
992\c
993\c \# Here's a comment paragraph which will not be displayed, no
fc8e7adb 994\c matter how long it goes on. All I needed to indicate this was
995\c the single \# at the start of the paragraph; I don't need one
996\c on every line or anything like that.
11f2edfa 997\c
998\c Here's another displayed paragraph.
999
1000When run through Halibut, this produces the following output:
1001
1002\quote{
1003
1004Here's a (fairly short) paragraph which will be displayed.
1005
1006\# Here's a comment paragraph which will not be displayed, no
fc8e7adb 1007matter how long it goes on. All I needed to indicate this was
1008the single \# at the start of the paragraph; I don't need one
1009on every line or anything like that.
11f2edfa 1010
1011Here's another displayed paragraph.
1012
1013}
1014
339cbe09 1015\H{input-biblio} Creating a \i{bibliography}
11f2edfa 1016
1017If you need your document to refer to other documents (research
1018papers, books, websites, whatever), you might find a bibliography
1019feature useful.
1020
339cbe09 1021You can define a bibliography entry using the \i\c{\\B} command. This
11f2edfa 1022looks very like the \c{\\C} command and friends: it expects a
1023keyword in braces, followed by some text describing the document
1024being referred to. For example:
1025
1026\c \B{freds-book} \q{The Taming Of The Mongoose}, by Fred Bloggs.
1027\c Published by Paperjam & Notoner, 1993.
1028
1029If this bibliography entry appears in the finished document, it will
1030look something like this:
1031
1032\quote{
1033
1034\B{freds-book} \q{The Taming Of The Mongoose}, by Fred Bloggs.
1035Published by Paperjam & Notoner, 1993.
1036
1037}
1038
1039I say \q{if} above because not all bibliography entries defined
1040using the \c{\\B} command will necessarily appear in the finished
339cbe09 1041document. They only appear if they are \I{citation}referred to by a
1042\i\c{\\k} command (see \k{input-xref}). This allows you to (for
1043example) maintain a single Halibut source file with a centralised
1044database of \e{all} the references you have ever needed in any of
1045your writings, include that file in every document you feed to
1046Halibut, and have it only produce the bibliography entries you
1047actually need for each particular document. (In fact, you might even
1048want this centralised source file to be created automatically by,
1049say, a Perl script from BibTeX input, so that you can share the same
1050bibliography with users of other formatting software.)
11f2edfa 1051
1052If you really want a bibliography entry to appear in the document
1053even though no text explicitly refers to it, you can do that using
339cbe09 1054the \i\c{\\nocite} command:
11f2edfa 1055
1056\c \nocite{freds-book}
1057
1058Normally, each bibliography entry will be referred to (in citations
1059and in the bibliography itself) by a simple reference number, such
1060as \k{freds-book}. If you would rather use an alternative reference
339cbe09 1061notation, such as [Fred1993], you can use the \i\c{\\BR}
11f2edfa 1062(\q{Bibliography Rewrite}) command to specify your own reference
1063format for a particular book:
1064
1065\c \BR{freds-book} [Fred1993]
1066
acbb8b72 1067The keyword you supply after \c{\\B} is allowed to contain escaped
1068special characters (\c{\\\\}, \c{\\\{} and \c{\\\}}), but should not
1069contain any other Halibut markup. It is intended to be a word or two
1070of ordinary text. (This also applies to keywords used in other
1071commands, such as \c{\\n} and \c{\\C}).
1072
339cbe09 1073\H{input-index} Creating an \i{index}
11f2edfa 1074
1075Halibut contains a comprehensive indexing mechanism, which attempts
1076to be reasonably easy to use in the common case in spite of its
1077power.
1078
1079\S{input-index-simple} Simple indexing
1080
1081In normal usage, you should be able to add index terms to your
339cbe09 1082document simply by using the \i\c{\\i} command to wrap one or two
11f2edfa 1083words at a time. For example, if you write
1084
1085\c The \i{hippopotamus} is a particularly large animal.
1086
1087then the index will contain an entry under \q{hippopotamus},
1088pointing to that sentence (or as close to that sentence as the
1089output format sensibly permits).
1090
1091You can wrap more than one word in \c{\\i} as well:
1092
1093\c We recommend using a \i{torque wrench} for this job.
1094
1095\S{input-index-special} Special cases of indexing
1096
1097If you need to index a computer-related term, you can use the
339cbe09 1098special case \i\c{\\i\\c} (or \i\c{\\i\\cw} if you prefer):
11f2edfa 1099
1100\c The \i\c{grep} command is what you want here.
1101
1102This will cause the word \q{grep} to appear in code style, as if the
1103\c{\\i} were not present and the input just said \c{\\c\{grep\}};
1104the word will also appear in code style in the actual index.
1105
1106If you want to simultaneously index and emphasise a word, there's
339cbe09 1107another special case \i\c{\\i\\e}:
11f2edfa 1108
1109\c This is what we call a \i\e{paper jam}.
1110
1111This will cause the words \q{paper jam} to be emphasised in the
1112document, but (unlike the behaviour of \c{\\i\\c}) they will \e{not}
1113be emphasised in the index. This different behaviour is based on an
1114expectation that most people indexing a word of computer code will
1115still want it to look like code in the index, whereas most people
1116indexing an emphasised word will \e{not} want it emphasised in the
1117index.
1118
8856f150 1119(In fact, \e{no} emphasis in the text inside \c{\\i} will be
1120preserved in the index. If you really want a term in the index to
1121appear emphasised, you must say so explicitly using \c{\\IM}; see
1122\k{input-index-rewrite}.)
1123
11f2edfa 1124Sometimes you might want to index a term which is not explicitly
1125mentioned, but which is highly relevant to the text and you think
1126that somebody looking up that term in the index might find it useful
339cbe09 1127to be directed here. To do this you can use the \i\c{\\I} command,
1128to create an \i{\e{invisible} index tag}:
11f2edfa 1129
1130\c If your printer runs out of toner, \I{replacing toner
1131\c cartridge}here is what to do:
1132
1133This input will produce only the output \q{If your printer runs out
1134of toner, here is what to do}; but an index entry will show up under
1135\q{replacing toner cartridge}, so that if a user thinks the obvious
1136place to start in the index is under R for \q{replacing}, they will
1137find their way here with a minimum of fuss.
1138
1139(It's worth noting that there is no functional difference between
1140\c{\\i\{foo\}} and \c{\\I\{foo\}foo}. The simple \c{\\i} case is
1141only a shorthand for the latter.)
1142
1143Finally, if you want to index a word at the start of a sentence, you
1144might very well not want it to show up with a capital letter in the
339cbe09 1145index. For this, Halibut provides the \i\c{\\ii} command, for
1146\q{index (case-)insensitively}. You use it like this:
11f2edfa 1147
1148\c \ii{Lions} are at the top of the food chain in this area.
1149
1150This is equivalent to \c{\\I\{lions\}Lions}; in other words, the
1151text will say \q{Lions}, but it will show up in the index as
1152\q{lions}. The text inside \c{\\ii} is converted entirely into lower
1153case before being added to the index data.
1154
339cbe09 1155\S{input-index-rewrite} \ii{Fine-tuning the index}
11f2edfa 1156
1157Halibut's index mechanism as described so far still has a few
1158problems left:
1159
1160\b In a reasonably large index, it's often difficult to predict
339cbe09 1161\I{replicating index terms}which of several words a user will think
1162of first when trying to look something up. For example, if they want
1163to know how to replace a toner cartridge, they might look up
1164\q{replacing} or they might look up \q{toner cartridge}. You
1165probably don't really want to have to try to figure out which of
1166those is more likely; instead, what you'd like is to be able to
1167effortlessly index the same set of document locations under \e{both}
1168terms.
11f2edfa 1169
1170\b Also, you may find you've indexed the same concept under multiple
339cbe09 1171different \I{merging index terms}index terms; for example, there
1172might be several instances of \c{\\i\{frog\}} and several of
1173\c{\\i\{frogs\}}, so that you'd end up with two separate index
1174entries for what really ought to be the same concept.
11f2edfa 1175
1176\b You might well not want the word \q{\cw{grep}} to appear in the
1177index without explanation; you might prefer it to say something more
339cbe09 1178\I{rewriting index terms}verbose such as \q{\cw{grep} command}, so
1179that a user encountering it in the index has some idea of what it is
1180\e{without} having to follow up the reference. However, you
1181certainly don't want to have to write \c{\\I\{\\cw\{grep\}
1182command\}\\c\{grep\}} every time you want to add an index term for
1183this! You wanted to write \c{\\i\\c\{grep\}} as shown in the
1184previous section, and tidy it all up afterwards.
1185
1186All of these problems can be cleaned up by the \i\c{\\IM} (for
11f2edfa 1187\q{Index Modification}) command. \c{\\IM} expects to be followed by
1188one or more pairs of braces containing index terms as seen in the
1189document, and then a piece of text (not in braces) describing how it
1190should be shown in the index.
1191
1192So to rewrite the \c{grep} example above, you might do this:
1193
1194\c \IM{grep} \cw{grep} command
1195
1196This will arrange that the set of places in the document where you
1197asked Halibut to index \q{\cw{grep}} will be listed under
1198\q{\cw{grep} command} rather than just under \q{\cw{grep}}.
1199
1200You can specify more than one index term in a \c{\\IM} command; so
1201to merge the index terms \q{frog} and \q{frogs} into a single term,
1202you might do this:
1203
1204\c \IM{frog}{frogs} frog
1205
1206This will arrange that the single index entry \q{frog} will list
1207\e{all} the places in the document where you asked Halibut to index
1208either \q{frog} or \q{frogs}.
1209
1210You can use multiple \c{\\IM} commands to replicate the same set of
1211document locations in more than one index entry. For example:
1212
1213\c \IM{replacing toner cartridge} replacing toner cartridge
1214\c \IM{replacing toner cartridge} toner cartridge, replacing
1215
1216This will arrange that every place in the document where you have
1217indexed \q{replacing toner cartridge} will be listed both there
1218\e{and} under \q{toner cartridge, replacing}, so that no matter
1219whether the user looks under R or under T they will stil find their
1220way to the same parts of the document.
1221
1222In this example, note that although the first \c{\\IM} command
1223\e{looks} as if it's a tautology, it is still necessary, because
1224otherwise those document locations will \e{only} be indexed under
1225\q{toner cartridge, replacing}. If you have \e{no} explicit \c{\\IM}
1226commands for a particular index term, then Halibut will assume a
1227default one (typically \c{\\IM\{foo\}\_foo}, although it might be
1228\c{\\IM\{foo\}\_\\c\{foo\}} if you originally indexed using
1229\c{\\i\\c}); but as soon as you specify an explicit \c{\\IM},
1230Halibut discards its default implicit one, and you must then specify
1231that one explicitly as well if you wanted to keep it.
1232
339cbe09 1233\H{input-config} \ii{Configuring} Halibut
11f2edfa 1234
339cbe09 1235Halibut uses the \i\c{\\cfg} command to allow you to configure various
11f2edfa 1236aspects of its functionality.
1237
1238The \c{\\cfg} command expects to be followed by at least one pair of
1239braces, and usually more after that. The first pair of braces
1240contains a keyword indicating what aspect of Halibut you want to
1241configure, and the meaning of the one(s) after that depends on the
1242first keyword.
1243
1244The current list of configuration keywords in the main Halibut code
1245is quite small. Here it is in full:
1246
339cbe09 1247\dt \I\cw{\\cfg\{chapter\}}\cw{\\cfg\{chapter\}\{}\e{new chapter name}\cw{\}}
11f2edfa 1248
1249\dd This tells Halibut that you don't want to call a chapter a
339cbe09 1250\I{renaming sections}\I{configuring heading display}chapter any
1251more. For example, if you give the command
11f2edfa 1252\cw{\\cfg\{chapter\}\{Book\}}, then any chapter defined with the
1253\c{\\C} command will be labelled \q{Book} rather than \q{Chapter},
1254both in the section headings and in cross-references. This is
1255probably most useful if your document is not written in English.
1256
339cbe09 1257\lcont{
1258
1259Your replacement name should be given with a capital letter. Halibut
1260will leave it alone if it appears at the start of a sentence (in a
1261chapter title, or when \c{\\K} is used), and will lower-case it
1262otherwise (when \c{\\k} is used).
1263
1264}
1265
1266\dt \I\cw{\\cfg\{section\}}\cw{\\cfg\{section\}\{}\e{new section name}\cw{\}}
11f2edfa 1267
1268\dd Exactly like \c{chapter}, but changes the name given to
1269subsections of a chapter.
1270
339cbe09 1271\dt \I\cw{\\cfg\{appendix\}}\cw{\\cfg\{appendix\}\{}\e{new appendix name}\cw{\}}
11f2edfa 1272
339cbe09 1273\dd Exactly like \c{chapter}, but changes the name given to
11f2edfa 1274appendices.
1275
1276In addition to these configuration commands, there are also
1277configuration commands provided by each individual output format.
1278These configuration commands are discussed along with each output
16ea3abe 1279format, in \k{output}.
11f2edfa 1280
339cbe09 1281The \i{default settings} for the above options are:
1282
1283\c \cfg{chapter}{Chapter}
1284\c \cfg{section}{Section}
1285\c \cfg{appendix}{Appendix}
1286
1287\H{input-macro} Defining \i{macros}
11f2edfa 1288
1289If there's a complicated piece of Halibut source which you think
1290you're going to use a lot, you can define your own Halibut command
1291to produce that piece of source.
1292
1293In \k{input-unicode}, there is a sample piece of code which prints a
1294Euro sign, or replaces it with \q{EUR} if the Euro sign is not
1295available:
1296
16ea3abe 1297\c This is likely to cost \u20AC{EUR\_}2500 at least.
11f2edfa 1298
1299If your document quotes a \e{lot} of prices in Euros, you might not
1300want to spend all your time typing that out. So you could define a
339cbe09 1301macro, using the \i\c{\\define} command:
11f2edfa 1302
16ea3abe 1303\c \define{eur} \u20AC{EUR\_}
11f2edfa 1304
acbb8b72 1305Your macro names may include Roman alphabetic characters
1306(\c{a}-\c{z}, \c{A}-\c{Z}) and ordinary Arabic numerals
1307(\c{0}-\c{9}), but nothing else. (This is general \I{command
1308syntax}syntax for all of Halibut's commands, except for a few
1309special ones such as \c{\\_} and \c{\\-} which consist of a single
1310punctuation character only.)
1311
672e4626 1312Then you can just write ...
11f2edfa 1313
1314\c This is likely to cost \eur 2500 at least.
1315
672e4626 1316... except that that's not terribly good, because you end up with a
acbb8b72 1317space between the Euro sign and the number. (If you had written
1318\c{\\eur2500}, Halibut would have tried to interpret it as a macro
1319command called \c{eur2500}, which you didn't define.) In this case,
1320it's helpful to use the special \i\c{\\.} command, which is defined
1321to \I{NOP}\I{doing nothing}do nothing at all! But it acts as a
339cbe09 1322separator between your macro and the next character:
672e4626 1323
1324\c This is likely to cost \eur\.2500 at least.
1325
1326This way, you will see no space between the Euro sign and the number
1327(although, of course, there will be space between \q{EUR} and the
1328number if the Euro sign is not available, because the macro
1329definition specifically asked for it).