ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* vertical spacing and makeups
@ 2015-04-18 16:43 Pablo Rodriguez
  2015-04-18 17:15 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Pablo Rodriguez @ 2015-04-18 16:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list,

I have the following sample:

    \showgrid
    \setupinteraction[option=max]
    \setuppapersize[S6]
    \setuppagenumbering[location=]
    \setupbodyfont[100pt]
    \setupwhitespace[big]
    \startsetups[setups:slides]
        \setupwhitespace[big]
    \stopsetups
    \setupmakeup[pagestate=start]
    \definemakeup[slides][setups=setups:slides]
    \definemakeup[slide]
    \starttext
    \startmakeup[slides]\ConTeXt\stopmakeup
    \startmakeup[slide]\ConTeXt\stopmakeup
    \page\ConTeXt
    \startmakeup[slides]program\stopmakeup
    \startmakeup[slides]descender\stopmakeup
    \startmakeup[slide]program\stopmakeup
    \startmakeup[slide]descender\stopmakeup
    \page program
    \page descender
    \stoptext

The first page shows that \setupwhitespace[big] affects to a single line
in a makeup. Shouldn’t white space be added only between paragraphs? The
second page is right vertically centered. And the third page shows that
the white space isn’t added before the first paragraph in a normal page
(no makeup).

This is the first issue, isn’t it a bug? Or what am I missing?

The second issue is about the line height. If I didn’t get it wrong from
Hans some days ago, line height is the x-height, plus ascender and
descender heights.

In vertical centering for makeups, why does ascender or descender height
affect to basline position? Sorry, but this is a problem for
readability. And it think it is better to center the line instead than a
group of glyphs.

Or am I missing something in this second issue too?

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: vertical spacing and makeups
  2015-04-18 16:43 vertical spacing and makeups Pablo Rodriguez
@ 2015-04-18 17:15 ` Wolfgang Schuster
  2015-04-18 18:29   ` Pablo Rodriguez
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2015-04-18 17:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 18.04.2015 um 18:43 schrieb Pablo Rodriguez <oinos@gmx.es>:
> 
> Dear list,
> 
> I have the following sample:
> 
>    \showgrid
>    \setupinteraction[option=max]
>    \setuppapersize[S6]
>    \setuppagenumbering[location=]
>    \setupbodyfont[100pt]
>    \setupwhitespace[big]
>    \startsetups[setups:slides]
>        \setupwhitespace[big]
>    \stopsetups
>    \setupmakeup[pagestate=start]
>    \definemakeup[slides][setups=setups:slides]
>    \definemakeup[slide]
>    \starttext
>    \startmakeup[slides]\ConTeXt\stopmakeup
>    \startmakeup[slide]\ConTeXt\stopmakeup
>    \page\ConTeXt
>    \startmakeup[slides]program\stopmakeup
>    \startmakeup[slides]descender\stopmakeup
>    \startmakeup[slide]program\stopmakeup
>    \startmakeup[slide]descender\stopmakeup
>    \page program
>    \page descender
>    \stoptext
> 
> The first page shows that \setupwhitespace[big] affects to a single line
> in a makeup. Shouldn’t white space be added only between paragraphs? The
> second page is right vertically centered. And the third page shows that
> the white space isn’t added before the first paragraph in a normal page
> (no makeup).
> 
> This is the first issue, isn’t it a bug? Or what am I missing?

TeX inserts the \parskip value which is set by \setupwhitespace
before your text in the makeup environment. Note that this happens
only when you have skip before the text (e.g. with the default top=\vss
setting) at the begin of the environment.

The following low level example demonstrates this:

\setuppapersize[A6]

\starttext

\dontleavehmode
\ruledvbox to 3cm{\hsize=4cm text}
\ruledvbox to 3cm{\hsize=4cm\parskip=2ex\relax text}

\dontleavehmode
\ruledvbox to 3cm{\hsize=4cm\vss text\vss}
\ruledvbox to 3cm{\hsize=4cm\parskip=2ex\relax\vss text\vss}

\stoptext

> The second issue is about the line height. If I didn’t get it wrong from
> Hans some days ago, line height is the x-height, plus ascender and
> descender heights.

TeX has only a concept for the distance between the baseline of two lines,
to get a certain line height and depth at the begin and end of your text
you have to the \strut or \begstrut and \endstrut commands.

> In vertical centering for makeups, why does ascender or descender height
> affect to basline position? Sorry, but this is a problem for
> readability. And it think it is better to center the line instead than a
> group of glyphs.

\def\startSlide
  {\grabbufferdata[SlideContent][startSlide][stopSlide]}

\def\stopSlide
  {\startmakeup[standard][align=middle]
   \begstrut\getbufferdata[SlideContent]\endstrut
   \stopmakeup}

\setuppapersize[S8]
\setupbodyfont[100pt]

\showgrid

\starttext

\startSlide
program
\stopSlide

\startSlide
descender
\stopSlide

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: vertical spacing and makeups
  2015-04-18 17:15 ` Wolfgang Schuster
@ 2015-04-18 18:29   ` Pablo Rodriguez
  2015-04-19 18:50     ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Pablo Rodriguez @ 2015-04-18 18:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 04/18/2015 07:15 PM, Wolfgang Schuster wrote:
>> Am 18.04.2015 um 18:43 schrieb Pablo Rodriguez:
>> [...]
>> The first page shows that \setupwhitespace[big] affects to a single line
>> in a makeup. Shouldn’t white space be added only between paragraphs? The
>> second page is right vertically centered. And the third page shows that
>> the white space isn’t added before the first paragraph in a normal page
>> (no makeup).
>>
>> This is the first issue, isn’t it a bug? Or what am I missing?
> 
> TeX inserts the \parskip value which is set by \setupwhitespace
> before your text in the makeup environment. Note that this happens
> only when you have skip before the text (e.g. with the default top=\vss
> setting) at the begin of the environment.
> 
> The following low level example demonstrates this:
> 
> \setuppapersize[A6]
> 
> \starttext
> 
> \dontleavehmode
> \ruledvbox to 3cm{\hsize=4cm text}
> \ruledvbox to 3cm{\hsize=4cm\parskip=2ex\relax text}
> 
> \dontleavehmode
> \ruledvbox to 3cm{\hsize=4cm\vss text\vss}
> \ruledvbox to 3cm{\hsize=4cm\parskip=2ex\relax\vss text\vss}
> 
> \stoptext

Many thanks for your reply, Wolfgang.

So the a workaround would be to use \blank instead of \par or a blank
line, wouldn’t it be?

>> The second issue is about the line height. If I didn’t get it wrong from
>> Hans some days ago, line height is the x-height, plus ascender and
>> descender heights.
> 
> TeX has only a concept for the distance between the baseline of two lines,
> to get a certain line height and depth at the begin and end of your text
> you have to the \strut or \begstrut and \endstrut commands.
> 
> \def\startSlide
>   {\grabbufferdata[SlideContent][startSlide][stopSlide]}
> 
> \def\stopSlide
>   {\startmakeup[standard][align=middle]
>    \begstrut\getbufferdata[SlideContent]\endstrut
>    \stopmakeup}

I tried to use struts with the first issue and I thought they didn’t
work sith makeups.

Many thanks for your code excerpted above. I would have never thought of
this in a decade.

Many thanks for your highly instructive explanation also,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: vertical spacing and makeups
  2015-04-18 18:29   ` Pablo Rodriguez
@ 2015-04-19 18:50     ` Wolfgang Schuster
  2015-04-19 21:01       ` Pablo Rodriguez
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2015-04-19 18:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 18.04.2015 um 20:29 schrieb Pablo Rodriguez <oinos@gmx.es>:
> 
> On 04/18/2015 07:15 PM, Wolfgang Schuster wrote:
>>> Am 18.04.2015 um 18:43 schrieb Pablo Rodriguez:
>>> [...]
>>> The first page shows that \setupwhitespace[big] affects to a single line
>>> in a makeup. Shouldn’t white space be added only between paragraphs? The
>>> second page is right vertically centered. And the third page shows that
>>> the white space isn’t added before the first paragraph in a normal page
>>> (no makeup).
>>> 
>>> This is the first issue, isn’t it a bug? Or what am I missing?
>> 
>> TeX inserts the \parskip value which is set by \setupwhitespace
>> before your text in the makeup environment. Note that this happens
>> only when you have skip before the text (e.g. with the default top=\vss
>> setting) at the begin of the environment.
>> 
>> The following low level example demonstrates this:
>> 
>> \setuppapersize[A6]
>> 
>> \starttext
>> 
>> \dontleavehmode
>> \ruledvbox to 3cm{\hsize=4cm text}
>> \ruledvbox to 3cm{\hsize=4cm\parskip=2ex\relax text}
>> 
>> \dontleavehmode
>> \ruledvbox to 3cm{\hsize=4cm\vss text\vss}
>> \ruledvbox to 3cm{\hsize=4cm\parskip=2ex\relax\vss text\vss}
>> 
>> \stoptext
> 
> Many thanks for your reply, Wolfgang.
> 
> So the a workaround would be to use \blank instead of \par or a blank
> line, wouldn’t it be?

You can flush the content of the buffer in a \vbox where you set the
whitespace at the begin of the box.

\def\startSlide
  {\grabbufferdata[SlideContent][startSlide][stopSlide]}

\def\stopSlide
  {\startmakeup[standard][align=middle]
   \vbox\bgroup
     \setupwhitespace[big]
     \begstrut\getbufferdata[SlideContent]\endstrut
   \egroup
   \stopmakeup}

\setuppapersize[S8]
%\setupbodyfont[100pt]

\showgrid

\starttext

\startSlide
program

content
\stopSlide

\startSlide
descender
\stopSlide

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: vertical spacing and makeups
  2015-04-19 18:50     ` Wolfgang Schuster
@ 2015-04-19 21:01       ` Pablo Rodriguez
  0 siblings, 0 replies; 5+ messages in thread
From: Pablo Rodriguez @ 2015-04-19 21:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 04/19/2015 08:50 PM, Wolfgang Schuster wrote:
>> Am 18.04.2015 um 20:29 schrieb Pablo Rodriguez:
>> [...]
>> So the a workaround would be to use \blank instead of \par or a blank
>> line, wouldn’t it be?
> 
> You can flush the content of the buffer in a \vbox where you set the
> whitespace at the begin of the box.
> 
> \def\startSlide
>   {\grabbufferdata[SlideContent][startSlide][stopSlide]}
> 
> \def\stopSlide
>   {\startmakeup[standard][align=middle]
>    \vbox\bgroup
>      \setupwhitespace[big]
>      \begstrut\getbufferdata[SlideContent]\endstrut
>    \egroup
>    \stopmakeup}

Many thanks for your reply, Wolfgang.

This is exactly what I needed.


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2015-04-19 21:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-18 16:43 vertical spacing and makeups Pablo Rodriguez
2015-04-18 17:15 ` Wolfgang Schuster
2015-04-18 18:29   ` Pablo Rodriguez
2015-04-19 18:50     ` Wolfgang Schuster
2015-04-19 21:01       ` Pablo Rodriguez

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