From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from cgl.ntg.nl (Cgl.ntg.nl [5.39.185.202]) by inbox.vuxu.org (Postfix) with ESMTP id DA32B266FA for ; Sun, 19 May 2024 14:30:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 8040E484228 for ; Sun, 19 May 2024 14:30:16 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IoTvidnoBTBO for ; Sun, 19 May 2024 14:30:15 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 8DB0D483FC3 for ; Sun, 19 May 2024 14:30:01 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 4D329483EF1 for ; Sun, 19 May 2024 14:29:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OR_iuAj5Owiw for ; Sun, 19 May 2024 14:29:51 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 005EB483EED for ; Sun, 19 May 2024 14:29:50 +0200 (CEST) MIME-Version: 1.0 From: garulfo@azules.eu To: ntg-context@ntg.nl Date: Sun, 19 May 2024 12:29:50 -0000 Message-ID: <171612179098.1997.11753864538291589840@cgl.ntg.nl> User-Agent: HyperKitty on http://mailman.ntg.nl/ Message-ID-Hash: EYXM7XP6DFHHFHZOJKWXBHO3AKPPVTHK X-Message-ID-Hash: EYXM7XP6DFHHFHZOJKWXBHO3AKPPVTHK X-MailFrom: garulfo@azules.eu X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] build_parshape and \getshapetext - need for a deeper understanding List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I still get some difficulties with build_parshape, \getshapetex and sectionning. I though I find a solution by removing \blank with \setuphead [subsection] [before=, after=, style=, command=\MySubSectionCommand, alternative=text ] But actually it's not enough : when I add text before the first section, new issues appear. I tried to build a MVE by refactoring and tidying as much as I could. It build 3 comparative pages (i) basic issue, (ii) solution, (iii) remaining issue. Your guidance are most welcome :-) \setupbodyfont[11pt] %------------------------------------------------------------------------------ \usecolors[svg] \definemeasure [mywidth] [7cm] \definemeasure [mywidtha] [5cm] \definemeasure [myheight] [{\the\dimexpr\baselineskip*37+\lineskip\relax}] \definemeasure [myheighta] [{\the\dimexpr\baselineskip*18+\lineskip*1\relax}] \definemeasure [myheightb] [{\the\dimexpr\baselineskip*25-\lineskip*1\relax}] \startuseMPgraphic{mymetafunpath} path p ; numeric mywidth ; mywidth := \measure{mywidth}; numeric mywidtha ; mywidtha := \measure{mywidtha}; numeric myheight ; myheight := \measure{myheight}; numeric myheighta ; myheighta := \measure{myheighta}; numeric myheightb ; myheightb := \measure{myheightb}; p := (0,0) -- (mywidth,0) -- (mywidth,myheighta) -- (mywidtha,myheighta) -- (mywidtha,myheightb) -- (mywidth,myheightb) -- (mywidth,myheight) -- (0cm,myheight) -- cycle; build_parshape(p,0,0,0,\baselinedistance,\strutheight,\strutdepth,\topskip) ; fill p withcolor \MPcolor{tan}; \stopuseMPgraphic \defineoverlay[myoverlay][\useMPgraphic{mymetafunpath}] %------------------------------------------------------------------------------ \define[2]\MySubSectionCommand{\leftaligned{#2}} %------------------------------------------------------------------------------ \define[2]\MyPageBuilder{% \page \setupbackgrounds[page][background=testA] \definelayer[testA] [x=0mm, y=0mm,width=\paperwidth, height=\paperheight] ~ \startshapetext[mymetafunpath, mymetafunpath] % <=== WITHOUT \startsubsection #2 %\startsubsection[title={Title for section #1}] \MySubSectionCommand{1}{Title for section #1} \input knuth \endgraf \input ward %\stopsubsection \stopshapetext \setlayer [testA] [hoffset={\the\dimexpr\backspace\relax}, voffset={\the\dimexpr\topspace+\headerheight+\headerdistance\relax},] {\framed[background=myoverlay,frame=off]{\strut\getshapetext}} \startshapetext[mymetafunpath, mymetafunpath] % <===== WITH \startsubsection #2 \startsubsection[title={Title for section #1}] %\MySubSectionCommand{1}{Title for section #1} \input knuth \endgraf \input ward \stopsubsection \stopshapetext \setlayer [testA] [hoffset={\the\dimexpr\backspace+\measure{mywidth}+5mm\relax}, voffset={\the\dimexpr\topspace+\headerheight+\headerdistance\relax},] {\framed[background=myoverlay,frame=off]{\strut\getshapetext}} } %============================================================================== %\showboxes \starttext \MyPageBuilder{A}{} \setuphead [subsection] [ before=, after=, style=, command=\MySubSectionCommand, alternative=text, ] \MyPageBuilder{B}{} \MyPageBuilder{C}{\strut Hi from here. \endgraf} \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 ___________________________________________________________________________________