Open main menu
Wiki
Search
Changes
← Older edit
Newer edit →
TextBackground
(view source)
Revision as of 10:23, 5 February 2019
516 bytes removed
,
10:23, 5 February 2019
Removed outdated comments and unnecessary commands
{{todo|Add more examples of usage of textbackgrounds.}}
Pages, paragraphs, words can have a background: color or screen. Note that
"
screen
"
is
depricated
deprecated
in
MKIV
MkIV
.
(See, eventually, the [[manual:details.pdf| details]] manual for further explanations.)
== What if textbackground
doesn't
doesn’t
work? ==
The textbackground commands require [[write18]] to be enabled; see that page for more information.
In the following example, we also reduce the textwidth and bodyfont size.
<context source="yes">
\setupcolors[state=start]
\definetextbackground[secondary][
location=paragraph,
background=color,
backgroundcolor=
middlegray
lightgray
,
leftoffset=.5\bodyfontsize,
rightoffset=.5\bodyfontsize,
topoffset=.5\bodyfontsize,
bottomoffset=.5\bodyfontsize,
before={\startnarrower\switchtobodyfont[small]},
after={\stopnarrower},
frame=off
,
]
\starttext
\input knuth
\startsecondary
\input knuth
\stopsecondary
\input knuth
\stoptext
</context>
{{todo|The background does not show here using the live, online conTeXt processor. Why?}}
== backgroundoffset ==
<context source="yes">
\runMPgraphicsfalse %Needed because the wiki runs MkII and write18 is not enabled
\setupcolors[state=start]
\definetextbackground[secondary][
location=paragraph,
background=color,
backgroundcolor=
middlegray
lightgray
,
backgroundoffset=.5\bodyfontsize,
before={\startnarrower\switchtobodyfont[small]},
after={\stopnarrower},
frame=off
,
]
\starttext
\input knuth
\startsecondary
\input knuth
\stopsecondary
\input knuth
\stoptext
</context>
<context source="yes">
\runMPgraphicsfalse % This is needed because the wiki runs MkII and write18 is not enabled.
\setuppapersize[B5]
\setupbodyfont[10pt]
\definetextbackground
[dashed]
[
location=text,
framecolor=black,
alternative=1,
voffset=-\strutdp,
background=,
frame=off,
dash=1]
\
starttext
startdashed
\startdashed
\input ward \stopdashed
\stoptext
</context>
Hraban
gardener,
Interface administrators
,
Administrators
1,544
edits