ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Linespacing in startstop
@ 2002-06-19 15:48 Idris S Hamid
  2002-06-20  7:56 ` Uwe Koloska
  0 siblings, 1 reply; 11+ messages in thread
From: Idris S Hamid @ 2002-06-19 15:48 UTC (permalink / raw)


The following two ways of defining the linespacing inside a startstop 
environment don't seem to work:

\definestartstop
  [test]
  [commands=%
     \switchtobodyfont[foo,10pt]  % may comment this as well
     %{\baselineskip 36pt}]
     {\setupinterlinespace[line=36pt]}]

Here is a test:

\starttest
This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test
\stoptest

The spacing does not change as desired.

Please advise!

Best wishes
Idris

-- 
Dr. Idris S Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80526


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

* Re: Linespacing in startstop
  2002-06-19 15:48 Linespacing in startstop Idris S Hamid
@ 2002-06-20  7:56 ` Uwe Koloska
  2002-06-20 12:35   ` Idris S Hamid
  0 siblings, 1 reply; 11+ messages in thread
From: Uwe Koloska @ 2002-06-20  7:56 UTC (permalink / raw)


Idris S Hamid wrote:
> The following two ways of defining the linespacing inside a startstop 
> environment don't seem to work:
> 
This is a version that works (but can be improved):

\definestartstop
   [test]
   [commands={\switchtobodyfont[18pt]% may comment this as well
      \setupinterlinespace[line=36pt]},after={\blank[big]}]

\starttext
Here is a test:

\starttest
This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test

\stoptest

and a few lines after the test is over and has proved to work. 
The point is the paragraph (aka newline) {\bf inside} the {\tt 
startstop} and the argument to {\tt commands} being grouped with 
  braces.

The \tex{blank} is for making the space at the bottom the same 
as the one above -- there must be a better way \dots
\stoptext

Uwe Koloska

-- 
voiceINTERconnect www.voiceinterconnect.de
... smart speech applications from germany


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

* Re: Linespacing in startstop
  2002-06-20  7:56 ` Uwe Koloska
@ 2002-06-20 12:35   ` Idris S Hamid
  2002-06-20 15:18     ` Uwe Koloska
  0 siblings, 1 reply; 11+ messages in thread
From: Idris S Hamid @ 2002-06-20 12:35 UTC (permalink / raw)


On Thursday 20 June 2002 01:56, Uwe Koloska wrote:
> Idris S Hamid wrote:
> > The following two ways of defining the linespacing inside a startstop
> > environment don't seem to work:
>
> This is a version that works (but can be improved):

Strange, it does not work at all here (there is still no proper interlineline 
spacing), and the <,after=> gets echoed in the output. This is under the 
default format file with a recent ConTeXt. Thanks for trying though. Here is 
the definition again:

\definestartstop
   [test]
   [commands={\switchtobodyfont[18pt]% may comment this as well
      \setupinterlinespace[line=36pt]}]%,after={\blank[big]}}]

Best wishes
Idris

-- 
Dr. Idris S Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80526


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

* Re: Linespacing in startstop
  2002-06-20 12:35   ` Idris S Hamid
@ 2002-06-20 15:18     ` Uwe Koloska
  2002-06-20 17:12       ` Idris S Hamid
  0 siblings, 1 reply; 11+ messages in thread
From: Uwe Koloska @ 2002-06-20 15:18 UTC (permalink / raw)


Idris S Hamid wrote:
 > On Thursday 20 June 2002 01:56, Uwe Koloska wrote:
 >
 >> Idris S Hamid wrote:
 >>
 >>> The following two ways of defining the linespacing inside
 >>> a startstop environment don't seem to work:
 >>
 >> This is a version that works (but can be improved):
 >
 >
 > Strange, it does not work at all here (there is still no
 > proper interlineline spacing), and the <,after=> gets echoed
 > in the output. This is under the default format file with a
 > recent ConTeXt. Thanks for trying though. Here is the
 > definition again:
 >
 > \definestartstop [test] [commands={\switchtobodyfont[18pt]
 >   \setupinterlinespace[line=36pt]}]%,after={\blank[big]}}]

There is (besides the commenting out) an unmatched brace. 
\switobodyfont and \setupinterlinespace have to grouped by 
braces (to ty them to commands) and \blank[big] has to be 
surrounded by braces. The curly braces [] are from commands to 
the end of \blank[big].

And have you honoured the blank line _before_ \stoptest?  This 
is important cause TeX switches linespacing at the end of a 
paragraph.  (Normally \setupinterlinespace forces this within 
the paragraph -- but it seems to fail here)

Uwe

-- 
voiceINTERconnect www.voiceinterconnect.de
... smart speech applications from germany


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

* Re: Linespacing in startstop
  2002-06-20 15:18     ` Uwe Koloska
@ 2002-06-20 17:12       ` Idris S Hamid
  2002-06-21 20:32         ` Patrick Gundlach
                           ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Idris S Hamid @ 2002-06-20 17:12 UTC (permalink / raw)


>  > \definestartstop [test] [commands={\switchtobodyfont[18pt]
>  >   \setupinterlinespace[line=36pt]}]%,after={\blank[big]}}]
>
> There is (besides the commenting out) an unmatched brace.
> \switobodyfont and \setupinterlinespace have to grouped by
> braces (to ty them to commands) and \blank[big] has to be
> surrounded by braces. The curly braces [] are from commands to
> the end of \blank[big].
>
> And have you honoured the blank line _before_ \stoptest?  This
> is important cause TeX switches linespacing at the end of a
> paragraph.  (Normally \setupinterlinespace forces this within
> the paragraph -- but it seems to fail here)

OK, here's another try:
==============================
 \definestartstop [test] [commands=%{\switchtobodyfont[18pt]}
   {\setupinterlinespace[line=36pt]}]%,after={\blank[big]}}]

\starttext

\starttest
This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test

This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test
\stoptest

\stoptext
================================

Now I get interline spacing, but _only_ in the first paragraph!  Uncommenting
, after={\blank[big]}]
makes no difference of course.

How can I get it in every paragraph (but _only_ within the environment)?

Best wishes
Idris

-- 
Dr. Idris S Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80526


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

* Re: Linespacing in startstop
  2002-06-20 17:12       ` Idris S Hamid
@ 2002-06-21 20:32         ` Patrick Gundlach
  2002-06-23 22:00           ` Hans Hagen
  2002-06-21 21:48         ` Patrick Gundlach
  2002-06-23 11:07         ` Hans Hagen
  2 siblings, 1 reply; 11+ messages in thread
From: Patrick Gundlach @ 2002-06-21 20:32 UTC (permalink / raw)


Idris S Hamid <ishamid@attbi.com> writes:

Hello again...

[...]

> This is a test This is a test This is a test This is a test
> This is a test This is a test This is a test This is a test
> \stoptest

the point is that just before the \stoptest the paragraph does not
end. The \stoptest restores the values (esp. the \baselineskip that
you have changed) to their original settings. This is definitely not
what you want. The paragraph needs to be ended before the reset
applys. TeX uses some parameters (including baselineskip) for a
paragraph when it is completed. So you can change these settings on
and on and only the last will be used. (This is the case here)

So you can do the following things:

leave a blank line between your last row and \stoptest or say
....\par\stoptest (which is the same). Or you might post this as a bug
to the bugzilla site and let Hans fix it. But this is probably a
feature and not a bug.

Patrick

-- 
I'll fade into the darkness


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

* Re: Linespacing in startstop
  2002-06-20 17:12       ` Idris S Hamid
  2002-06-21 20:32         ` Patrick Gundlach
@ 2002-06-21 21:48         ` Patrick Gundlach
  2002-06-23 11:07         ` Hans Hagen
  2 siblings, 0 replies; 11+ messages in thread
From: Patrick Gundlach @ 2002-06-21 21:48 UTC (permalink / raw)


Idris S Hamid <ishamid@attbi.com> writes:

Hi,

I have just seen that Uwe has already told you the truth about
it... Sorry for the double post...

Patrick
-- 
I'll fade into the darkness


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

* Re: Linespacing in startstop
  2002-06-20 17:12       ` Idris S Hamid
  2002-06-21 20:32         ` Patrick Gundlach
  2002-06-21 21:48         ` Patrick Gundlach
@ 2002-06-23 11:07         ` Hans Hagen
  2002-06-23 23:05           ` Idris S Hamid
  2 siblings, 1 reply; 11+ messages in thread
From: Hans Hagen @ 2002-06-23 11:07 UTC (permalink / raw)
  Cc: Uwe Koloska, ConTeXt Mailing List

At 11:12 AM 6/20/2002 -0600, Idris S Hamid wrote:

>==============================
>  \definestartstop [test] [commands=%{\switchtobodyfont[18pt]}
>    {\setupinterlinespace[line=36pt]}]%,after={\blank[big]}}]
>
>\starttext
>
>\starttest
>This is a test This is a test This is a test This is a test
>This is a test This is a test This is a test This is a test
>This is a test This is a test This is a test This is a test
>
>This is a test This is a test This is a test This is a test
>This is a test This is a test This is a test This is a test
>This is a test This is a test This is a test This is a test
>\stoptest
>
>\stoptext
>================================
>
>Now I get interline spacing, but _only_ in the first paragraph!  Uncommenting
>, after={\blank[big]}]
>makes no difference of course.
>
>How can I get it in every paragraph (but _only_ within the environment)?

\definestartstop
   [test]
   [before={\setupinterlinespace[1.5]},
    after=\endgraf]

will work ok, you need to end a par within the group, since tex uses par 
specific spacing settings that count at th eend of a paragraph (which in 
your case is ended *after* the start/stop group ends

compare:

\bgroup \baselineskip 1cm \input tufte \egroup \par

\bgroup \baselineskip 1cm \input tufte \par \egroup

[same for left/rightskip and indentation]

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------


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

* Re: Linespacing in startstop
  2002-06-21 20:32         ` Patrick Gundlach
@ 2002-06-23 22:00           ` Hans Hagen
  0 siblings, 0 replies; 11+ messages in thread
From: Hans Hagen @ 2002-06-23 22:00 UTC (permalink / raw)
  Cc: ntg-context

At 10:32 PM 6/21/2002 +0200, Patrick Gundlach wrote:
>Idris S Hamid <ishamid@attbi.com> writes:
>
>Hello again...
>
>
>[...]
>
> > This is a test This is a test This is a test This is a test
> > This is a test This is a test This is a test This is a test
> > \stoptest
>
>the point is that just before the \stoptest the paragraph does not
>end. The \stoptest restores the values (esp. the \baselineskip that
>you have changed) to their original settings. This is definitely not
>what you want. The paragraph needs to be ended before the reset
>applys. TeX uses some parameters (including baselineskip) for a
>paragraph when it is completed. So you can change these settings on
>and on and only the last will be used. (This is the case here)
>
>
>So you can do the following things:
>
>leave a blank line between your last row and \stoptest or say
>....\par\stoptest (which is the same). Or you might post this as a bug
>to the bugzilla site and let Hans fix it. But this is probably a
>feature and not a bug.

it actually is a feature since start-stop material may be inline in which 
case we don't want a par; therefore, \endgraf or \paragraph is needed

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------


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

* Re: Linespacing in startstop
  2002-06-23 11:07         ` Hans Hagen
@ 2002-06-23 23:05           ` Idris S Hamid
  2002-06-25 19:30             ` Hans Hagen
  0 siblings, 1 reply; 11+ messages in thread
From: Idris S Hamid @ 2002-06-23 23:05 UTC (permalink / raw)
  Cc: ConTeXt Mailing List

On Sunday 23 June 2002 05:07, Hans Hagen wrote:

> \definestartstop
>    [test]
>    [before={\setupinterlinespace[1.5]},
>     after=\endgraf]
>
> will work ok, you need to end a par within the group, since tex uses par
> specific spacing settings that count at th eend of a paragraph (which in
> your case is ended *after* the start/stop group ends

Now we have another problem, the paragraph after \stoptest does not revert 
back to the old interlinespace:

\definestartstop
   [test]
   [before={\setupinterlinespace[2]},
    after=\endgraf]

\starttext

\starttest
This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test

This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test
\stoptest

This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test
This is a test This is a test This is a test This is a test

\stoptext

> compare:
>
> \bgroup \baselineskip 1cm \input tufte \egroup \par
>
> \bgroup \baselineskip 1cm \input tufte \par \egroup
>
> [same for left/rightskip and indentation]

I tried

\bgroup \baselineskip 1cm \input tufte \egroup \par

\input tufte

\bgroup \baselineskip 1cm \input tufte \par \egroup

\input tufte

The  line
\bgroup \baselineskip 1cm \input tufte \par \egroup
does not have the same problem as the start/stoptest environment.

Best
Idris

-- 
Dr. Idris S Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80526


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

* Re: Linespacing in startstop
  2002-06-23 23:05           ` Idris S Hamid
@ 2002-06-25 19:30             ` Hans Hagen
  0 siblings, 0 replies; 11+ messages in thread
From: Hans Hagen @ 2002-06-25 19:30 UTC (permalink / raw)
  Cc: ConTeXt Mailing List

At 05:05 PM 6/23/2002 -0600, Idris S Hamid wrote:
>On Sunday 23 June 2002 05:07, Hans Hagen wrote:
>
> > \definestartstop
> >    [test]
> >    [before={\setupinterlinespace[1.5]},
> >     after=\endgraf]
> >
> > will work ok, you need to end a par within the group, since tex uses par
> > specific spacing settings that count at th eend of a paragraph (which in
> > your case is ended *after* the start/stop group ends

ah, you got me by surprise !

>Now we have another problem, the paragraph after \stoptest does not revert
>back to the old interlinespace:
>
>\definestartstop
>    [test]
>    [before={\setupinterlinespace[2]},
>     after=\endgraf]

before={\start\setupinterlinespace[2]},
after={\endgraf\stop},

since before and after are expanded outside the embeded group (this is 
because otherwise font switches spoil spacing around sucn constructs

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------


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

end of thread, other threads:[~2002-06-25 19:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-19 15:48 Linespacing in startstop Idris S Hamid
2002-06-20  7:56 ` Uwe Koloska
2002-06-20 12:35   ` Idris S Hamid
2002-06-20 15:18     ` Uwe Koloska
2002-06-20 17:12       ` Idris S Hamid
2002-06-21 20:32         ` Patrick Gundlach
2002-06-23 22:00           ` Hans Hagen
2002-06-21 21:48         ` Patrick Gundlach
2002-06-23 11:07         ` Hans Hagen
2002-06-23 23:05           ` Idris S Hamid
2002-06-25 19:30             ` Hans Hagen

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