From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/86644 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: confusion about expansion Date: Wed, 12 Mar 2014 15:21:43 +0100 Message-ID: <314F455E-CFD1-4496-9523-83CCDCC47EC2@gmail.com> References: <53206865.1090800@sil.org> <7117ED90-F27D-4B06-AD24-4B45926E5DB0@gmail.com> <53206B4D.3000001@sil.org> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Content-Type: multipart/mixed; boundary="===============1426716654==" X-Trace: ger.gmane.org 1394634115 17303 80.91.229.3 (12 Mar 2014 14:21:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Mar 2014 14:21:55 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Mar 12 15:22:05 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WNk2i-0002mQ-8f for gctc-ntg-context-518@m.gmane.org; Wed, 12 Mar 2014 15:22:00 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 77048101EE; Wed, 12 Mar 2014 15:21:59 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id bmd1NMK8kai1; Wed, 12 Mar 2014 15:21:58 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id D59DD101E3; Wed, 12 Mar 2014 15:21:57 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2BF84101E3 for ; Wed, 12 Mar 2014 15:21:56 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id OfEHzv4KjNNx for ; Wed, 12 Mar 2014 15:21:53 +0100 (CET) Original-Received: from filter1-utr.mf.surf.net (filter1-utr.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id 3B280101E1 for ; Wed, 12 Mar 2014 15:21:43 +0100 (CET) Original-Received: from mail-bk0-x232.google.com (mail-bk0-x232.google.com [IPv6:2a00:1450:4008:c01::232]) by filter1-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s2CELgJR006816 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 12 Mar 2014 15:21:42 +0100 Original-Received: by mail-bk0-f50.google.com with SMTP id w10so1418725bkz.9 for ; Wed, 12 Mar 2014 07:21:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to; bh=tiQnjUoFULzO/Vp7pC7JAxyH6avtA9GtmANu5dKOu2w=; b=BGnZvRuxqJzFyCKUAxMvXZPhfAb2POj00pHfAuDCU22nmGq9v32p7RFq+FAJcYR3Y+ cYFXapKKwUMPqaI5VjjccXjFKgB+0GcT6T5dtS9gcV+9vTuOJi68GcqLOV883Oub5N1h 2kdwN6hRnCe3dQfvzJ6el1X6pYErSG1CfEhbi2/iceKRDwA3LKomTj2S/2gLYalAbuOD udKIXWhV1By4+2CHbWfti1FoZXsoben9lprBmpTi3qVaadafjdEIXQ996IOI7IMWr5Ke +SGAV3CN05iD6U3XCJn+PHg1owq7kZVswjgFYlCdSOIO3WRGcocY20J+wkZT4IZ5X2ui uyQw== X-Received: by 10.205.12.7 with SMTP id pg7mr17041641bkb.4.1394634102304; Wed, 12 Mar 2014 07:21:42 -0700 (PDT) Original-Received: from keima.localdomain (x2f226a9.dyn.telefonica.de. [2.242.38.169]) by mx.google.com with ESMTPSA id z3sm18373448bkn.3.2014.03.12.07.21.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 07:21:40 -0700 (PDT) In-Reply-To: <53206B4D.3000001@sil.org> X-Mailer: Apple Mail (2.1874) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:4008:c01::232; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07LAClG9t - ba017a5803b5 - 20140312 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:86644 Archived-At: --===============1426716654== Content-Type: multipart/alternative; boundary="Apple-Mail=_0DADC970-6F91-4752-A990-FE42F3C066CC" --Apple-Mail=_0DADC970-6F91-4752-A990-FE42F3C066CC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Am 12.03.2014 um 15:12 schrieb Lars Huttar : > On 3/12/2014 10:05 AM, Wolfgang Schuster wrote: >> Am 12.03.2014 um 15:00 schrieb Lars Huttar : >>=20 >>> Hello, >>> I've got a running page head like this in my document: >>>=20 >>> \def\CurrentUser{\cldcontext{os.resultof"whoami"}} >>>=20 >>> \def\Markname { Compiled \date by \CurrentUser \LUATEX +\ConTeXt\ >>> \contextversion } >>>=20 >>> and later: >>>=20 >>> = \setlayer[cropmark][preset=3Dlefttop,x=3D3cm,y=3D-1.5\lineheight]{\Marknam= e} >>>=20 >>> But when I run this, I get a UCS error that seems to indicate that = the >>> *result* of \CurrentUser ("waxhaw\huttar") is getting parsed as a >>> command sequence. >> When you want to pass a backslash to Lua you have to use = \letterbackslash. >>=20 >=20 > Thanks... can you give me an example of what that would look like? > I don't think I want to pass a backslash to Lua, so I'm not sure how = to > apply what you're saying. Or are you using "Lua" here in the sense of > LuaTeX? >=20 > A backslash appears in the output of os.resultof"whoami"; do I need to > perform some processing on that output in order to escape backslashes? Try this: \def\CurrentUser{\cldcontext{os.resultof"whoami"}} \def\Markname{Compiled \date by \detokenize\expandafter{\CurrentUser} = \LUATEX +\ConTeXt\ \contextversion.} \setuplayout[location=3Dmiddle,marking=3Don] = \definelayer[cropmark][state=3Drepeat,width=3D\paperwidth,height=3D\paperh= eight] \setupbackgrounds[page][background=3Dcropmark] \setlayer[cropmark][preset=3Dlefttop,x=3D3cm,y=3D1.5\lineheight]{\Markname= } \starttext Foo \stoptext Wolfgang= --Apple-Mail=_0DADC970-6F91-4752-A990-FE42F3C066CC Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
Am 12.03.2014 um 15:12 schrieb Lars = Huttar <lars_huttar@sil.org>:

On 3/12/2014 10:05 AM, Wolfgang = Schuster wrote:
Am 12.03.2014 um 15:00 = schrieb Lars Huttar <lars_huttar@sil.org>:

Hello,
I've got a running page head like this = in my = document:

\def\CurrentUser{\cldcontext{os.resultof"whoami"}}
\def\Markname { Compiled \date by \CurrentUser  \LUATEX = +\ConTeXt\
\contextversion }

and = later:

\setlayer[cropmark][preset=3Dlefttop,x=3D3cm,y=3D-1.5\linehe= ight]{\Markname}

But when I run this, I get a UCS error that = seems to indicate that the
*result* of \CurrentUser ("waxhaw\huttar") = is getting parsed as a
command sequence.
When you = want to pass a backslash to Lua you have to use = \letterbackslash.


Thanks... can you give me an = example of what that would look like?
I don't think I want to pass a = backslash to Lua, so I'm not sure how to
apply what you're saying. Or = are you using "Lua" here in the sense of
LuaTeX?

A backslash = appears in the output of os.resultof"whoami"; do I need to
perform = some processing on that output in order to escape = backslashes?

Try = this:

\def\CurrentUser{\cldcontext{os.resultof"whoami"}= }

\def\Markname{Compiled \date by = \detokenize\expandafter{\CurrentUser} \LUATEX +\ConTeXt\ = \contextversion.}

\setuplayout[location=3Dmiddle,= marking=3Don]

\definelayer[cropmark][state=3Drepe= at,width=3D\paperwidth,height=3D\paperheight]

\se= tupbackgrounds[page][background=3Dcropmark]

\setl= ayer[cropmark][preset=3Dlefttop,x=3D3cm,y=3D1.5\lineheight]{\Markname}

\starttext

Foo
\stoptext

Wolfgang
= --Apple-Mail=_0DADC970-6F91-4752-A990-FE42F3C066CC-- --===============1426716654== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============1426716654==--