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=DKIM_INVALID,DKIM_SIGNED, 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 17CB0258A7 for ; Sun, 19 May 2024 17:13:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id EF6A2483F4C for ; Sun, 19 May 2024 17:13:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Authentication-Results: cgl.ntg.nl (amavisd-new); dkim=fail (1024-bit key) reason="fail (message has been altered)" header.d=freedom.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 axkTCesu8L0e for ; Sun, 19 May 2024 17:13:22 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 271AF483A8A for ; Sun, 19 May 2024 17:13:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 7886948138F for ; Sun, 19 May 2024 17:12:53 +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 Bna2Kta3uktT for ; Sun, 19 May 2024 17:12:53 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=185.233.34.146; helo=outbound.soverin.net; envelope-from=j.hagen@freedom.nl; receiver= Received: from outbound.soverin.net (outbound.soverin.net [185.233.34.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id F360F481350 for ; Sun, 19 May 2024 17:12:52 +0200 (CEST) Received: from smtp.freedom.nl (c04cst-smtp-frd01.int.sover.in [10.10.4.107]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 4Vj42D3j03z4c for ; Sun, 19 May 2024 15:12:52 +0000 (UTC) Received: from smtp.freedom.nl (smtp.freedom.nl [10.10.4.107]) by freedom.nl (Postfix) with ESMTPSA id 4Vj42C49nQz4y for ; Sun, 19 May 2024 15:12:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freedom.nl; s=default; t=1716131572; bh=NrAJSN2ZL4aJmssdQB/zY8K/+XB8HiLGQdk2RSjgP4g=; h=Date:Subject:To:References:From:In-Reply-To:From; b=KEGJnUUbA1hI5UwmHhUCV5arcxCRS7xBJex4T1oHwMJ1ZyPsp7dWoe+TBxLO/qoBx TlwTrEagI1eb6Rc1QAr1X93MmbQ1uhDcKjnw6hSRoVcRLnruJ9HeEtknkLNRwQc+y7 glc4F4y399At6CnT5uls368H15Oz0V6pfeTkkfu8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freedom.nl; s=default; t=1716131571; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UEQYYv3nu+N5RrkM1Bt4E/YT5GXHLV70FJqWwiQLeL4=; b=mRSZ15+7W9UvKspkFBc0lWLwxnUCO/UJYtjoj+0JqnKWGmZiaWsySA2McVpXjOufwaw0eL m+0z3r4KVC4KdP3C1xq/Yn0I3xtObPzLV6OAWAkXFWIbOufMqouzUTqn8vVvOJU7JRKfaK B9vHu9nO1qzL80vo7U9dvfvnhF62zhc= ARC-Authentication-Results: i=1; smtp.freedom.nl; auth=pass smtp.mailfrom=j.hagen@freedom.nl ARC-Seal: i=1; s=default; d=freedom.nl; t=1716131571; a=rsa-sha256; cv=none; b=t9v8vLk8YA9nCDBg//jtG/oI0s8OGCtP0KXCiP5ZR8NWSzkTX1TcQ9J/WaAfVv4aYtZ1/y yYc6l+L9wlnTVU75laL4eG6GktVUPSVoIRafw8lyOB3U3XPr9nB9Ig5FCA4tmiTJNBnd4i fEg12mJDUP7+G3JGfbJm6ycISB/PEMg= Message-ID: <9436fe50-19d5-4465-9532-87781aaaf84e@freedom.nl> Date: Sun, 19 May 2024 17:12:51 +0200 MIME-Version: 1.0 Content-Language: en-US To: ntg-context@ntg.nl References: <171612179098.1997.11753864538291589840@cgl.ntg.nl> X-Soverin-Authenticated: true In-Reply-To: <171612179098.1997.11753864538291589840@cgl.ntg.nl> X-Spampanel-Class: ham Message-ID-Hash: JJZLBEC2JEPTQQOL3GDJ3RQQCUBVRSPN X-Message-ID-Hash: JJZLBEC2JEPTQQOL3GDJ3RQQCUBVRSPN X-MailFrom: j.hagen@freedom.nl 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] Re: 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: From: Hans Hagen via ntg-context Cc: Hans Hagen Content-Type: text/plain; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit On 5/19/2024 2:29 PM, garulfo@azules.eu wrote: > 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 :-) you have to fight several issues: - parshapes being reset at the end paragraph (handled here by luametatex context) - parshapes operate on lines, not dimension (i might add an aletnative one day) - you use a bit old mechanism (checkout the luametafun-paragraphs chapter) Now, is there a solution? It really depends on the circumstances, so here is one. \setupbodyfont[11pt] \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{shape:1} 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) ; path SavedShape ; SavedShape := p ; \stopuseMPgraphic \startuseMPgraphic{shape:2} SavedShape := SavedShape shifted (0,-ypart urcorner OverlayBox) ; SavedShape := SavedShape shifted (0,positiony("test")) ; fill SavedShape withcolor red; setbounds currentpicture to OverlayBox; \stopuseMPgraphic \showframe \defineoverlay[myoverlay][\useMPgraphic{shape:2}] \setupbackgrounds[text][text][background=myoverlay] \startsection[title={test}] \startshapedparagraph[mp=shape:1]% \setupalign[verytolerant,stretch]% \hpos{test}{!}\samplefile{tufte} \samplefile{tufte} \stopshapedparagraph \stopsection The "test" position is hard coded but should be namespaced, the ! can be a \strut instead. So, more thinking from the end of the text flow. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________