ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* formating paragraph question
@ 1999-10-28 13:37 grzegorz.sapijaszko
  1999-10-28 14:02 ` Hans Hagen
  1999-10-28 15:13 ` Taco Hoekwater
  0 siblings, 2 replies; 5+ messages in thread
From: grzegorz.sapijaszko @ 1999-10-28 13:37 UTC (permalink / raw)


Hi,

for formating a limerick I'm using the code:

\startnarrower
\startlines
\switchtobodyfont[ant,9pt]
The Swiss kicked him out on his ass.
M. Papon will no longer pass
\hskip1.3em For a free man. Long due,
\hskip1.3em Will a sentence come through?
We hope so. It should be a gas.
\vskip1.5ex
\hskip2em David Franks
\stoplines
\stopnarrower

I was trying to define paragraph like:

\defineparagraphs[limeryk]
   [n=1,before={\startnarrower\startlines},after={\stopnarrower\stoplines}]

\setupparagraphs[limeryk]
   [style={\switchtobodyfont[ant,9pt]}]

but when compile, become a warning (error?):

! Extra }, or forgotten \endgroup.
\stopsmaller ->\par \egroup

\@@allimerykna ->\stopnarrower
                               \stoplines
\stoplimeryk ->\getvalue {limeryk}
                                  \egroup
l.69 \stoplimeryk

Through, the resulting pdf looks good.

And the second question:

is there a way to format automatically these 5 (optionally, with author name, 6)
 limerick lines, that is add (in macro) \hskip for 3-th and 4th line?

1  The Swiss kicked him out on his ass.
2  M. Papon will no longer pass
3  \hskip1.3em For a free man. Long due,
4  \hskip1.3em Will a sentence come through?
5  We hope so. It should be a gas.
\vskip1.5ex
6 \hskip2em David Franks

Greetings,
Grzesiek


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: formating paragraph question
  1999-10-28 13:37 formating paragraph question grzegorz.sapijaszko
@ 1999-10-28 14:02 ` Hans Hagen
  1999-10-28 15:13 ` Taco Hoekwater
  1 sibling, 0 replies; 5+ messages in thread
From: Hans Hagen @ 1999-10-28 14:02 UTC (permalink / raw)
  Cc: ntg-context

grzegorz.sapijaszko@pl.abb.com wrote:

> \defineparagraphs[limeryk]
>    [n=1,before={\startnarrower\startlines},after={\stopnarrower\stoplines}]

a matter of nesting and symmetry:                  
\stoplines\stopnarrower

> is there a way to format automatically these 5 (optionally, with author name, 6)
>  limerick lines, that is add (in macro) \hskip for 3-th and 4th line?
> 
> 1  The Swiss kicked him out on his ass.
> 2  M. Papon will no longer pass
> 3  \hskip1.3em For a free man. Long due,
> 4  \hskip1.3em Will a sentence come through?
> 5  We hope so. It should be a gas.
> \vskip1.5ex
> 6 \hskip2em David Franks

There is odd/even indentation support, but this limerick would go beyond
logic -)

\def\StartLimeric%
  {\startpacked
   \newcounter\LimericLine
   \def\\%
     {\increment\LimericLine\relax
      \ifcase\LimericLine\relax
      \or   \endgraf
      \or   \endgraf \hskip.3em
      \or   \endgraf \hskip.3em  
      \or   \endgraf
      \or   \endgraf \vskip.5ex 
      \else \endgraf \fi}

\def\StopLimeric%
  {\stoppacked}

\StartLimeric 
  line 1 \\ 
  line 2 \\ 
  line 3 \\ 
  line 4 \\
  line 5 \\
  line 6 \\
\StopLimeric

Untested, but that's the way. We could collect such macros in a poetry
module. 

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: formating paragraph question
  1999-10-28 15:13 ` Taco Hoekwater
@ 1999-10-28 14:39   ` Hans Hagen
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 1999-10-28 14:39 UTC (permalink / raw)
  Cc: grzegorz.sapijaszko, ntg-context

Taco Hoekwater wrote:

> \newcount\mylines
> \def\mypars
>  {\mylines=0
>   \def\obeyedline{%
>     \par
>     \ifcase\mylines \parindent 0em %1
>         \or                        %2
>         \or \parindent 1.5em       %3
>         \or                        %4
>             \or \parindent 0em         %5
>         \or \vskip 1.5ex\parindent 2em %6
>         \else                      % >6
>         \fi
>     \advance\mylines1 }}%
> 
>     grzegorz> \setupparagraphs[limeryk]
>     grzegorz> [style={\switchtobodyfont[ant,9pt]}]
> 
>     grzegorz> is there a way to format automatically these 5
>     grzegorz> (optionally, with author name, 6) limerick lines, that
>     grzegorz> is add (in macro) \hskip for 3-th and 4th line?
> 
> This is what \mypars does. Input becomes:

Ha, we have synchonized thoughts, but slightly different solutions. I'll
keep my mouth shut for a while! 

Btw, there is a real dirty trick (for taco only), which could work too:

  \defineconversion[limeric][\fakelinenumber]

where \fakelinenumber is an \ifcase. Actually, one can also use
\EveryPar, and use the linenumber as trigger. Maybe we should write an
article on this: 50 ways to typeset limerics or so. Is there, --frans
will probably know-- a standard on typesetting poetry? 

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: formating paragraph question
  1999-10-28 13:37 formating paragraph question grzegorz.sapijaszko
  1999-10-28 14:02 ` Hans Hagen
@ 1999-10-28 15:13 ` Taco Hoekwater
  1999-10-28 14:39   ` Hans Hagen
  1 sibling, 1 reply; 5+ messages in thread
From: Taco Hoekwater @ 1999-10-28 15:13 UTC (permalink / raw)
  Cc: ntg-context

>>>>> "grzegorz" == grzegorz sapijaszko <grzegorz.sapijaszko@pl.abb.com> writes:

    grzegorz> Hi,

    grzegorz> for formating a limerick I'm using the code:

    grzegorz> I was trying to define paragraph like:

    grzegorz> \defineparagraphs[limeryk]
    grzegorz> [n=1,before={\startnarrower\startlines},after={\stopnarrower\stoplines}]

You need to reverse \stopnarrower and \stoplines

\defineparagraphs[limeryk]
   [n=1,before={\startnarrower\startlines\mypars},after={\stoplines\stopnarrower}]

\newcount\mylines
\def\mypars
 {\mylines=0 
  \def\obeyedline{%
    \par 
    \ifcase\mylines \parindent 0em %1
        \or                        %2 
        \or \parindent 1.5em       %3
        \or                        %4
	    \or \parindent 0em         %5
        \or \vskip 1.5ex\parindent 2em %6
        \else                      % >6 
        \fi
    \advance\mylines1 }}%

    grzegorz> \setupparagraphs[limeryk]
    grzegorz> [style={\switchtobodyfont[ant,9pt]}]

    grzegorz> is there a way to format automatically these 5
    grzegorz> (optionally, with author name, 6) limerick lines, that
    grzegorz> is add (in macro) \hskip for 3-th and 4th line?

This is what \mypars does. Input becomes:

\startlimeryk
The Swiss kicked him out on his ass.
M. Papon will no longer pass
  For a free man. Long due,
  Will a sentence come through?
We hope so. It should be a gas.

  David Franks
\stoplimeryk

(with or without the empty lines and indentation)

Greetings, Taco

-- 
Taco Hoekwater                                 taco.hoekwater@wkap.nl
Kluwer Academic Publishers                            -- Pre Press --
Achterom 119, 3311 KB Dordrecht, The Netherlands  tel.  31-78-6392550
---------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: formating paragraph question
@ 1999-10-28 21:03 Grzegorz Sapijaszko
  0 siblings, 0 replies; 5+ messages in thread
From: Grzegorz Sapijaszko @ 1999-10-28 21:03 UTC (permalink / raw)


Dnia 28 Oct 99, Hans Hagen pisal:

> Ha, we have synchonized thoughts, but slightly different solutions. I'll
> keep my mouth shut for a while! 

If you want... but only for while :-) your answers are very helpfull. 
Thanks you and Taco , the limericks looks beautiful and the typing 
is easy.

> Maybe we should write an
> article on this: 50 ways to typeset limerics or so. 

As one part of uptodate? If you want 50 limericks, I send you a 
some. :-)

> Is there, --frans
> will probably know-- a standard on typesetting poetry? 

The limerics are typed in two ways: with indented 3., and 4th lines 
or without indenting. I think, it is publisher-specific...

Greetings,
Grzesiek
-- 
A farmer I know named O'Doole
Had a long and incredible tool.
  He can use it to plow,
  Or to diddle a cow,
Or just as a cue-stick at pool.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1999-10-28 21:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-28 13:37 formating paragraph question grzegorz.sapijaszko
1999-10-28 14:02 ` Hans Hagen
1999-10-28 15:13 ` Taco Hoekwater
1999-10-28 14:39   ` Hans Hagen
1999-10-28 21:03 Grzegorz Sapijaszko

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).