ma-cb-en-frames.tex /size: 2962 b    last modification: 2020-07-01 14:35
1\startcomponent ma-cb-en-frames
2
3\enablemode[**en-us]
4
5\project ma-cb
6
7\startchapter[title=Outlined text]
8
9\index{outline+text}
10
11\Command{\tex{framed}}
12\Command{\tex{setupframed}}
13\Command{\tex{inframed}}
14
15You can \inframed{outline} a text with \type{\framed}. The
16command looks like this:
17
18\shortsetup{framed}
19
20The bracket pair is optional and contains the set up parameters. The curly braces
21enclose the text. To be honest, the outlined text in the first paragraph was done
22with \type{\inframed}. This command takes care of the interline spacing.
23
24Some other examples of \type{\framed} and its set up parameters are shown below.
25
26\startbuffer[a]
27\framed
28  [height=fit,
29   width=.5\textwidth]
30  {Hasselt}
31\stopbuffer
32
33\placefigure[right,none][]{}{\externalfigure[a][type=buffer]}
34\typebuffer[a]
35
36\startbuffer[b]
37\framed
38  [height=3em,
39   width=.5\textwidth]
40  {Hasselt now has more space}
41\stopbuffer
42
43\placefigure[right,none][]{}{\externalfigure[b][type=buffer]}
44\typebuffer[b]
45
46\startbuffer[d]
47\framed
48  [height=3em,
49   width=.5\textwidth,
50   foregroundcolor=red,
51   framecolor=blue]
52  {Hasselt now has some color}
53\stopbuffer
54
55\placefigure[right,none][]{}{\externalfigure[d][type=buffer]}
56\typebuffer[d]
57
58\startbuffer[e]
59\framed
60  [height=3em,
61   width=.5\textwidth,
62   foregroundcolor=red,
63   framecolor=blue,
64   rulethickness=2pt]
65  {Hasselt now has more frame}
66\stopbuffer
67
68\placefigure[right,none][]{}{\externalfigure[e][type=buffer]}
69\typebuffer[e]
70
71\startbuffer[f]
72\framed
73  [height=3em,
74   width=.5\textwidth,
75   foregroundcolor=red,
76   framecolor=blue,
77   rulethickness=2pt,
78   background=color,
79   backgroundcolor=green]
80  {Hasselt now has a colorful background}
81\stopbuffer
82
83\placefigure[right,none][]{}{\externalfigure[f][type=buffer]}
84\typebuffer[f]
85
86\startbuffer[g]
87\framed
88  [height=3em,
89   width=.5\textwidth,
90   foregroundcolor=red,
91   framecolor=blue,
92   rulethickness=2pt,
93   background=color,
94   backgroundcolor=green,
95   foregroundstyle=bold]
96  {Hasselt now has another style}
97\stopbuffer
98
99\placefigure[right,none][]{}{\externalfigure[g][type=buffer]}
100\typebuffer[g]
101
102\startbuffer[needed-for-h]
103\definecolor[a][black]
104\definecolor[b][white]
105
106\startuniqueMPgraphic{LinearShade}
107  fill OverlayBox
108    withshademethod "linear" withcolor \MPcolor{a} shadedinto \MPcolor{b} ;
109\stopuniqueMPgraphic
110
111\defineoverlay
112  [linear shade]
113  [\uniqueMPgraphic{LinearShade}]
114\stopbuffer
115
116\getbuffer[needed-for-h]
117
118\startbuffer[h]
119\framed
120  [height=3em,
121   width=.5\textwidth,
122   foregroundcolor=red,
123   framecolor=blue,
124   rulethickness=2pt,
125   background=linear shade,
126   foregroundstyle=bold]
127  {Hasselt now has a little shade}
128\stopbuffer
129
130\placefigure[right,none][]{}{\externalfigure[h][type=buffer]}
131\typebuffer[h]
132
133The shady background was defined with:
134
135\typebuffer[needed-for-h]
136
137The \type{\framed} command is very sophisticated and is used in many macros.
138The command to set up frames is:
139
140\shortsetup{setupframed}
141
142\stopchapter
143
144\stopcomponent
145