ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Otared Kavian <otared@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: lmtx update / teaser
Date: Mon, 1 Mar 2021 18:27:39 +0100	[thread overview]
Message-ID: <7E03411D-ADBA-4B2A-B202-C9DEEDAC8843@gmail.com> (raw)
In-Reply-To: <6c34da9c-9315-b282-0130-ea1226d39bdc@xs4all.nl>

Hi Hans,

Thank you for the new upload.

The teaser examples work fine, many thanks !
I have a question though: how can one center within a page a text, for example typeset in a circular shape? I tried with \startalignment, and also with \startplacefigure but none of these gives a centered circular shape.

Also I noticed that if one removes the comment at the end of \startshapedparagraph, or add a blank line after that, then the circular shape is destroyed: is this on purpose ?

Best regards: Otared

% begin example-circular-shape.tex
\starttext

%\startuseMPgraphic{circle}
%	lmt_parshape [
%		path       = fullcircle scaled 136mm,
%		offset     = 2mm,
%		bottomskip = - 1.5LineHeight,
%	] ;
%\stopuseMPgraphic

\startuseMPgraphic{circleBis}
	lmt_parshape [
		path       = fullcircle scaled 90mm,
		offset     = 2mm,
		bottomskip = - 1.5LineHeight,
	] ;
\stopuseMPgraphic

\startalignment[middle]
%\startplacefigure[align=middle,number=no]
\start
\startshapedparagraph[list=circle,mp=circleBis,repeat=yes,method=repeat]%
	\setupalign[verytolerant,stretch,last]
	\dontcomplain
		{\darkred     \samplefile{thuan}}
\stopshapedparagraph
\stop
%\stopplacefigure
\stopalignment 

\stoptext
% end example-circular-shape.tex

> On 1 Mar 2021, at 15:44, Hans Hagen <j.hagen@xs4all.nl> wrote:
> 
> Hi,
> 
> I uploaded a new lmtx. As I'm currently going through the metafun todo files I ended up at the fancy shape part (parshapes) running over multiple paragraphs and decided to provide a (kind of low level) interface that integrates that. The example code is a few decades old but still works ok (i might try to improve them a bit some day). Anyway, here is a teaser:
> 
> \starttext
> 
> \startuseMPgraphic{circle}
>    lmt_parshape [
>        path       = fullcircle scaled 136mm,
>        offset     = 2mm,
>        bottomskip = - 1.5LineHeight,
>    ] ;
> \stopuseMPgraphic
> 
> \start
> \startshapedparagraph[list=circle,mp=circle,repeat=yes,method=cycle]%
>    \setupalign[verytolerant,stretch,last]\dontcomplain
>    {\darkred     \samplefile{tufte}}\par
>    {\darkgreen   \samplefile{tufte}}\par
>    {\darkblue    \samplefile{tufte}}\par
>    {\darkcyan    \samplefile{tufte}}\par
>    {\darkmagenta \samplefile{tufte}}\par
> \stopshapedparagraph
> \stop
> 
> \page
> 
> \start
> \startshapedparagraph[list=circle,mp=circle,repeat=yes,method=repeat]%
>    \setupalign[verytolerant,stretch,last]\dontcomplain
>    {\darkred     \samplefile{tufte}}
>    {\darkgreen   \samplefile{tufte}}
>    {\darkblue    \samplefile{tufte}}
>    {\darkcyan    \samplefile{tufte}}
>    {\darkmagenta \samplefile{tufte}}
> \stopshapedparagraph
> \stop
> 
> \stoptext
> 
> The interface is still somewhat rough (no grouping for instance, not a real envrionment so that might change) but seems to work ok. One can also go the tex route and say:
> 
> \startparagraphshape[test]
>    left 1mm right 1mm
>    left 2mm right 2mm
>    left 3mm right 3mm
>    copy 8
>    left 4mm right 4mm
>    left 5mm right 5mm
>    left 5mm hsize 10cm
> \stopparagraphshape
> 
> or
> 
> \startparagraphshape[test]
>    left 1mm right 1mm
>    right 3mm
>    left 5mm right 5mm
>    repeat
> \stopparagraphshape
> 
> or
> 
> \startparagraphshape[test]
>    both 1mm both 2mm both 3mm both 4mm both 5mm both 6mm
>    both 7mm both 6mm both 5mm both 4mm both 3mm both 2mm
> \stopparagraphshape
> 
> or
> 
> \startparagraphshape[test-repeat]
>    both 1mm both 2mm both 3mm both 4mm both 5mm both 6mm
>    both 7mm both 6mm both 5mm both 4mm both 3mm both 2mm
>    repeat
> \stopparagraphshape
> 
> and use that with:
> 
> \startshapedparagraph[list=test]
>    \dorecurse{8}{\showparagraphshape\samplefile{tufte} \par}
> \stopshapedparagraph
> 
> or
> 
> \startshapedparagraph[list=test-repeat]
>    \dorecurse{8}{\showparagraphshape\samplefile{tufte} \par}
> \stopshapedparagraph
> 
> Some more info is in the lowlevel-paragrsph document (part of the low level series).
> 
> This kind of features falls into the category 'fancy' (no one reqtested it), nice for posters and covers. It might evolve depending on needs for fancy features, but as said, it's currently a side track of metafun, so it's also in the category 'fun'. It's code for 'controlled' usage.
> 
> 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 / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2021-03-01 17:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01 14:44 Hans Hagen
2021-03-01 17:27 ` Otared Kavian [this message]
2021-03-01 18:13   ` Hans Hagen
2021-03-02 10:15 ` mf
2021-03-02 10:33   ` Hans Hagen
2021-03-02 10:47   ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7E03411D-ADBA-4B2A-B202-C9DEEDAC8843@gmail.com \
    --to=otared@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).