* [NTG-context] compatibility between \startshapetext and \startsection ?
@ 2024-05-14 21:13 garulfo
2024-05-15 11:09 ` [NTG-context] " Wolfgang Schuster
0 siblings, 1 reply; 3+ messages in thread
From: garulfo @ 2024-05-14 21:13 UTC (permalink / raw)
To: ntg-context
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
%==============================================================================
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* [NTG-context] Re: compatibility between \startshapetext and \startsection ?
2024-05-14 21:13 [NTG-context] compatibility between \startshapetext and \startsection ? garulfo
@ 2024-05-15 11:09 ` Wolfgang Schuster
2024-05-15 19:40 ` Garulfo
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2024-05-15 11:09 UTC (permalink / raw)
To: mailing list for ConTeXt users, garulfo
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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* [NTG-context] Re: compatibility between \startshapetext and \startsection ?
2024-05-15 11:09 ` [NTG-context] " Wolfgang Schuster
@ 2024-05-15 19:40 ` Garulfo
0 siblings, 0 replies; 3+ messages in thread
From: Garulfo @ 2024-05-15 19:40 UTC (permalink / raw)
To: Wolfgang Schuster, mailing list for ConTeXt users
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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-15 19:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-14 21:13 [NTG-context] compatibility between \startshapetext and \startsection ? garulfo
2024-05-15 11:09 ` [NTG-context] " Wolfgang Schuster
2024-05-15 19:40 ` Garulfo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).