ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Vyatcheslav Yatskovsky <yatskovsky@gmail.com>
To: Wolfgang Schuster <schuster.wolfgang@googlemail.com>, ntg-context@ntg.nl
Subject: Re: \hspace variations
Date: Tue, 16 Dec 2008 01:19:56 +0200	[thread overview]
Message-ID: <4946E61C.6010609@gmail.com> (raw)
In-Reply-To: <F1282B7D-056E-4CB5-8CCF-C665D2AF23DA@gmail.com>

Thank you, Wolfgang, for your solution. Seems like \hspace cannot take 
numeric values at the moment, only predefined constants like "big". 
Maybe it is reasonable to include your code below into context core files?

Meanwhile, I used "\hskip 2cm", it worked fine.
>>
>> I have some problems with \hspace. I try to insert it between two 
>> images, and this is what I get
>> 1) \hspace{1cm} or \hspace<1cm> gives space  but writes "1cm" betwen 
>> images;
>> 2) \hspace[1cm] does not work at all
>> 3) \hspace[big] works fine, but \hspace[2*big] does not
>>
>> I want to get space twice as big, but how?
> Hello,
>
> \unprotect
>
> \def\dodohspace[#1][#2]%
>   {\def\dododohspace##1{\dodododohspace{#1}{##1}}%
>    \ifhmode
>      \removeunwantedspaces
>      \dorepeatwithcommand[#2]\dododohspace
>      \expandafter\ignorespaces
>     \fi}
>
> \def\dodododohspace#1#2%
>   {\hskip\hspaceamount{#1}{#2}}
>
> \def\hspaceamount#1#2%
>   {\executeifdefined{\??hs#1:#2}{\executeifdefined{\??hs:#2}{#2\relax}}}
>
> \protect
>
> \starttext
>
> text \hspace[big] text
>
> text \hspace[2*big] text
>
> text \hspace[3*big] text
>
> text \hspace[1cm] text
>
> text \hspace[2cm] text
>
> text \hspace[3cm] text
>
> \stoptext
>
Best,
Vyatcheslav

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


      parent reply	other threads:[~2008-12-15 23:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1.1229166006.27182.ntg-context@ntg.nl>
2008-12-14  1:55 ` Vyatcheslav Yatskovsky
2008-12-14 14:24   ` Peter Rolf
     [not found]   ` <F1282B7D-056E-4CB5-8CCF-C665D2AF23DA@gmail.com>
2008-12-15 23:19     ` Vyatcheslav Yatskovsky [this message]

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=4946E61C.6010609@gmail.com \
    --to=yatskovsky@gmail.com \
    --cc=ntg-context@ntg.nl \
    --cc=schuster.wolfgang@googlemail.com \
    /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).