ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* unwanted extra space in type definition
@ 2014-05-26 16:00 Pablo Rodriguez
  2014-05-26 16:08 ` Wolfgang Schuster
  2014-05-26 16:55 ` luigi scarso
  0 siblings, 2 replies; 5+ messages in thread
From: Pablo Rodriguez @ 2014-05-26 16:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list,

I have the following sample:

    \definetype[TeXcode][option=TEX]
    \def\arg#1{\TeXcode{{#1}}}
    \starttext
    \arg{\em\de Textsatzsystem}

    \TeXcode{{\em\de Textsatzsystem}}
    \stoptext

I don’t know what is wrong defined in \arg that inserts an extra space
after \em?

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


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

* Re: unwanted extra space in type definition
  2014-05-26 16:00 unwanted extra space in type definition Pablo Rodriguez
@ 2014-05-26 16:08 ` Wolfgang Schuster
  2014-05-26 17:03   ` Pablo Rodriguez
  2014-05-26 16:55 ` luigi scarso
  1 sibling, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2014-05-26 16:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 26.05.2014 um 18:00 schrieb Pablo Rodriguez <oinos@gmx.es>:

> Dear list,
> 
> I have the following sample:
> 
>    \definetype[TeXcode][option=TEX]
>    \def\arg#1{\TeXcode{{#1}}}
>    \starttext
>    \arg{\em\de Textsatzsystem}
> 
>    \TeXcode{{\em\de Textsatzsystem}}
>    \stoptext
> 
> I don’t know what is wrong defined in \arg that inserts an extra space
> after \em?

You can’t do this form a definition for a verbatim command because TeX has its own rules
for such a situation (search for a description about catcodes), when you want a copy of
\TeXcode add

    \definetype[arg][TeXcode]

to your document.

BTW: \arg is a predefined command and you should avoid to redefine it

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


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

* Re: unwanted extra space in type definition
  2014-05-26 16:00 unwanted extra space in type definition Pablo Rodriguez
  2014-05-26 16:08 ` Wolfgang Schuster
@ 2014-05-26 16:55 ` luigi scarso
  2014-05-26 19:00   ` Pablo Rodriguez
  1 sibling, 1 reply; 5+ messages in thread
From: luigi scarso @ 2014-05-26 16:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Mon, May 26, 2014 at 6:00 PM, Pablo Rodriguez <oinos@gmx.es> wrote:

> Dear list,
>
> I have the following sample:
>
>     \definetype[TeXcode][option=TEX]
>     \def\arg#1{\TeXcode{{#1}}}
>     \starttext
>     \arg{\em\de Textsatzsystem}
>
>     \TeXcode{{\em\de Textsatzsystem}}
>     \stoptext
>
> I don’t know what is wrong defined in \arg that inserts an extra space
> after \em?
>
> You can see how TeX works with \tracingmacros
\definetype[TeXcode][option=TEX]
\def\arg#1{\edef\temp{#1}\TeXcode{{#1}}}
\starttext
\tracingmacros1
\arg{\em\de Textsatzsystem}
\tracingnone
\tracingmacros1
\TeXcode{{\em\de Textsatzsystem}}
\tracingnone
\stoptext


-- 
luigi

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

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

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: unwanted extra space in type definition
  2014-05-26 16:08 ` Wolfgang Schuster
@ 2014-05-26 17:03   ` Pablo Rodriguez
  0 siblings, 0 replies; 5+ messages in thread
From: Pablo Rodriguez @ 2014-05-26 17:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 05/26/2014 06:08 PM, Wolfgang Schuster wrote:
> Am 26.05.2014 um 18:00 schrieb Pablo Rodriguez:
>>    \def\arg#1{\TeXcode{{#1}}}
>> [...]
>> I don’t know what is wrong defined in \arg that inserts an extra space
>> after \em?
> 
> You can’t do this form a definition for a verbatim command because TeX has its own rules
> for such a situation (search for a description about catcodes), when you want a copy of
> \TeXcode add
> 
>     \definetype[arg][TeXcode]
> 
> to your document.
> 
> BTW: \arg is a predefined command and you should avoid to redefine it

Many thanks for your reply, Wolfgang.

Is there no way that I have the already predefined \arg with colored
contents (braces included)?

Even with defining another command, the problem is that left and right
aren’t covered by option=TEX.

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


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

* Re: unwanted extra space in type definition
  2014-05-26 16:55 ` luigi scarso
@ 2014-05-26 19:00   ` Pablo Rodriguez
  0 siblings, 0 replies; 5+ messages in thread
From: Pablo Rodriguez @ 2014-05-26 19:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 05/26/2014 06:55 PM, luigi scarso wrote:
> On Mon, May 26, 2014 at 6:00 PM, Pablo Rodriguez wrote:
> 
>     Dear list,
> 
>     I have the following sample:
> 
>         \definetype[TeXcode][option=TEX]
>         \def\arg#1{\TeXcode{{#1}}}
>         \starttext
>         \arg{\em\de Textsatzsystem}
> 
>         \TeXcode{{\em\de Textsatzsystem}}
>         \stoptext
> 
>     I don’t know what is wrong defined in \arg that inserts an extra space
>     after \em?
> 
> You can see how TeX works with \tracingmacros
> \definetype[TeXcode][option=TEX]
> \def\arg#1{\edef\temp{#1}\TeXcode{{#1}}}
> \starttext
> \tracingmacros1
> \arg{\em\de Textsatzsystem}
> \tracingnone
> \tracingmacros1
> \TeXcode{{\em\de Textsatzsystem}}
> \tracingnone
> \stoptext

Many thanks for your reply, Luigi. Sorry, but I have just downloaded and
read your message.

Well, this seems to be something beyond my understanding (this is all
Greek to me). The only conclusion I can draw is that I have to use the
second option.

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


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

end of thread, other threads:[~2014-05-26 19:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-26 16:00 unwanted extra space in type definition Pablo Rodriguez
2014-05-26 16:08 ` Wolfgang Schuster
2014-05-26 17:03   ` Pablo Rodriguez
2014-05-26 16:55 ` luigi scarso
2014-05-26 19:00   ` Pablo Rodriguez

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).