ConTEXt an excursion - Pragma ADE
ConTEXt an excursion - Pragma ADE ConTEXt an excursion - Pragma ADE
Defining commands / macros Without any further explanation this command is used in the following example. You may have a well illustrated document and you are tired of typing: \placefigure [here,force] [fig:logical name] {Caption.} {\externalfigure[filename][width=5cm]} You could define your own command with a few variables like: contents index commands definitions colofon • logical name • caption • file name Your command definition and call could look something like this: \define[3]\myputfigure {\placefigure [here,force][fig:#1] {#2}{\externalfigure[#3][width=5cm]}} \myputfigure{lion}{The Dutch lion is a sentry.}{hass13g} Between brackets [3] indicates that you want to use three variables #1, #2 and #3. In the command call \myputfigure you have to input these variables between curly braces. The result would be: Very sophisticated commands can be programmed but this is left to your own inventiveness. In addition to defining commands you can also define \start · · · \stop command pairs. \definestartstop[...][..,..=..,..] exit search + go back For example: – + 36 106
Defining commands / macros contents index commands definitions colofon Figure 36.1 The Dutch lion is a sentry. \definestartstop [stars] [commands={\inleft{\hbox to \leftmarginwidth {\leaders\hbox{$\star$}\hfill}}}, before=\blank, after=\blank] ⋆⋆⋆⋆⋆⋆⋆ \startstars {\em Hasselter Juffers} are sweet cookies but the name is no coincidence. On July 21 in 1233 the {\em Zwartewaterklooster} (Blackwater Monastery) was founded. The monastery was meant for unmarried girls and women belonging to the nobility of Hasselt. These girls and women were called {\em juffers}. \stopstars This will result in: Hasselter Juffers are sweet cookies but the name is no coincidence. On July 21 in 1233 the exit search + go back – + 36 107
- Page 57 and 58: Definitions \concept{Hasselter juff
- Page 59 and 60: Numbered definitions Now the new co
- Page 61 and 62: Outlined text \framed[..,..=..,..]{
- Page 63 and 64: Margin texts It was essential for H
- Page 65 and 66: Page breaking and page numbering co
- Page 67 and 68: Page breaking and page numbering co
- Page 69 and 70: Table of contents (lists) \setupfoo
- Page 71 and 72: Table of contents (lists) Alternati
- Page 73 and 74: Registers \writetolist[section]{}{-
- Page 75 and 76: Synonyms The first bracket pair con
- Page 77 and 78: Refering to text elements \item sai
- Page 79 and 80: Color There are many canals in Hass
- Page 81 and 82: Page backgrounds Backgrounds can sp
- Page 83 and 84: Interactive mode in electronic docu
- Page 85 and 86: Interactive mode in electronic docu
- Page 87 and 88: Interactive mode in electronic docu
- Page 89 and 90: Fonts and font switches contents 31
- Page 91 and 92: Fonts and font switches [cmr] \tf \
- Page 93 and 94: Fonts and font switches PDF and PDF
- Page 95 and 96: Composite characters 32.2 Accents A
- Page 97 and 98: Page layout top header left left te
- Page 99 and 100: Page layout \adaptlayout[21,38][hei
- Page 101 and 102: Paragraph spacing contents 34 Parag
- Page 103 and 104: Paragraph spacing \startlinecorrect
- Page 105 and 106: Paragraph spacing You can force ver
- Page 107: Defining commands / macros The comm
- Page 111 and 112: Miscellaneous The newly defined flo
- Page 113 and 114: Miscellaneous \keepblocks[..,.1.,..
- Page 115 and 116: Miscellaneous 37.5 Lines There are
- Page 117 and 118: Miscellaneous adress contents index
- Page 119 and 120: Miscellaneous 37.9 Rotating text, f
- Page 121 and 122: Miscellaneous On a wooden panel in
- Page 123 and 124: Using modules When you delete the %
- Page 125 and 126: User specifications contents A User
- Page 127 and 128: Auxilliary files contents C Auxilli
- Page 129 and 130: Command definitions \crlf 118 conte
- Page 131 and 132: Command definitions \definefloat[.1
- Page 133 and 134: Command definitions \framed[..,..=.
- Page 135 and 136: Command definitions \page[..,...,..
- Page 137 and 138: Command definitions \setupbackgroun
- Page 139 and 140: Command definitions \setupcombinedl
- Page 141 and 142: Command definitions \setupfillinrul
- Page 143 and 144: Command definitions \setupformulae[
- Page 145 and 146: Command definitions \setupframedtex
- Page 147 and 148: Command definitions \setupinteracti
- Page 149 and 150: Command definitions \setupitemize[.
- Page 151 and 152: Command definitions \setuplist[..,.
- Page 153 and 154: Command definitions \setuppositioni
- Page 155 and 156: Command definitions \setupthinrules
- Page 157 and 158: Command definitions \startformula .
Defining comm<strong>an</strong>ds / macros<br />
contents<br />
index<br />
comm<strong>an</strong>ds<br />
definitions<br />
colofon<br />
Figure 36.1<br />
The Dutch lion is a sentry.<br />
\definestartstop<br />
[stars]<br />
[comm<strong>an</strong>ds={\inleft{\hbox to \leftmarginwidth<br />
{\leaders\hbox{$\star$}\hfill}}},<br />
before=\bl<strong>an</strong>k,<br />
after=\bl<strong>an</strong>k]<br />
⋆⋆⋆⋆⋆⋆⋆<br />
\startstars<br />
{\em Hasselter Juffers} are sweet cookies but the name is no<br />
coincidence. On July 21 in 1233 the {\em Zwartewaterklooster}<br />
(Blackwater Monastery) was founded. The monastery was me<strong>an</strong>t<br />
for unmarried girls <strong>an</strong>d women belonging to the nobility of<br />
Hasselt. These girls <strong>an</strong>d women were called {\em juffers}.<br />
\stopstars<br />
This will result in:<br />
Hasselter Juffers are sweet cookies but the name is no coincidence. On July 21 in 1233 the<br />
exit<br />
search +<br />
go back<br />
– +<br />
36 107