Changes

Jump to navigation Jump to search
2,894 bytes added ,  20:24, 27 June 2021
m
effect of struct added
< [[Visuals]] |
 
= How to achieve specific results =
== Preventing hyphenation ==
One can prevent hyphenation inside a frame by passing {{code|1=nothypenated}} option to {{code|1=align}}. It is also a good idea to add {{code|1=verytolerant}} and {{code|1=strectchstretch}} options.
<context source="yes">
|}
See the [[ColorsColor]] article for more information on available colors and color usage.
== Shaded background for part of a displayed equation ==
\Picture{sample/cow.pdf}{All your base are belong to us}{SampleRef}
\stoptext
</context>
 
 
== Colorored horizontal stripe of full paper width ==
 
<context mode="mkiv" source="yes">
\definepapersize[sheet][width=120mm,height=60mm]
\setuppapersize[sheet]
\setuppagenumbering[location=]
\setuplayout
[width=110mm,
backspace=5mm,
topspace=5mm,
header=5mm,
headerdistance=5mm,
footer=5mm,
footerdistance=5mm]
 
\showframe
 
\setupbackgrounds[page] [background=color, backgroundcolor=lightgray]
 
\startuniqueMPgraphic{whatever}
fill OverlayBox
leftenlarged BackSpace rightenlarged CutSpace
withcolor OverlayColor;
setbounds currentpicture to OverlayBox enlarged max(BackSpace,CutSpace);
\stopuniqueMPgraphic
 
\defineoverlay[whatever][\uniqueMPgraphic{whatever}]
\starttext
 
Here some text first.
 
\framed[background=whatever,backgroundcolor=green,frame=off,width=\textwidth]{test}
 
After, again some text.
 
\stoptext
 
</context>
hoffset=\zeropoint]
</texcode>
 
= Location parameter =
 
<context source="yes">
\ruledhbox
{A
\framed[width=2cm,align=middle,location=hanging]{location\\equals\\hanging}
\framed[width=2cm,align=middle,location=depth] {location\\equals\\depth}
\framed[width=2cm,align=middle,location=height] {location\\equals\\height}
B}
\vskip2cm
\ruledhbox
{A
\framed[width=2cm,align=middle,location=low] {location\\equals\\low}
\framed[width=2cm,align=middle,location=line] {location\\equals\\line}
\framed[width=2cm,align=middle,location=high] {location\\equals\\high}
B}
\vskip2cm
\ruledhbox
{A
\framed[width=2cm,align=middle,location=top] {location\\equals\\top}
\framed[width=2cm,align=middle,location=bottom] {location\\equals\\bottom}
\framed[width=2cm,align=middle,location=lohi] {location\\equals\\lohi}
\framed[width=2cm,align=middle,location=middle] {location\\equals\\middle}
B}
</context>
 
and to compare with basic height and depth of the line, and looking at the end on the effect of the struct parameter:
 
<context source="yes">
\defineframed[MonCadre][width=1.75cm,align=middle]
\define[1]\DemoLoc{\ruledhbox{%
{\getbuffer \MonCadre[location=#1]
{location\\ \color[darkmagenta]{\bf #1}\\location}}}}
\setupbodyfont[10pt]
%\showboxes
\startbuffer
\blackrule[height=max,depth=0pt,width=3mm]%
\blackrule[height=0pt,depth=max,width=3mm]
\stopbuffer
 
\strut
\DemoLoc{empty} \dontleavehmode
\DemoLoc{keep} \dontleavehmode
\DemoLoc{depth} \dontleavehmode
\DemoLoc{bottom} \dontleavehmode
\DemoLoc{low}
\blank[big]
\strut
\DemoLoc{middle} \dontleavehmode
\DemoLoc{lohi} \dontleavehmode
\DemoLoc{line}
\blank[big]
\strut
\DemoLoc{top} \dontleavehmode
\DemoLoc{height} \dontleavehmode
\DemoLoc{high} \dontleavehmode
\DemoLoc{formula} \dontleavehmode
\DemoLoc{hanging}
 
\setupframed[MonCadre][strut=yes]
\strut
{\tt strut=yes}
\DemoLoc{bottom} \dontleavehmode \DemoLoc{top}
 
{\tt strut=no}
\setupframed[MonCadre][strut=no]
\DemoLoc{bottom} \dontleavehmode \DemoLoc{top}
</context>
= Similar topics =
= See also =
* [[:Category:Command/Frames]]
 
[[Category:Basics]]

Navigation menu