ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: \vspace
Date: Mon, 23 Nov 2009 11:21:47 +0100	[thread overview]
Message-ID: <4B0A623B.9020607@wxs.nl> (raw)
In-Reply-To: <01760E86-9173-44D7-B117-49DB4ECA2725@googlemail.com>

Wolfgang Schuster wrote:
> Hi Hans,
> 
> can you add a \vspace command which behaves like \hspace but for vertical mode,
> there are some cases where \blank is not so well suited (i know the \??vs namespace
> is already used by \blank)
> 
> \def\definevspace
>   {\dotripleempty\dodefinevspace}
> 
> \def\dodefinevspace[#1][#2][#3]%
>   {\ifthirdargument
>      \setvalue{\??vs#1:#2}{#3}%
>    \else
>      \setvalue{\??vs:#1}{#2}%
>    \fi}
> 
> \unexpanded\def\vspace
>   {\dodoubleempty\dohspace}

hm, untested ...   ^^^^^^^^^

> \def\dovspace[#1][#2]%
>   {\ifsecondargument
>      \dodovspace[#1][#2]%
>    \else\iffirstargument
>      \vspace[][#1]%
>    \else
>      \vspace[][\s!default]%
>    \fi\fi}
> 
> \def\dodovspace[#1][#2]%
>   {\vskip\vspaceamount{#1}{#2}}
> 
> \def\vspaceamount#1#2%
>   {\executeifdefined{\??vs#1:#2}{\executeifdefined{\??vs:#2}\zeropoint}}

i'm always a bit relucate to let users mess with vertical spacing ... 
anyhow, in \hspace we clean up preceding space so vspace should behave 
the same i.e. there should be a \removelastskip before the vskip

\def\dodovspace[#1][#2]%
   {\par
    \ifvmode
      \removelastskip
      \vskip\vspaceamount{#1}{#2}\relax
    \fi}

i'll add it but we should not encourage too much in using it, that is, 
i'm *not* going to look into spacing related bug reports that use this 
command

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.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


  reply	other threads:[~2009-11-23 10:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-22 22:52 \vspace Wolfgang Schuster
2009-11-23 10:21 ` Hans Hagen [this message]
2009-11-23 10:31   ` \vspace Wolfgang Schuster
2009-11-23 10:52     ` \vspace Hans Hagen
2009-11-23 12:18       ` \vspace Alan BRASLAU
2009-11-26 18:08         ` \vspace Henning Hraban Ramm
2009-11-26 18:42           ` \vspace Hans Hagen
2009-11-26 20:31             ` typescript question Bernhard Rosensteiner
2009-11-26 21:19               ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B0A623B.9020607@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).