Open main menu

Changes

</context>
and In order to understand, it can be helpful :* to compare with basic height {{cmd|strutheight}} and depth {{cmd|strutdepth}} of the line, and looking at * to compare the end effect on the parent box* to compare the effect of the struct parameter:option which, with the location option, is key to control the position
<context source="yes">
\setuppapersize[A5]\setuplayout[backspace=5mm,topspace=1cm,header=0cm,footer=0cm,width=14cm] \defineframed [MonCadre] [width=1.75cm, align=middle,% rulethickness=2pt, % <== you can test offset=-rulethickness% offset=-2pt, % <== you can test offset=-rulethickness framecolor=darkred] \define[1]\DemoLoc{%\ruledhbox{% {\getbuffer blackrule[height=\strutheight,depth=0pt,width=3mm]%\blackrule[height=0pt,depth=\strutdepth,width=3mm]%\MonCadre [location=#1] {location\\ \color[darkmagenta]{\bf #1}\\location}}~~}} 
\setupbodyfont[10pt]
%\showboxes
\startbuffer
\blackrule[strut\DemoLoc{height=max,depth=0pt,width=3mm]%} \dontleavehmode\blackrule[height=0pt,depth=max,width=3mm]DemoLoc{high} \dontleavehmode\DemoLoc{line} \dontleavehmode\stopbufferDemoLoc{low} \dontleavehmode
\blank[1cm]
\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}
\DemoLoc{top} \dontleavehmode
\DemoLoc{lohi} \dontleavehmode % idem middle
\DemoLoc{bottom} \dontleavehmode
\DemoLoc{depth}
\setupframedblank[MonCadre][strut=yes1cm]
\strut
\DemoLoc{empty} \tt strut=yes}dontleavehmode\DemoLoc{bottomkeep} \dontleavehmode \DemoLoc{topformula}\stopbuffer \starttext {\tt\bfb strut=yes}\blank[1cm]\defineframed [MonCadre] [strut=yes]\getbuffer \blank[2cm] {\tt\bfb strut=no}\blank[5mm]\defineframed [MonCadre] [strut=no]\getbuffer \stoptext
{\tt strut=no}
\setupframed[MonCadre][strut=no]
\DemoLoc{bottom} \dontleavehmode \DemoLoc{top}
</context>
1,031

edits