ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* delimitedtext, spacebefore and grid
@ 2011-01-20 16:04 Oliver Heins
  2011-01-20 17:20 ` Wolfgang Schuster
  0 siblings, 1 reply; 11+ messages in thread
From: Oliver Heins @ 2011-01-20 16:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello,

I want to have both a halfline space before and after blockquotations.
Normally, this works fine; after the quotation the main text snaps
back to the grid (see page 3 of the example file).

\setupdelimitedtext
  [blockquote]
  [spacebefore=halfline]

However, this fails when the blockquote is the first element on the
page, either because a new blockquote starts on the top of the page
(cf. p. 1) or because a blockquote continues from the last page
(cf. p. 2).  Is it possible to tell ConTeXt to insert a halfline of
space on the top of the page in these cases?

TIA,
 olli


\setuppapersize[a5][A4]
\setuplayout[location=middle,marking=on,grid=yes]
\setupbodyfont[14pt]

\setupdelimitedtext
  [blockquote]
  [spacebefore=halfline]

\showgrid

\starttext

\startblockquote
  \input tufte
\stopblockquote

\dorecurse{2}{\input tufte}

\startblockquote
  \input tufte
\stopblockquote

\dorecurse{3}{\input tufte}

\startblockquote
  \input tufte
\stopblockquote

\input tufte

\stoptext


-- 
Oliver Heins heins@sopos.org  http://www.sopos.org/olli
GPG: F27A BA8C 1CFB B905 65A8  2544 0F07 B675 9A00 D827
1024D/9A00D827 2004-09-24 -- gpg --recv-keys 0x9A00D827
Please avoid sending me Word or PowerPoint attachments:
http://www.gnu.org/philosophy/no-word-attachments.html
___________________________________________________________________________________
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] 11+ messages in thread

* Re: delimitedtext, spacebefore and grid
  2011-01-20 16:04 delimitedtext, spacebefore and grid Oliver Heins
@ 2011-01-20 17:20 ` Wolfgang Schuster
  2011-01-20 20:05   ` Oliver Heins
  0 siblings, 1 reply; 11+ messages in thread
From: Wolfgang Schuster @ 2011-01-20 17:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 20.01.2011 um 17:04 schrieb Oliver Heins:

> Hello,
> 
> I want to have both a halfline space before and after blockquotations.
> Normally, this works fine; after the quotation the main text snaps
> back to the grid (see page 3 of the example file).
> 
> \setupdelimitedtext
>  [blockquote]
>  [spacebefore=halfline]

spacebefore={force,halfline}

> […]
> 
> \setuppapersize[a5][A4]

\setuppapersize[A5][A4]

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] 11+ messages in thread

* Re: delimitedtext, spacebefore and grid
  2011-01-20 17:20 ` Wolfgang Schuster
@ 2011-01-20 20:05   ` Oliver Heins
  2011-01-23 18:18     ` Oliver Buerschaper
  0 siblings, 1 reply; 11+ messages in thread
From: Oliver Heins @ 2011-01-20 20:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Wolfgang Schuster <schuster.wolfgang@googlemail.com> writes:

> Am 20.01.2011 um 17:04 schrieb Oliver Heins:
>
>> Hello,
>> 
>> I want to have both a halfline space before and after blockquotations.
>> Normally, this works fine; after the quotation the main text snaps
>> back to the grid (see page 3 of the example file).
>> 
>> \setupdelimitedtext
>>  [blockquote]
>>  [spacebefore=halfline]
>
> spacebefore={force,halfline}

Hello Wolfgang, thank you for your answer.  Sadly, your solution only
works for blockquotes starting at the top of the page.  When blockquotes
are broken up between two pages the main text doesn't find its way back
to the grid (see page 2 of my minimal example).

Another point is: The space inserted at the top of the page is not a
half line big but of one and a half line.

>> […]
>> 
>> \setuppapersize[a5][A4]
>
> \setuppapersize[A5][A4]

Thanks, it was a typo.  I already wondered about how huge an A5-sized
page in ConTeXt is :) However, the setup of my minimal example
illustrates the problems best on A4, so *here* it should read either
\setuppapersize[A4] or nothing (since A4 seems to be the default
anyway).

Best regards,
 olli

-- 
Oliver Heins heins@sopos.org  http://www.sopos.org/olli
GPG: F27A BA8C 1CFB B905 65A8  2544 0F07 B675 9A00 D827
1024D/9A00D827 2004-09-24 -- gpg --recv-keys 0x9A00D827
Please avoid sending me Word or PowerPoint attachments:
http://www.gnu.org/philosophy/no-word-attachments.html
___________________________________________________________________________________
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] 11+ messages in thread

* Re: delimitedtext, spacebefore and grid
  2011-01-20 20:05   ` Oliver Heins
@ 2011-01-23 18:18     ` Oliver Buerschaper
  2011-02-12  7:47       ` Oliver Buerschaper
  0 siblings, 1 reply; 11+ messages in thread
From: Oliver Buerschaper @ 2011-01-23 18:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

>>> I want to have both a halfline space before and after blockquotations.
>>> Normally, this works fine; after the quotation the main text snaps
>>> back to the grid (see page 3 of the example file).
>>> 
>>> \setupdelimitedtext
>>> [blockquote]
>>> [spacebefore=halfline]
>> 
>> spacebefore={force,halfline}
> 
> Hello Wolfgang, thank you for your answer.  Sadly, your solution only
> works for blockquotes starting at the top of the page.  When blockquotes
> are broken up between two pages the main text doesn't find its way back
> to the grid (see page 2 of my minimal example).

I think I've discovered another little problem of the same sort if directly after the quotation a blank line is requested:

---
\setuplayout
    [grid=yes]

\setupdelimitedtext
    [quotation]
    [spacebefore=halfline]

\showgrid

\starttext

\input tufte

\startquotation
    \input tufte
\stopquotation

\blank
\input tufte

\stoptext
---

Unfortunately the trailing main text doesn't align with the grid either. Any solution to both problems?

Best wishes,
Oliver
___________________________________________________________________________________
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] 11+ messages in thread

* Re: delimitedtext, spacebefore and grid
  2011-01-23 18:18     ` Oliver Buerschaper
@ 2011-02-12  7:47       ` Oliver Buerschaper
  2011-02-12 17:28         ` Wolfgang Schuster
  0 siblings, 1 reply; 11+ messages in thread
From: Oliver Buerschaper @ 2011-02-12  7:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

>>>> I want to have both a halfline space before and after blockquotations.
>>>> Normally, this works fine; after the quotation the main text snaps
>>>> back to the grid (see page 3 of the example file).
>>>> 
>>>> \setupdelimitedtext
>>>> [blockquote]
>>>> [spacebefore=halfline]
>>> 
>>> spacebefore={force,halfline}
>> 
>> Hello Wolfgang, thank you for your answer.  Sadly, your solution only
>> works for blockquotes starting at the top of the page.  When blockquotes
>> are broken up between two pages the main text doesn't find its way back
>> to the grid (see page 2 of my minimal example).
> 
> I think I've discovered another little problem of the same sort if directly after the quotation a blank line is requested:
> 
> ---
> \setuplayout
>    [grid=yes]
> 
> \setupdelimitedtext
>    [quotation]
>    [spacebefore=halfline]
> 
> \showgrid
> 
> \starttext
> 
> \input tufte
> 
> \startquotation
>    \input tufte
> \stopquotation
> 
> \blank
> \input tufte
> 
> \stoptext
> ---
> 
> Unfortunately the trailing main text doesn't align with the grid either. Any solution to both problems?

Just wanted to ask whether anyone has looked into these issues… a solution would be much appreciated (and put to immediate use in a current project ;-)

Oliver
___________________________________________________________________________________
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] 11+ messages in thread

* Re: delimitedtext, spacebefore and grid
  2011-02-12  7:47       ` Oliver Buerschaper
@ 2011-02-12 17:28         ` Wolfgang Schuster
  2011-02-14 11:20           ` Oliver Buerschaper
  0 siblings, 1 reply; 11+ messages in thread
From: Wolfgang Schuster @ 2011-02-12 17:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 12.02.2011 um 08:47 schrieb Oliver Buerschaper:

> Just wanted to ask whether anyone has looked into these issues… a solution would be much appreciated (and put to immediate use in a current project ;-)


Not sure if there are side effects but this works (requires mkiv and a recent installation):

\setuplayout[grid=yes]\showgrid
\setupbodyfont[14pt]

\usemodule[annotation]

\define[2]\ZitatCommand
  {\topskip\dimexpr\topskip+\lineheight/2\relax
   \startnarrower
   “#2”%
   \stopnarrower}

\defineannotation
  [zitat]
  [alternative=command,
       command=\ZitatCommand,
   spacebefore=halfline,
    spaceafter=halfline]

\starttext

\startzitat
\input tufte
\stopzitat

\dorecurse{2}{\input tufte\par}

\startzitat
\input tufte
\stopzitat

\dorecurse{3}{\input tufte\par}

\startzitat
\input tufte
\stopzitat

\input tufte

\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] 11+ messages in thread

* Re: delimitedtext, spacebefore and grid
  2011-02-12 17:28         ` Wolfgang Schuster
@ 2011-02-14 11:20           ` Oliver Buerschaper
  2011-02-14 13:51             ` Wolfgang Schuster
  0 siblings, 1 reply; 11+ messages in thread
From: Oliver Buerschaper @ 2011-02-14 11:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> Not sure if there are side effects but this works (requires mkiv and a recent installation):
> 
> \setuplayout[grid=yes]\showgrid
> \setupbodyfont[14pt]
> 
> \usemodule[annotation]
> 
> \define[2]\ZitatCommand
>  {\topskip\dimexpr\topskip+\lineheight/2\relax
>   \startnarrower
>   “#2”%
>   \stopnarrower}
> 
> \defineannotation
>  [zitat]
>  [alternative=command,
>       command=\ZitatCommand,
>   spacebefore=halfline,
>    spaceafter=halfline]
> 
> \starttext
> 
> \startzitat
> \input tufte
> \stopzitat
> 
> \dorecurse{2}{\input tufte\par}
> 
> \startzitat
> \input tufte
> \stopzitat
> 
> \dorecurse{3}{\input tufte\par}
> 
> \startzitat
> \input tufte
> \stopzitat
> 
> \input tufte
> 
> \stoptext

Indeed, this solves the grid issue for block quotations broken across pages. Many thanks!

Unfortunately introducing a "\blank" just before the last "\input tufte" in the above example breaks grid alignment.

Oliver
___________________________________________________________________________________
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] 11+ messages in thread

* Re: delimitedtext, spacebefore and grid
  2011-02-14 11:20           ` Oliver Buerschaper
@ 2011-02-14 13:51             ` Wolfgang Schuster
  2011-02-14 15:58               ` Oliver Buerschaper
  0 siblings, 1 reply; 11+ messages in thread
From: Wolfgang Schuster @ 2011-02-14 13:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 14.02.2011 um 12:20 schrieb Oliver Buerschaper:

> Unfortunately introducing a "\blank" just before the last "\input tufte" in the above example breaks grid alignment.

The afterspace-value from \stopzitat is ignored with your \blank and you get only one empty line while you need one and a half (one from the \blank command and a half from \stopzitat).

Nevertheless you can force the correct value with \blank[halfline,line]

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] 11+ messages in thread

* Re: delimitedtext, spacebefore and grid
  2011-02-14 13:51             ` Wolfgang Schuster
@ 2011-02-14 15:58               ` Oliver Buerschaper
  2011-02-14 17:18                 ` Oliver Buerschaper
  0 siblings, 1 reply; 11+ messages in thread
From: Oliver Buerschaper @ 2011-02-14 15:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

>> Unfortunately introducing a "\blank" just before the last "\input tufte" in the above example breaks grid alignment.
> 
> The afterspace-value from \stopzitat is ignored with your \blank and you get only one empty line while you need one and a half (one from the \blank command and a half from \stopzitat).
> 
> Nevertheless you can force the correct value with \blank[halfline,line]

Sure, that's a good workaround.

In the long run would it be possible in grid mode to have \blank insert 1+x lines of vertical space where x is adjusted such that the following material is aligned on the grid?

Oliver
___________________________________________________________________________________
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] 11+ messages in thread

* Re: delimitedtext, spacebefore and grid
  2011-02-14 15:58               ` Oliver Buerschaper
@ 2011-02-14 17:18                 ` Oliver Buerschaper
  2011-02-14 18:03                   ` Wolfgang Schuster
  0 siblings, 1 reply; 11+ messages in thread
From: Oliver Buerschaper @ 2011-02-14 17:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> In the long run would it be possible in grid mode to have \blank insert 1+x lines of vertical space where x is adjusted such that the following material is aligned on the grid?

… or simply make it not swallow the previous halfline correction from the quotation?

Oliver
___________________________________________________________________________________
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] 11+ messages in thread

* Re: delimitedtext, spacebefore and grid
  2011-02-14 17:18                 ` Oliver Buerschaper
@ 2011-02-14 18:03                   ` Wolfgang Schuster
  0 siblings, 0 replies; 11+ messages in thread
From: Wolfgang Schuster @ 2011-02-14 18:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 14.02.2011 um 18:18 schrieb Oliver Buerschaper:

>> In the long run would it be possible in grid mode to have \blank insert 1+x lines of vertical space where x is adjusted such that the following material is aligned on the grid?
> 
> … or simply make it not swallow the previous halfline correction from the quotation?


Took me a while but this does what you want:

\blank[line,category:4]

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] 11+ messages in thread

end of thread, other threads:[~2011-02-14 18:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-20 16:04 delimitedtext, spacebefore and grid Oliver Heins
2011-01-20 17:20 ` Wolfgang Schuster
2011-01-20 20:05   ` Oliver Heins
2011-01-23 18:18     ` Oliver Buerschaper
2011-02-12  7:47       ` Oliver Buerschaper
2011-02-12 17:28         ` Wolfgang Schuster
2011-02-14 11:20           ` Oliver Buerschaper
2011-02-14 13:51             ` Wolfgang Schuster
2011-02-14 15:58               ` Oliver Buerschaper
2011-02-14 17:18                 ` Oliver Buerschaper
2011-02-14 18:03                   ` Wolfgang Schuster

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