ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* anaemic spacing around in-line typed text
       [not found] <mailman.3821.1174921721.17432.ntg-context@ntg.nl>
@ 2007-03-26 21:38 ` Vyatcheslav Yatskovsky
  2007-03-27  9:49   ` Taco Hoekwater
  0 siblings, 1 reply; 6+ messages in thread
From: Vyatcheslav Yatskovsky @ 2007-03-26 21:38 UTC (permalink / raw)
  To: ntg-context-request@ntg.nl


[-- Attachment #1.1: Type: text/plain, Size: 202 bytes --]

The following look ugly because of anaemic spacing before and after typed text.

\starttext
The {\tt rand} function generates pseudo-random numbers.
\stoptext

How to fix it?

Best,
Vyatcheslav

[-- Attachment #1.2: Type: text/html, Size: 2012 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: anaemic spacing around in-line typed text
  2007-03-26 21:38 ` anaemic spacing around in-line typed text Vyatcheslav Yatskovsky
@ 2007-03-27  9:49   ` Taco Hoekwater
  2007-04-01 12:40     ` Vyatcheslav Yatskovsky
  0 siblings, 1 reply; 6+ messages in thread
From: Taco Hoekwater @ 2007-03-27  9:49 UTC (permalink / raw)
  To: Yatskovsky, mailing list for ConTeXt users



Vyatcheslav Yatskovsky wrote:
> The following look ugly because of anaemic spacing before and after typed text.
> 
> \starttext
> The {\tt rand} function generates pseudo-random numbers.
> \stoptext
> 
> How to fix it?

If you want the spaces larger than normal interword spaces,
you could consider tagging your calls using a special macro
to do the typesetting.  Perhaps like this:

\def\function#1{ #1 }
\starttext
The \function{rand} function generates pseudo-random numbers.
\stoptext

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

* Re: anaemic spacing around in-line typed text
  2007-03-27  9:49   ` Taco Hoekwater
@ 2007-04-01 12:40     ` Vyatcheslav Yatskovsky
  2007-04-01 13:22       ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Vyatcheslav Yatskovsky @ 2007-04-01 12:40 UTC (permalink / raw)
  To: ntg-context-request@ntg.nl

Hello Taco,

Thanks, I came up with the following

\def\comm#1{{\tt#1}\,}

\starttext
The \comm{rand} function generates pseudo-random numbers.
\stoptext

I quite satisfied with it, but maybe there is better way to typeset
programming keywords?

Best regards,
Vyatcheslav Yatskovsky



>> The following look ugly because of anaemic spacing before and after typed text.

>> \starttext
>> The {\tt rand} function generates pseudo-random numbers.
>> \stoptext

>> How to fix it?

> If you want the spaces larger than normal interword spaces,
> you could consider tagging your calls using a special macro
> to do the typesetting.  Perhaps like this:

> \def\function#1{ #1 }
> \starttext
> The \function{rand} function generates pseudo-random numbers.
> \stoptext

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

* Re: anaemic spacing around in-line typed text
  2007-04-01 12:40     ` Vyatcheslav Yatskovsky
@ 2007-04-01 13:22       ` Wolfgang Schuster
  2007-04-01 19:49         ` Vyatcheslav Yatskovsky
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2007-04-01 13:22 UTC (permalink / raw)
  To: ntg-context; +Cc: mailing list for ConTeXt users, Yatskovsky

On Sun, 1 Apr 2007 15:40:50 +0300
Vyatcheslav Yatskovsky <yatskovsky@gmail.com> wrote:

> Hello Taco,
> 
> Thanks, I came up with the following
> 
> \def\comm#1{{\tt#1}\,}
> 
> \starttext
> The \comm{rand} function generates pseudo-random numbers.
> \stoptext
> 
> I quite satisfied with it, but maybe there is better way to typeset
> programming keywords?
> 
> Best regards,
> Vyatcheslav Yatskovsky
> 

There is a better way to define such a command in ConTeXt.

\def\comm
  {\groupedcommand\tt\thinspace}

\starttext

The \comm{rand} function generates pseudo-random numbers.

The {\comm rand} function generates pseudo-random numbers.

\stoptext

Wolfgang

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

* Re: anaemic spacing around in-line typed text
  2007-04-01 13:22       ` Wolfgang Schuster
@ 2007-04-01 19:49         ` Vyatcheslav Yatskovsky
  2007-04-02  6:17           ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Vyatcheslav Yatskovsky @ 2007-04-01 19:49 UTC (permalink / raw)
  To: ntg-context-request@ntg.nl


[-- Attachment #1.1: Type: text/plain, Size: 1063 bytes --]

Hello Wolfgang,

Thanks.

\def\comm{\thinspace\groupedcommand\tt\thinspace}
 works quite well.

From a newbie standpoint, I wonder why replacing \thinspace with \hspace[medium] fails?

(I had another version
 \def\comm#1{\hspace[medium]{\tt#1}\hspace[medium]}
it worked.)

Vystcheslav



> On Sun, 1 Apr 2007 15:40:50 +0300
> Vyatcheslav Yatskovsky <yatskovsky@gmail.com> wrote:

>> Hello Taco,

>> Thanks, I came up with the following

>> \def\comm#1{{\tt#1}\,}

>> \starttext
>> The \comm{rand} function generates pseudo-random numbers.
>> \stoptext

>> I quite satisfied with it, but maybe there is better way to typeset
>> programming keywords?

>> Best regards,
>> Vyatcheslav Yatskovsky


> There is a better way to define such a command in ConTeXt.

> \def\comm
>   {\groupedcommand\tt\thinspace}

> \starttext

> The \comm{rand} function generates pseudo-random numbers.

> The {\comm rand} function generates pseudo-random numbers.

> \stoptext

> Wolfgang


-- 
Best regards,
Vyatcheslav Yatskovsky

[-- Attachment #1.2: Type: text/html, Size: 4188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: anaemic spacing around in-line typed text
  2007-04-01 19:49         ` Vyatcheslav Yatskovsky
@ 2007-04-02  6:17           ` Wolfgang Schuster
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2007-04-02  6:17 UTC (permalink / raw)
  To: Yatskovsky, mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 682 bytes --]

2007/4/1, Vyatcheslav Yatskovsky <yatskovsky@gmail.com>:
>
>  Hello Wolfgang,
>
>
> Thanks.
>
>
> \def\comm{\thinspace\groupedcommand\tt\thinspace}
>
>  works quite well.
>
>
> From a newbie standpoint, I wonder why replacing \thinspace with
> \hspace[medium] fails?
>

It did not fail, you forget only the braces.

\def\comm
  {\groupedcommand{\hspace[medium]\tt}{\hspace[medium]}}

To get more control over the spacing define your own \hspace:

\definehspace[commspace][medium]

\def\comm
  {\groupedcommand{\hspace[commspace]\tt}{\hspace[commspace]}}

Wolfgang

> (I had another version
>
>  \def\comm#1{\hspace[medium]{\tt#1}\hspace[medium]}
>
> it worked.)
>
>
> Vystcheslav
>

[-- Attachment #1.2: Type: text/html, Size: 1249 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

end of thread, other threads:[~2007-04-02  6:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.3821.1174921721.17432.ntg-context@ntg.nl>
2007-03-26 21:38 ` anaemic spacing around in-line typed text Vyatcheslav Yatskovsky
2007-03-27  9:49   ` Taco Hoekwater
2007-04-01 12:40     ` Vyatcheslav Yatskovsky
2007-04-01 13:22       ` Wolfgang Schuster
2007-04-01 19:49         ` Vyatcheslav Yatskovsky
2007-04-02  6:17           ` 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).