ma-cb-en-references.tex /size: 3010 b    last modification: 2020-07-01 14:35
1\startcomponent ma-cb-en-references
2
3\enablemode[**en-us]
4
5\project ma-cb
6
7\startchapter[title=Refering to text elements]
8
9\index{refering}
10\index{label}
11
12\Command{\tex{in}}
13\Command{\tex{at}}
14\Command{\tex{pagereference}}
15
16To disclose your document for your readers you can use the table of contents and
17the register. However, it is not uncommon to refer to specific text elements like
18formulas, tables, images and sections to enhance readability.
19
20For refering from one location in a document to another you can use the command:
21
22\shortsetup{in}
23
24The curly braces contain text and the brackets contain a logical label. If you have
25written a chapter header like this:
26
27\starttyping
28\startchapter[title=Hotels in Hasselt,reference=hotel]
29  ...
30\stopchapter
31\stoptyping
32
33then you can refer to this chapter with:
34
35\starttyping
36\in{chapter}[hotel]
37\stoptyping
38
39After processing the chapter number is available and the reference could look
40something like: {\em chapter 23}. You can use \type{\in} for any references to
41text elements like chapters, sections, figures, tables, formulas etc.
42
43Another example:
44
45\startbuffer
46There are a number of things you can do in Hasselt:
47
48\startitemize[n,packed]
49\item swimming
50\item sailing
51\item[hiking] hiking
52\item biking
53\stopitemize
54
55An activity like \in{activity}[hiking] described on \at{page}[hiking]
56is very tiring.
57\stopbuffer
58
59\typebuffer
60
61This would look like this:
62
63\getbuffer
64
65As you can see, it is also possible to refer to pages. This is done with:
66
67\shortsetup{at}
68
69For example with:
70
71\starttyping
72\at{page}[hiking]
73\stoptyping
74
75This command can be used in combination with:
76
77\shortsetup{pagereference}
78
79and
80
81\shortsetup{textreference}
82
83If you want to refer to the chapter {\em Hotels in Hasselt} you could type:
84
85\startbuffer
86Look in \in{chapter}[hotel] on \at{page}[hotel] for a complete
87overview of accomodations in \pagereference[accomodation]Hasselt.
88\stopbuffer
89
90\typebuffer
91
92A chapter number and a page number will be generated when processing the input
93file. On another spot in the document you can refer to \type{accomodation} with
94\type{\at{page}[accomodation]}.
95
96You can also define a set of labels separated by commas.
97
98\startbuffer
99\placefigure
100  [here]
101  [fig:canals,fig:boats]
102  {A characteristic picture of Hasselt.}
103  {\externalfigure[ma-cb-08][width=10cm]}
104
105There are many canals in Hasselt (see \in{figure}[fig:canals]).
106.
107.
108.
109Boats can be moored in the canals of Hasselt (see
110\in{figure}[fig:boats]).
111\stopbuffer
112
113\typebuffer
114
115This might look like this:
116
117\getbuffer
118
119You can also refer to a title of a chapter or section or even a caption of an
120image. This is done with:
121
122\shortsetup{about}
123
124This:
125
126\startbuffer
127The caption of \in{figure}[fig:canals] is {\em \about[fig:canals]}.
128\stopbuffer
129
130\typebuffer
131
132Becomes:
133
134\getbuffer
135
136With the command:
137
138\starttyping
139\setupinteraction[state=start]
140\stoptyping
141
142all references become active links. See \in{chapter}[interactivity] for more
143information on this subject.
144
145\stopchapter
146
147\stopcomponent
148
149