Re: [NTG-context] Typesetting poetry with particular indenting

2020-07-02 Thread Floris van Manen


On 02/07/2020 20:46, Wolfgang Schuster wrote:
> The following example needs version 2020.07.02 or newer.
Nice !

.F


pEpkey.asc
Description: application/pgp-keys
___
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
___


Re: [NTG-context] Typesetting poetry with particular indenting

2020-07-02 Thread Wolfgang Schuster

Tommaso Gordini schrieb am 02.07.2020 um 17:33:
I have found this, that works, buy I don't know if there's a possibility 
of using less code:


[...]


The following example needs version 2020.07.02 or newer.

 begin example
\definelines [poem]

\setuplines
  [poem]
  [ 
before={\startframedtext[location=middle,width=fit,offset=none,frame=off]},

after={\stopframedtext},
   indentlist={0em,1em,1em}]

\starttext

\startpoem
Per correr miglior acque alza le vele
omai la navicella del mio ingegno,
che lascia dietro a sé mar sì crudele;
e canterò di quel secondo regno
dove l'umano spirito si purga
e di salire al ciel diventa degno.
Ma qui la morta poesì resurga,
o sante Muse, poi che vostro sono;
e qui Calïopè alquanto surga,
seguitando il mio canto con quel suono
di cui le Piche misere sentiro
lo colpo tal, che disperar perdono.
\stoppoem

\stoptext
 end example

Wolfgang
___
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
___


Re: [NTG-context] Store images and text in the right margin

2020-07-02 Thread Marco Patzer
On Thu, 2 Jul 2020 17:20:07 +0200
Fabrice Couvreur  wrote:

Try:

> \useMPlibrary[dum]
> 
> \setuppapersize[A4]
> 
> \setuplayout
>   [width=12cm,
>rightmargin=5cm]
> 
> \definemargindata[marginfigure][inright]
> \setupmargindata [marginfigure][command=\vbox,align=middle]

\setupmargindata [marginfigure][command=\vbox,align=middle,stack=yes]

> \startsetups [userdata:margintext]
>   \margindata
> [inright]
> [%style=\smallbodyfont,
>  style={\switchtobodyfont[9pt]},
>  width=\rightmarginwidth,

  stack=yes,

>  align={flushleft,broad}]
> {{\bf Remarque — }\getinlineuserdata}
> \stopsetups

> \marginfigure{\externalfigure[dummy][width=\rightmarginwidth]}

\marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=high]}

Marco
___
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
___


Re: [NTG-context] Typesetting poetry with particular indenting

2020-07-02 Thread Tommaso Gordini
I have found this, that works, buy I don't know if there's a possibility of
using less code:

% !TEX encoding = UTF-8 Unicode

% !TEX TS-program = ConTeXt-MkIV


% questo codice centra il blocco dei versi sulla pagina

\defineframedtext

  [poemframed]

  [width=\textwidth,

   autowidth=force,

   align=flushleft,

   before=,

   after=,

   frame=off]


\definenarrower[poemnarrower]


\definelines

  [poemlines]

  [before={\startpoemnarrower[left]},

   after=\stoppoemnarrower]


\definebuffer[poem]


\def\stoppoem{\setups{poems:buffer}}


\startsetups poems:buffer

  \setupnarrower[poemnarrower][left=0pt]

  \setbox\scratchbox\vbox

{\poemframed

{\startpoemlines

   \getpoem

  \stoppoemlines}}

  \edef\poemhsize{\the\dimexpr(\hsize-\wd\scratchbox)/2\relax}

  \setupnarrower[poemnarrower][left=\poemhsize]

  \startpoemlines

\getpoem

  \stoppoemlines

\stopsetups


% questo codice rientra ogni secondo e terzo verso

\unprotect

\installindentingmethod {three} {\c_spac_indentation_toggle_state\plusthree}


\unexpanded\def\spac_indentation_tri_toggle_indeed

  {\glet\checkindentation\spac_indentation_tri_toggle}


\unexpanded\def\spac_indentation_tri_toggle

  {\gdef\checkindentation

  {\spac_indentation_remove

   \gdef\checkindentation{\spac_indentation_tri_toggle_indeed}}}


% this next macro is redefinition of a core macro!

\def\spac_indentation_check_toggle

 {\ifcase\c_spac_indentation_toggle_state

% nothing

  \or

\spac_indentation_no_toggle

  \or

\spac_indentation_do_toggle

  \or

\spac_indentation_tri_toggle

  \fi}

\protect


% questo codice attiva il rientro

\setupindenting[yes,1em]

\setuplines[indenting=three]


\starttext


\startpoem

Per correr miglior acque alza le vele

omai la navicella del mio ingegno,

che lascia dietro a sé mar sì crudele;

e canterò di quel secondo regno

dove l'umano spirito si purga

e di salire al ciel diventa degno.

Ma qui la morta poesì resurga,

o sante Muse, poi che vostro sono;

e qui Calïopè alquanto surga,

seguitando il mio canto con quel suono

di cui le Piche misere sentiro

lo colpo tal, che disperar perdono.
\stoppoem

\stoptext

Il giorno gio 2 lug 2020 alle ore 17:14 Tommaso Gordini <
illinguista1...@gmail.com> ha scritto:

> Thanks, Wolfgang. Your example works, but the verse indentation (
> \setuplines[indenting=three]) is lost.
> There's a way to preserve it?
>
> Tommy
>
>
___
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
___


[NTG-context] Store images and text in the right margin

2020-07-02 Thread Fabrice Couvreur
Hello everyone and in particular to Wolfgang who has already provided me
with the solution below. I will have to write a Mathematics book for my
students and the remarks and graphics should be in the right margin. I got
the code written by Wolfgang and tried to include the graphics in it. The
result is not as expected because the graphic overflows on the text.
The course will be written in A4 format with an 11 pts font.
Thanks for your help.
Fabrice

\useMPlibrary[dum]

\setuppapersize[A4]

\setuplayout
  [width=12cm,
   rightmargin=5cm]

\definemargindata[marginfigure][inright]
\setupmargindata [marginfigure][command=\vbox,align=middle]

\defineuserdata [margintext] [alternative=margintext]

\defineuserdataalternative [margintext] [renderingsetup=userdata:margintext]

\startsetups [userdata:margintext]
  \margindata
[inright]
[%style=\smallbodyfont,
 style={\switchtobodyfont[9pt]},
 width=\rightmarginwidth,
 align={flushleft,broad}]
{{\bf Remarque — }\getinlineuserdata}
\stopsetups

\showframe
\starttext
\startuserdata[margintext]
 \input ward
\stopuserdata
\marginfigure{\externalfigure[dummy][width=\rightmarginwidth]}
\startchapter[title=First chapter]
\dorecurse{2}{\input knuth}
\stopchapter
\stoptext
___
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
___


Re: [NTG-context] Typesetting poetry with particular indenting

2020-07-02 Thread Tommaso Gordini
Thanks, Wolfgang. Your example works, but the verse indentation (
\setuplines[indenting=three]) is lost.
There's a way to preserve it?

Tommy
___
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
___


Re: [NTG-context] Typesetting poetry with particular indenting

2020-07-02 Thread Wolfgang Schuster

Tommaso Gordini schrieb am 02.07.2020 um 16:48:

Taco, this works!
Thank you!

Now (last question), it's possibile to centering in the middle of the 
page the whole verse block ?
You can use the framedtext environment but the content can no longer 
split across pages.


\starttext

\startframedtext[middle][frame=off,width=fit]
\startlines
Per correr miglior acque alza le vele
omai la navicella del mio ingegno,
che lascia dietro a sé mar sì crudele;
e canterò di quel secondo regno
dove l'umano spirito si purga
e di salire al ciel diventa degno.
\stoplines
\stopframedtext

\stoptext

Wolfgang

___
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
___


Re: [NTG-context] Typesetting poetry with particular indenting

2020-07-02 Thread Wolfgang Schuster

Hans Hagen schrieb am 02.07.2020 um 16:48:

On 7/2/2020 4:15 PM, Wolfgang Schuster wrote:

Hans Hagen schrieb am 02.07.2020 um 15:40:

On 7/2/2020 3:01 PM, Tommaso Gordini wrote:

[...]

I'll add this

\setuplines[indentnext={0pt,10pt,15pt,20pt}]

% \setuplines[indentnext={0pt,*,*}]

which then is a challenge for WS to get in the setups and for you to 
wikify


Are you sure you use the correct key?


Well, we have that key (and maybe some day we can do that for all), i 
was wondering about 'left' but then we'd need some \cycle command or so


But indentnext is only used to prevent or allow indentation of a 
paragraph at the end of an environment.


Wolfgang

___
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
___


Re: [NTG-context] Typesetting poetry with particular indenting

2020-07-02 Thread Hans Hagen

On 7/2/2020 4:15 PM, Wolfgang Schuster wrote:

Hans Hagen schrieb am 02.07.2020 um 15:40:

On 7/2/2020 3:01 PM, Tommaso Gordini wrote:

Hi everyone.

I am typesetting a poetry text in triplets and I would like the 
second and third lines of each triplet to be indented (i.e., in the 
next example, verse no. 2, 3, 5, and 6).


Is it possible to get what I ask for with ConTeXt?

The most I managed to do is this:

\starttext

\setupindenting[yes,1em]
\setuplines[indenting=even]

\startlines
Per correr miglior acque alza le vele
omai la navicella del mio ingegno,
che lascia dietro a sé mar sì crudele;
e canterò di quel secondo regno
dove l'umano spirito si purga
e di salire al ciel diventa degno.
\stoplines

\stoptext

but that's not what I want.

I'll add this

\setuplines[indentnext={0pt,10pt,15pt,20pt}]

% \setuplines[indentnext={0pt,*,*}]

which then is a challenge for WS to get in the setups and for you to 
wikify


Are you sure you use the correct key?


Well, we have that key (and maybe some day we can do that for all), i 
was wondering about 'left' but then we'd need some \cycle command or so


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
___


Re: [NTG-context] Typesetting poetry with particular indenting

2020-07-02 Thread Tommaso Gordini
Taco, this works!
Thank you!

Now (last question), it's possibile to centering in the middle of the page
the whole verse block ?

Tommy

Il giorno gio 2 lug 2020 alle ore 15:56 Taco Hoekwater 
ha scritto:

>
> I was having fun with this as well while Hans was writing his generic
> solution.
>
> Here is an explicit ‘indent each 2nd and 3rd line’:
>
> 
> \unprotect
>
> \installindentingmethod {three}
> {\c_spac_indentation_toggle_state\plusthree}
>
> \unexpanded\def\spac_indentation_tri_toggle_indeed
>   {\glet\checkindentation\spac_indentation_tri_toggle}
>
> \unexpanded\def\spac_indentation_tri_toggle
>   {\gdef\checkindentation
>   {\spac_indentation_remove
>\gdef\checkindentation{\spac_indentation_tri_toggle_indeed}}}
>
> % this next macro is redefinition of a core macro !
> \def\spac_indentation_check_toggle
>  {\ifcase\c_spac_indentation_toggle_state
> % nothing
>   \or
> \spac_indentation_no_toggle
>   \or
> \spac_indentation_do_toggle
>   \or
> \spac_indentation_tri_toggle
>   \fi}
> \protect
> %%
>
> to be used with:
>
>   \setuplines[indenting=three]
>
>
> Best wishes,
> Taco
>
> > On 2 Jul 2020, at 15:01, Tommaso Gordini 
> wrote:
> >
> > \starttext
> >
> > \setupindenting[yes,1em]
> > \setuplines[indenting=even]
> >
> > \startlines
> > Per correr miglior acque alza le vele
> > omai la navicella del mio ingegno,
> > che lascia dietro a sé mar sì crudele;
> > e canterò di quel secondo regno
> > dove l'umano spirito si purga
> > e di salire al ciel diventa degno.
> > \stoplines
> >
> > \stoptext
>
> Taco Hoekwater
> Elvenkind BV
>
>
>
>
>
> ___
> 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
___


Re: [NTG-context] Typesetting poetry with particular indenting

2020-07-02 Thread Wolfgang Schuster

Hans Hagen schrieb am 02.07.2020 um 15:40:

On 7/2/2020 3:01 PM, Tommaso Gordini wrote:

Hi everyone.

I am typesetting a poetry text in triplets and I would like the 
second and third lines of each triplet to be indented (i.e., in the 
next example, verse no. 2, 3, 5, and 6).


Is it possible to get what I ask for with ConTeXt?

The most I managed to do is this:

\starttext

\setupindenting[yes,1em]
\setuplines[indenting=even]

\startlines
Per correr miglior acque alza le vele
omai la navicella del mio ingegno,
che lascia dietro a sé mar sì crudele;
e canterò di quel secondo regno
dove l'umano spirito si purga
e di salire al ciel diventa degno.
\stoplines

\stoptext

but that's not what I want.

I'll add this

\setuplines[indentnext={0pt,10pt,15pt,20pt}]

% \setuplines[indentnext={0pt,*,*}]

which then is a challenge for WS to get in the setups and for you to 
wikify


Are you sure you use the correct key?

Wolfgang

___
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
___


Re: [NTG-context] Typesetting poetry with particular indenting

2020-07-02 Thread Taco Hoekwater

I was having fun with this as well while Hans was writing his generic solution. 

Here is an explicit ‘indent each 2nd and 3rd line’:


\unprotect

\installindentingmethod {three} {\c_spac_indentation_toggle_state\plusthree}
  
\unexpanded\def\spac_indentation_tri_toggle_indeed
  {\glet\checkindentation\spac_indentation_tri_toggle}

\unexpanded\def\spac_indentation_tri_toggle
  {\gdef\checkindentation
  {\spac_indentation_remove
   \gdef\checkindentation{\spac_indentation_tri_toggle_indeed}}}

% this next macro is redefinition of a core macro !
\def\spac_indentation_check_toggle
 {\ifcase\c_spac_indentation_toggle_state
% nothing
  \or
\spac_indentation_no_toggle
  \or
\spac_indentation_do_toggle
  \or
\spac_indentation_tri_toggle
  \fi}
\protect
%%

to be used with:

  \setuplines[indenting=three]


Best wishes,
Taco

> On 2 Jul 2020, at 15:01, Tommaso Gordini  wrote:
> 
> \starttext
> 
> \setupindenting[yes,1em]
> \setuplines[indenting=even]
> 
> \startlines
> Per correr miglior acque alza le vele
> omai la navicella del mio ingegno,
> che lascia dietro a sé mar sì crudele;
> e canterò di quel secondo regno
> dove l'umano spirito si purga
> e di salire al ciel diventa degno.
> \stoplines
> 
> \stoptext

Taco Hoekwater
Elvenkind BV




___
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
___


Re: [NTG-context] Typesetting poetry with particular indenting

2020-07-02 Thread Hans Hagen

On 7/2/2020 3:01 PM, Tommaso Gordini wrote:

Hi everyone.

I am typesetting a poetry text in triplets and I would like the second 
and third lines of each triplet to be indented (i.e., in the next 
example, verse no. 2, 3, 5, and 6).


Is it possible to get what I ask for with ConTeXt?

The most I managed to do is this:

\starttext

\setupindenting[yes,1em]
\setuplines[indenting=even]

\startlines
Per correr miglior acque alza le vele
omai la navicella del mio ingegno,
che lascia dietro a sé mar sì crudele;
e canterò di quel secondo regno
dove l'umano spirito si purga
e di salire al ciel diventa degno.
\stoplines

\stoptext

but that's not what I want.

I'll add this

\setuplines[indentnext={0pt,10pt,15pt,20pt}]

% \setuplines[indentnext={0pt,*,*}]

which then is a challenge for WS to get in the setups and for you to wikify

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
___


[NTG-context] Typesetting poetry with particular indenting

2020-07-02 Thread Tommaso Gordini
Hi everyone.

I am typesetting a poetry text in triplets and I would like the second and
third lines of each triplet to be indented (i.e., in the next example,
verse no. 2, 3, 5, and 6).

Is it possible to get what I ask for with ConTeXt?

The most I managed to do is this:

\starttext

\setupindenting[yes,1em]
\setuplines[indenting=even]

\startlines
Per correr miglior acque alza le vele
omai la navicella del mio ingegno,
che lascia dietro a sé mar sì crudele;
e canterò di quel secondo regno
dove l'umano spirito si purga
e di salire al ciel diventa degno.
\stoplines

\stoptext

but that's not what I want.

Thank you very much in advance?
Tommy
___
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
___


[NTG-context] Fwd: TeX Annual Meeting 2020 going online

2020-07-02 Thread Taco Hoekwater
Hi all,

See the announcement for the (online) TUG 2020 meeting below.

Best wishes,
Taco

> Begin forwarded message:
> 
> From: Paulo Ney DE SOUZA 
> Subject: TeX Annual Meeting 2020 going online
> Date: 1 July 2020 at 21:32:35 CEST
> 
> ---
> The TeX annual user conference TUG 2020 is going digital on July 24, 25, 26. 
> Register for free!
> 
> As we move TUG 2020 completely online, we look forward to offering you the 
> same vibrant programming, innovative and timely content from presenters, and 
> opportunities to reflect and connect over the emerging topics in TeX and 
> typography with users across the world. The online conference will include 
> our regular offerings and opportunities for engagement, including sessions, 
> workshops, keynotes, and space to connect with users, from across the globe.
> 
> We will have keynote addresses by Steven Matteson, the designer of the NOTO 
> fonts and John MacFarlane the author of Pandoc. We will also feature 
> interviews with Javier Bezos of Babel and Philip Kime  of BibLaTeX.
> 
>  In addition to participating in the live event, all attendees will have 
> access to break-out rooms for networking and social engagement. Moving our 
> face-to-face conference to a fully online format presents us with the unique 
> opportunity to spotlight the best of what the online modality affords – 
> meaningful collaboration and the ability to reflect and connect with 
> colleagues around the world. We hope that you will join us for this 
> reimagined event, and celebrate our collective resilience and dedication to 
> forging connections without boundaries.
> 
> We look forward to welcoming you to the TUG 2020 Online Conference in July, 
> and we are here to help you however we can with questions and requests for 
> support.  Please feel free to reach out to us with requests related to TUG 
> 2020 at
> 
>   tug-conferen...@tug.org 
> 
> Registration is required. While access to the meeting will be free to 
> everyone, you will be required to register to view the meeting. Even if you 
> registered to attend the TUG 2020 at RIT, you will need to register again for 
> TUG 2020 Online. Registration for the meeting is open at
> 
>   https://tug.org/tug2020/ 
> 
> Paulo Ney de Souza
> TUG 2020 Organizers

Taco Hoekwater
Elvenkind BV




___
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
___