ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \blank space at the top of a page
@ 2020-06-18 15:35 James Withers
  2020-06-18 15:44 ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: James Withers @ 2020-06-18 15:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello list

I have been trying to find a solution to how to insert blank lines
before a chapter heading at the start of a page. In the following
example the \blank[4*big] is ignored. The solution I've found is to
add an empty box using \mbox{} before the \blank command.

Is this the right way to do it or is there a more elegant way that I
am missing?

Many thanks

James


\setuphead[chapter][before={\blank[4*big]}]

\starttext

\startchapter[title={No space above this chapter}]

chapter text etc

\stopchapter

\setuphead[chapter][before={\mbox{}\blank[4*big]}]

\startchapter[title={Chapter with the right spacing}]

chapter text etc

\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
___________________________________________________________________________________

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

* Re: \blank space at the top of a page
  2020-06-18 15:35 \blank space at the top of a page James Withers
@ 2020-06-18 15:44 ` Wolfgang Schuster
  2020-06-18 18:11   ` James Withers
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2020-06-18 15:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users, James Withers

James Withers schrieb am 18.06.2020 um 17:35:
> Hello list
>
> I have been trying to find a solution to how to insert blank lines
> before a chapter heading at the start of a page. In the following
> example the \blank[4*big] is ignored. The solution I've found is to
> add an empty box using \mbox{} before the \blank command.

I'm curious where the use of \mbox is documented.

> Is this the right way to do it or is there a more elegant way that I
> am missing?
>
> Many thanks
>
> James
>
>
> \setuphead[chapter][before={\blank[4*big]}]

You have to add the "force" keyword to \blank because TeX ignores by 
default vertical space at the begin of a page.

\setuphead[chapter][before={\blank[force,4*big]}]

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
___________________________________________________________________________________

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

* Re: \blank space at the top of a page
  2020-06-18 15:44 ` Wolfgang Schuster
@ 2020-06-18 18:11   ` James Withers
  0 siblings, 0 replies; 3+ messages in thread
From: James Withers @ 2020-06-18 18:11 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

Many thanks Wolfgang

I tried using force but that caused a problem with aligning to the
grid, not included in my original example, but included below.

I think I have seen \mbox used in this way in Latex, so was trying to
find a quick solution.

James


\setuplayout[grid=yes]
\showgrid

\setuphead[chapter][before={\blank[4*big]}]

\starttext

\startchapter[title={No space above this chapter}]

chapter text etc

\stopchapter

\setuphead[chapter][before={\blank[4*big,force]}]

\startchapter[title={Chapter with spacing but out of line with grid}]

chapter text etc

\stopchapter

\setuphead[chapter][before={\blank[4*line,force]}]

\startchapter[title={Chapter with spacing but out of line with grid}]

chapter text etc

\stopchapter

\stoptext

On Thu, 18 Jun 2020 at 16:44, Wolfgang Schuster
<wolfgang.schuster.lists@gmail.com> wrote:
>
> James Withers schrieb am 18.06.2020 um 17:35:
> > Hello list
> >
> > I have been trying to find a solution to how to insert blank lines
> > before a chapter heading at the start of a page. In the following
> > example the \blank[4*big] is ignored. The solution I've found is to
> > add an empty box using \mbox{} before the \blank command.
>
> I'm curious where the use of \mbox is documented.
>
> > Is this the right way to do it or is there a more elegant way that I
> > am missing?
> >
> > Many thanks
> >
> > James
> >
> >
> > \setuphead[chapter][before={\blank[4*big]}]
>
> You have to add the "force" keyword to \blank because TeX ignores by
> default vertical space at the begin of a page.
>
> \setuphead[chapter][before={\blank[force,4*big]}]
>
> 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
___________________________________________________________________________________

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

end of thread, other threads:[~2020-06-18 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-18 15:35 \blank space at the top of a page James Withers
2020-06-18 15:44 ` Wolfgang Schuster
2020-06-18 18:11   ` James Withers

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