ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Trailing Space after \cldcontext
@ 2011-06-27  3:03 Kip Warner
  2011-06-27  5:23 ` Peter Münster
  0 siblings, 1 reply; 4+ messages in thread
From: Kip Warner @ 2011-06-27  3:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hey list,

Is there any way to remove the trailing space that appears to be
automatically inserted when \cldcontext output is captured? For
instance,

Bazaar revision \cldcontext{os.resultof"bzr revno"}.

Will show "Bazaar revision 43 ."

I've manually checked the output of the command to run and it doesn't
appear to add that space character itself, so I am wondering if
os.resultof is appending the extraneous space?

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 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] 4+ messages in thread

* Re: Trailing Space after \cldcontext
  2011-06-27  3:03 Trailing Space after \cldcontext Kip Warner
@ 2011-06-27  5:23 ` Peter Münster
  2011-06-27  7:41   ` Kip Warner
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Münster @ 2011-06-27  5:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, Jun 27 2011, Kip Warner wrote:

> Is there any way to remove the trailing space that appears to be
> automatically inserted when \cldcontext output is captured? For
> instance,
>
> Bazaar revision \cldcontext{os.resultof"bzr revno"}.
>
> Will show "Bazaar revision 43 ."
>
> I've manually checked the output of the command to run and it doesn't
> appear to add that space character itself, so I am wondering if
> os.resultof is appending the extraneous space?

It adds a newline, that's like a space. See this example:

\starttext
Bazaar revision \cldcontext{os.resultof"echo 123"}.

Bazaar revision \cldcontext{os.resultof"echo -n 123"}.

Bazaar revision \cldcontext{os.resultof"dummy=`bzr revno`; echo -n $dummy"}.

Bazaar revision \cldcontext{os.resultof"bzr revno | tr -d '\\n'"}.
\stoptext

-- 
           Peter
___________________________________________________________________________________
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] 4+ messages in thread

* Re: Trailing Space after \cldcontext
  2011-06-27  5:23 ` Peter Münster
@ 2011-06-27  7:41   ` Kip Warner
  2011-06-27 12:14     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Kip Warner @ 2011-06-27  7:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Mon, 2011-06-27 at 07:23 +0200, Peter Münster wrote:
> It adds a newline, that's like a space. See this example:
> 
> \starttext
> Bazaar revision \cldcontext{os.resultof"echo 123"}.
> 
> Bazaar revision \cldcontext{os.resultof"echo -n 123"}.
> 
> Bazaar revision \cldcontext{os.resultof"dummy=`bzr revno`; echo -n $dummy"}.
> 
> Bazaar revision \cldcontext{os.resultof"bzr revno | tr -d '\\n'"}.
> \stoptext

Hey Peter. The tr -d method I found to be the most elegant. Thank you.

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 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] 4+ messages in thread

* Re: Trailing Space after \cldcontext
  2011-06-27  7:41   ` Kip Warner
@ 2011-06-27 12:14     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2011-06-27 12:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Kip Warner

On 27-6-2011 9:41, Kip Warner wrote:
> On Mon, 2011-06-27 at 07:23 +0200, Peter Münster wrote:
>> It adds a newline, that's like a space. See this example:
>>
>> \starttext
>> Bazaar revision \cldcontext{os.resultof"echo 123"}.
>>
>> Bazaar revision \cldcontext{os.resultof"echo -n 123"}.
>>
>> Bazaar revision \cldcontext{os.resultof"dummy=`bzr revno`; echo -n $dummy"}.
>>
>> Bazaar revision \cldcontext{os.resultof"bzr revno | tr -d '\\n'"}.
>> \stoptext
>
> Hey Peter. The tr -d method I found to be the most elegant. Thank you.

or \cldcontext{string.strip(os.resultof("echo -n 123"))} etc


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 4+ messages in thread

end of thread, other threads:[~2011-06-27 12:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-27  3:03 Trailing Space after \cldcontext Kip Warner
2011-06-27  5:23 ` Peter Münster
2011-06-27  7:41   ` Kip Warner
2011-06-27 12:14     ` Hans Hagen

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