ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* weird spacing after command type
@ 2018-10-14 18:38 Pablo Rodriguez
  2018-10-14 18:59 ` Wolfgang Schuster
  0 siblings, 1 reply; 2+ messages in thread
From: Pablo Rodriguez @ 2018-10-14 18:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list,

I have the following sample:

    \define[1]\slide{\startmakeup[standard]#1\stopmakeup}

    \definetype[texcode][style=\ttd, option=TEX]

    \starttext
    \slide{\texcode{\ifodd\pageno impar\else par\fi}}

    \startmakeup[standard]
        \texcode{\ifodd\pageno impar\else par\fi}
    \stopmakeup
    \stoptext

I wonder why \slide introduces a space after each command.

Am I missing something or have I hit a bug?

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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] 2+ messages in thread

* Re: weird spacing after command type
  2018-10-14 18:38 weird spacing after command type Pablo Rodriguez
@ 2018-10-14 18:59 ` Wolfgang Schuster
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Schuster @ 2018-10-14 18:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Pablo Rodriguez



Pablo Rodriguez schrieb am 14.10.18 um 20:38:
> Dear list,
>
> I have the following sample:
>
>      \define[1]\slide{\startmakeup[standard]#1\stopmakeup}
>
>      \definetype[texcode][style=\ttd, option=TEX]
>
>      \starttext
>      \slide{\texcode{\ifodd\pageno impar\else par\fi}}
>
>      \startmakeup[standard]
>          \texcode{\ifodd\pageno impar\else par\fi}
>      \stopmakeup
>      \stoptext
>
> I wonder why \slide introduces a space after each command.
>
> Am I missing something or have I hit a bug?

This is normal behaviour for TeX which inserts a spaces after control 
sequences when it tokenizes the input.

\starttext
\detokenize{\ifx\a\b\else\fi}
\stoptext


The best thing you can do is to avoid verbatim code in arguments of 
other commands (section headers are one case where you can’t avoid this) 
and your normal use of the makeup-environment shows how you can avoid 
the unwanted output.


Another way to avoid the space is to create commands which don’t take 
argument which works only when you have a environment which isn’t 
delimited (i.e. the environment grabs everything from the start-command 
to the stop-command).

\define\slide{\groupedcommand{\startmakeup[standard]}{\stopmakeup}}

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] 2+ messages in thread

end of thread, other threads:[~2018-10-14 18:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-14 18:38 weird spacing after command type Pablo Rodriguez
2018-10-14 18:59 ` 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).