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