Changes

Jump to navigation Jump to search
1,217 bytes added ,  15:06, 31 August 2021
m
Remove MkII hint, enhance markup
< [[Main Page]] | [[Visuals]] >
 
{{todo|Add more examples of usage of textbackgrounds.}}
Pages, paragraphs, words can have a background: color or screenframe. Note that "screen" is deprecated in MkIVConTeXt creates these using [[MetaPost]].
(See, eventually, the [[manual:details.pdf| details]] manual or the {{src|anch-bck.mkvi|source}} for further explanations.) == What if textbackground doesn’t work? == The textbackground commands require [[write18]] to be enabled; see that page for more information.
== Example: multi-page backgrounded text ==
frame=off,]
\input samplefile{knuth}
\startsecondary
\input samplefile{knuth}
\stopsecondary
\input samplefile{knuth}
</context>
== backgroundoffset Background Offset ==
The options left, right, top, bottomoffset can be replaced by backgroundoffset yielding a different result:
frame=off,]
\input samplefile{knuth}
\startsecondary
\input samplefile{knuth}
\stopsecondary
\input samplefile{knuth}</context> == Underlining with Text Backgrounds == Underlining is generally frowned upon by experienced TeXnicians. Occasionally,however, it is necessary and {{cmd|ul}} or {{cmd|underbar}} doesn’t do what you want. In thosecases using {{cmd|definetextbackground}} for the underlining may also be tried. <context source="yes">\definetextbackground[underline] [location=text,alternative=1,background=,frame=off] \definestartstop[underline] [before={\starttextbackground[underline]}, after=\stoptextbackground] \startTEXpageAn example with \startunderline underlined\stopunderline\ text.\stopTEXpage
</context>
If desired, the location of the line can also be adjusted. <context source="yes">\startuseMPgraphic{mpos:par:columnset} % Shift underlining down a touch \iftracepositions show_multi_pars \else draw_multi_pars \fi ; path p ; p := boundingbox currentpicture ; currentpicture := currentpicture shifted (0,-StrutDepth/3) ; setbounds currentpicture to p ;\stopuseMPgraphic \definetextbackground[underline] [location=text,alternative=1,background=,frame=off] \definestartstop[underline] [before={\starttextbackground[underline]}, after=\stoptextbackground] \startTEXpageAn example with \startunderline underlined\stopunderline\ text.\stopTEXpage</context>  === Example: dashed underbar ===(by WS, 4/2011) ==
<context source="yes">
\startdashed
\input samplefile{ward}
\stopdashed
</context>
 
[[Category:Basics]]

Navigation menu