anaemic spacing around in-line typed text
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
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
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
On Sun, 1 Apr 2007 15:40:50 +0300
Vyatcheslav Yatskovsky
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
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
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
2007/4/1, Vyatcheslav Yatskovsky
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
participants (3)
-
Taco Hoekwater
-
Vyatcheslav Yatskovsky
-
Wolfgang Schuster