compatibility between \startshapetext and \startsection ?
Hi all, \startshapetext works pretty well, but when I use \startsection \stopsection, shapes are not respected anymore. I use layers, to be able to place the content anywhere, but the issue remains without layers. Any clues ? (\placeinitial seems also to break the shaping) Example : 2 pages without sectioning, and after 2 pages by uncommenting the \startsection and \stopsection commands. \setupbodyfont [pagella, 8pt] \setupframed [frame=on, offset=0.000pt, rulethickness=0.000pt, location=top, align=normal, strut=yes, ] \setuplayout [grid=yes] \setupinteraction [state=start] %------------------------------------------------------------------------------ \definemeasure [myheight] [{\the\dimexpr\baselineskip*33+\lineskip\relax}] \definemeasure [myheighta] [{\the\dimexpr\baselineskip*10+\lineskip*2\relax}] \definemeasure [myheightb] [{\the\dimexpr\baselineskip*20-\lineskip*2\relax}] \startuseMPgraphic{mp1} path p ; numeric myheight ; myheight := \measure{myheight}; numeric myheighta ; myheighta := \measure{myheighta}; numeric myheightb ; myheightb := \measure{myheightb}; p := (0,0) -- (6cm,0) -- (6cm,myheighta) -- (4cm,myheighta) -- (4cm,myheightb) -- (6cm,myheightb) -- (6cm,myheight) -- (0cm,myheight) -- cycle; build_parshape(p,0,0,0,\baselinedistance,\strutheight,\strutdepth,\topskip) ; fill p withcolor \MPcolor{lightyellow}; \stopuseMPgraphic \defineoverlay[ol1][\useMPgraphic{mp1}] %============================================================================== \starttext %============================================================================== {\sc\bfd Version A, without sectionning, pages 1\ampersand 2} \startshapetext[mp1, mp1, mp1, mp1, mp1, mp1] \setupalign[hz,hanging,verytolerant,stretch,normal]% \setupindenting[yes,small]% \strut% \reference[myref1]{MyRef1}Here is the first reference.\par See reference \in[myref2] on \at{page}[myref2]\par % \dorecurse{5}{ %\startsection[title={Title for section{\recurselevel}}] \darkred\input knuth \par \darkblue\input ward %\stopsection } \reference[myref2]{MyRef2} Here is the second reference.\par See reference \in[myref1] on \at{page}[myref1]\par \stopshapetext \definelayer[testA] \setlayer[testA][x=-1cm,y=3cm]{\framed[background=ol1]{\strut\getshapetext}} \setlayer[testA][x=9cm,y=3cm] {\framed[background=ol1]{\strut\getshapetext}} \flushlayer[testA] \page \setlayer[testA][x=-1cm,y=3cm]{\framed[background=ol1]{\strut\getshapetext}} \setlayer[testA][x=9cm,y=3cm] {\framed[background=ol1]{\strut\getshapetext}} \flushlayer[testA] \page %============================================================================== {\sc\bfd Version B, with sectionning, pages 3\ampersand 4} \startshapetext[mp1, mp1, mp1, mp1, mp1, mp1] \setupalign[hz,hanging,verytolerant,stretch,normal]% \setupindenting[yes,small]% \strut% \reference[myref3]{MyRef3}Here is the first reference.\par See reference \in[myref4] on \at{page}[myref4]\par % \dorecurse{5}{ \startsection[title={Title for section{\recurselevel}}] \darkred\input knuth \par \darkblue\input ward \stopsection } \reference[myref4]{MyRef4} Here is the second reference.\par See reference \in[myref3] on \at{page}[myref3]\par \stopshapetext \definelayer[testB] \setlayer[testB][x=-1cm,y=3cm]{\framed[background=ol1]{\strut\getshapetext}} \setlayer[testB][x=9cm,y=3cm] {\framed[background=ol1]{\strut\getshapetext}} \flushlayer[testB] \page \setlayer[testB][x=-1cm,y=3cm]{\framed[background=ol1]{\strut\getshapetext}} \setlayer[testB][x=9cm,y=3cm] {\framed[background=ol1]{\strut\getshapetext}} \flushlayer[testB] %============================================================================== \stoptext %==============================================================================
garulfo@azules.eu schrieb am 14.05.2024 um 23:13:
Hi all,
\startshapetext works pretty well, but when I use \startsection \stopsection, shapes are not respected anymore. I use layers, to be able to place the content anywhere, but the issue remains without layers.
Any clues ? (\placeinitial seems also to break the shaping)
Example : 2 pages without sectioning, and after 2 pages by uncommenting the \startsection and \stopsection commands.
[...] \dorecurse{5}{ \startsection[title={Title for section{\recurselevel}}] \darkred\input knuth \par \darkblue\input ward \stopsection }
The problem aren't the section command but the vertical skips added before and after each section, you can reproduce the effect when you add \blank to your example. \dorecurse{5}{ \blank \leftaligned{Title for section{\recurselevel}} \blank \darkred\input knuth \par \darkblue\input ward } Wolfgang
Thanks you Wolfgang. If it's not possible to use \blank, it appears that using for example \strut\par\strut\par is OK (but \par\par is not, ) \dorecurse{5}{ \strut\par\strut\par \leftaligned{Title for section{\recurselevel}} \strut\par\strut\par \darkred\input knuth \par \darkblue\input ward} Please, what would be a \setuphead that removes the introduction of these "uncompatible" verticals skips ? I've tried several, but even this one isn't compatible. \setuphead [section] [before={}, % also tried \blank[nowhite] and \blank[back] inbetween={}, after={}, beforesection={}, aftersection={}, alternative=text, style=\tf] Le 15/05/2024 à 13:09, Wolfgang Schuster a écrit :
garulfo@azules.eu schrieb am 14.05.2024 um 23:13:
Hi all,
\startshapetext works pretty well, but when I use \startsection \stopsection, shapes are not respected anymore. I use layers, to be able to place the content anywhere, but the issue remains without layers.
Any clues ? (\placeinitial seems also to break the shaping)
Example : 2 pages without sectioning, and after 2 pages by uncommenting the \startsection and \stopsection commands.
[...] \dorecurse{5}{ \startsection[title={Title for section{\recurselevel}}] \darkred\input knuth \par \darkblue\input ward \stopsection }
The problem aren't the section command but the vertical skips added before and after each section, you can reproduce the effect when you add \blank to your example.
\dorecurse{5}{ \blank \leftaligned{Title for section{\recurselevel}} \blank \darkred\input knuth \par \darkblue\input ward }
Wolfgang
participants (3)
-
Garulfo
-
garulfo@azules.eu
-
Wolfgang Schuster