ma-cb-en-document.tex /size: 3840 b    last modification: 2020-07-01 14:35
1\startcomponent ma-cb-en-document
2
3\enablemode[**en-us]
4
5\project ma-cb
6
7\startchapter[title=How to create a textbook]
8
9\index{input file}
10
11Let's assume you want to create a simple textbook. It has some structure and
12contains a title page, a few chapters, sections and sub sections. Of course there
13is a table of contents.
14
15\CONTEXT\ can create such a document automatically if you offer the right input
16by means of a file. So first you have to create an input file. An input file
17consists of a name and an extension. You can choose any name you want but the
18extension has to be \type{.tex}. If you create a file with the name
19\type{mybook.tex} you will find no difficulties in running \CONTEXT.
20
21An \pagereference[inputfile] input file could look like this:
22
23\startbuffer
24\starttext
25
26\startstandardmakeup
27  \midaligned{From Hasselt to America}
28  \midaligned{by}
29  \midaligned{J. Jonker and C. van Marle}
30\stopstandardmakeup
31
32\placecombinedlist[content]
33
34\chapter{Introduction}
35
36... ties between Hasselt and America ...
37
38\chapter[rensselaer]{The Rensselaer family}
39
40\section{The first born}
41
42... was born in the year ...
43
44\section{The early years}
45
46... in those days Hasselt was ...
47
48\section{Living and workin in America}
49
50... life in America was ...
51
52\chapter[lansing]{The Lansing family}
53
54... the Lansing family was also ...
55
56\chapter[cuyler]{The Cuyler family}
57
58... much later Tydeman Cuyler ...
59
60\stoptext
61\stopbuffer
62
63{\switchtobodyfont[9pt]\typebuffer}
64
65\CONTEXT\ expects a plain \ASCII\ input file. Of course you can use any
66text|-|editor, as long as you save the file as standard \ASCII\ (also called txt
67file) with the extension \type{.tex}. Note that spaces in the filename are
68not allowed.
69
70The input file contains the text you want to typeset and the \CONTEXT\ commands.
71A \CONTEXT\ command begins with a backslash~\tex{}. With the command
72\type{\starttext} you indicate the beginning of your text.
73
74A command is sometimes followed by an argument which is enclosed by curly braces
75\type{{}}. The command \type{\chapter[cuyler]{The Cuyler family}} that you see in
76the example will have its effect on {\em The Cuyler family}. Its actions will
77have effect on the design, typography and structure. The actions may be:
78
79\startitemize[n,packed]
80\item start a new page
81\item increase chapter number by one
82\item place chapter number in front of chapter title
83\item reserve some vertical space
84\item use a big font
85\item put chapter title (and page number) in the table of contents
86\stopitemize
87
88Other actions concerning running heads, number resetting and interactivity are
89disregarded at this moment.
90
91Sometimes you will see two brackets (\type{[]}) directly after the command. These
92brackets are used to feed specific options to the command. Further on in this
93manual you will get more information on these brackets.
94
95The commands in your input file can have the following appearance:
96
97\starttabulate[|||]
98\HL
99\NC \bf Appearance of command  \NC \bf Example \NC\NR
100\HL
101\NC \type{\startcommand ... \stopcommand}   \NC \type{\starttext ... \stoptext} \NC\NR
102\NC \type{\startcommand[] ... \stopcommand} \NC \type{\startitemize[packed] ... \stopitemize} \NC\NR
103\NC \type{\command}                         \NC \type{\item} \NC\NR
104\NC \type{\command[]}                       \NC \type{\in[cuyler]} \NC\NR
105\NC \type{\command{}[]}                     \NC \type{\at{page}[cuyler]} \NC\NR
106\NC \type{\command{}}                       \NC \type{\index{America}} \NC\NR
107\NC \type{\command[]{}}                     \NC \type{\chapter[cuyler]{The Cuyler family}} \NC\NR
108\HL
109\stoptabulate
110
111If you have \CONTEXT\ process the above example file, you would obtain a very
112simple document with a title page, a few numbered chapters and section headers
113and a table of content (because of \type{\placecombinedlist[content]}).
114
115\stopchapter
116
117\stopcomponent
118