ma-cb-en-heads.tex /size: 3766 b    last modification: 2020-07-01 14:35
1\startcomponent ma-cb-en-heads
2
3\enablemode[**en-us]
4
5\project ma-cb
6
7\startchapter[reference=heads,title=Heads]
8
9\index{headers}
10
11\Command{\tex{chapter}}
12\Command{\tex{paragraph}}
13\Command{\tex{subparagraph}}
14\Command{\tex{title}}
15\Command{\tex{subject}}
16\Command{\tex{subsubject}}
17\Command{\tex{setuphead}}
18\Command{\tex{setupheads}}
19
20The structure of a document is determined by its chapter and section titles.
21These titles are created with the commands shown in \in{table}[tab:headers]:
22
23\placetable[here][tab:headers]{Headers.}
24  {\starttable[|l|l|]
25  \HL
26  \NC \bf Numbered header   \NC \bf Unnumbered header   \NC\SR
27  \HL
28  \NC \type{\chapter}       \NC \type{\title}           \NC\FR
29  \NC \type{\section}       \NC \type{\subject}         \NC\MR
30  \NC \type{\subsection}    \NC \type{\subsubject}      \NC\MR
31  \NC \type{\subsubsection} \NC \type{\subsubsubject}   \NC\MR
32  \NC \unknown              \NC \unknown                \NC\LR
33  \HL
34  \stoptable}
35
36\shortsetup{startsection:instance:chapter}
37\shortsetup{startsection:instance:section}
38\shortsetup{startsection:instance:subsection}
39\shortsetup{startsection:instance:title}
40\shortsetup{startsection:instance:subject}
41\shortsetup{startsection:instance:subsubject}
42
43These commands will produce a numbered or unnumbered title in a predefined
44fontsize and fonttype with some vertical spacing before and after the header.
45
46The title commands can take several arguments, like in:
47
48\starttyping
49\title[hasselt by night]{Hasselt by night}
50\stoptyping
51
52and
53
54\starttyping
55\title{Hasselt by night}
56\stoptyping
57
58The bracket pair is optional and used for internal references. If you want to
59refer to this chapter you type for example \type{\at{page}[hasselt by night]}.
60
61For a more structured way to define chapters and sections you can use the more
62preferred \type{\start ... \stop} construction.
63
64\placetable[here][tab:headers]{Structured headers.}
65  {\starttable[|l|l|]
66  \HL
67  \NC \bf Numbered header                  \NC \bf Un-numbered header   \NC\SR
68  \HL
69  \NC \type{\start ... \stopchapter}       \NC \type{\start ... \stoptitle}           \NC\FR
70  \NC \type{\start ... \stopsection}       \NC \type{\start ... \stopsubject}         \NC\MR
71  \NC \type{\start ... \stopsubsection}    \NC \type{\start ... \stopsubsubject}      \NC\MR
72  \NC \type{\start ... \stopsubsubsection} \NC \type{\start ... \stopsubsubsubject}   \NC\MR
73  \NC \unknown                             \NC \unknown                               \NC\LR
74  \HL
75  \stoptable}
76
77In that case the definition looks like this:
78
79\starttyping
80\starttitle[reference="hasselt by night",title="Hasselt by night"}
81   ...
82\stoptitle
83\stoptyping
84
85Of course the chapter and section titles can be set to your own preferences and you can even
86define your own sections. This is done with the \type{\setuphead} and
87\type{\definehead} command.
88
89\shortsetup{definehead}
90
91\shortsetup{setuphead}
92
93\startbuffer
94\definehead
95  [myhead]
96  [section]
97
98\setuphead
99  [myhead]
100  [numberstyle=bold,
101   textstyle=bold,
102   before=\hairline\blank,
103   after=\nowhitespace\hairline]
104
105\myhead[headlines]{Hasselt makes headlines}
106\stopbuffer
107
108\typebuffer
109
110A new header \type{\myhead} is defined and it inherits the properties of
111\type{\section}. It would look something like this:
112
113\getbuffer
114
115There is one other command you should know now, and that is \type{\setupheads}.
116You can use this command to set up the numbering of the numbered chapters and
117sections. If you type:
118
119\startbuffer
120\setupheads
121  [alternative=inmargin,
122   separator=--]
123\stopbuffer
124
125\typebuffer
126
127all numbers will appear in the margin. Section 1.1 would look like 1--1.
128
129Commands like \type{\setupheads} are typed in the set up area of your input file.
130
131\shortsetup{setupheads}
132
133\stopchapter
134
135\stopcomponent
136