From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/86645 Path: news.gmane.org!not-for-mail From: Lars Huttar Newsgroups: gmane.comp.tex.context Subject: Re: confusion about expansion Date: Wed, 12 Mar 2014 10:51:14 -0400 Message-ID: <53207462.4020909@sil.org> References: <53206865.1090800@sil.org> <7117ED90-F27D-4B06-AD24-4B45926E5DB0@gmail.com> <53206B4D.3000001@sil.org> <314F455E-CFD1-4496-9523-83CCDCC47EC2@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1394635895 9560 80.91.229.3 (12 Mar 2014 14:51:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Mar 2014 14:51:35 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Mar 12 15:51:45 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 1WNkVO-0004Yq-Cp for gctc-ntg-context-518@m.gmane.org; Wed, 12 Mar 2014 15:51:38 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 84A1F101EF; Wed, 12 Mar 2014 15:51:37 +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 c3pdYS8ryLWQ; Wed, 12 Mar 2014 15:51:33 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 9714A101E3; Wed, 12 Mar 2014 15:51:33 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BF875101E3 for ; Wed, 12 Mar 2014 15:51:31 +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 3NHBUE-QSH0e for ; Wed, 12 Mar 2014 15:51:30 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 70FB4101E1 for ; Wed, 12 Mar 2014 15:51:20 +0100 (CET) Original-Received: from mail-qa0-f44.google.com (mail-qa0-f44.google.com [209.85.216.44]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s2CEpHWZ013915 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 12 Mar 2014 15:51:18 +0100 Original-Received: by mail-qa0-f44.google.com with SMTP id f11so10006832qae.3 for ; Wed, 12 Mar 2014 07:51:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=EWKB2MQKyCsmV46U3uZFzWFdhva5cLmegMl87zEY9ng=; b=fCIEt1wAD4af7kyvkWU0xQsfMrkQ4Je2U3wm2ZTO7rcabgqhBZKOv1cZ1Ipo9lTKSf Bfg2TlKbll0vOCpDfXqw2id0dp0duZglJIlUfYnY9WuPw16MI3U94wKgckbmkhmwkhi3 gm4cW9SqYGgYYN3Wd6MtU8VPSfECxDSyDAKqy0nmzqwyqsZdLGoPwqepYRpHvmJOkOuX ftHd8n08RDGWmFjWnpQWtcMTbPUUX0wNA78AiIwETfenxVWYNbGg0JBBfH0gnDTDqdFD uaglW3L91aqqPLHwISzqt6VqI+SYEfQbQVqm2ecUWTbiVy+TmtZayHK09WH1WXW4Uxj1 03gQ== X-Gm-Message-State: ALoCoQncYMk++K1NFyuEV3YFdafjndWHWHQfoevEgeOFdRCwNXr443AqTGv3cOKUbrEXTuVN/xNw X-Received: by 10.140.49.109 with SMTP id p100mr52451040qga.52.1394635876774; Wed, 12 Mar 2014 07:51:16 -0700 (PDT) Original-Received: from [192.168.254.6] (h34.53.189.173.dynamic.ip.windstream.net. [173.189.53.34]) by mx.google.com with ESMTPSA id e4sm78692766qar.12.2014.03.12.07.51.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 07:51:16 -0700 (PDT) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: <314F455E-CFD1-4496-9523-83CCDCC47EC2@gmail.com> X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=209.85.216.44; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QLACPhMR - 3f4c2feabd32 - 20140312 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 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:86645 Archived-At: On 3/12/2014 10:21 AM, Wolfgang Schuster wrote: > > 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 >> >: >>> >>>> 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=lefttop,x=3cm,y=-1.5\lineheight]{\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=middle,marking=on] > > \definelayer[cropmark][state=repeat,width=\paperwidth,height=\paperheight] > > \setupbackgrounds[page][background=cropmark] > > \setlayer[cropmark][preset=lefttop,x=3cm,y=1.5\lineheight]{\Markname} > > \starttext > > Foo > > \stoptext > > Thanks again... This gets rid of the error, but it seems to prevent any expansion of the content of \CurrentUser, because the page head now literally looks like this: Compiled March 12, 2014 by \cldcontext {os.resultof"whoami"}. LuaTEX+ConTEXt... Lars ___________________________________________________________________________________ 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 ___________________________________________________________________________________