From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/84378 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: deeptextcommand and firstcharacter Date: Sat, 21 Sep 2013 20:55:12 +0200 Message-ID: References: <523D6D33.9060702@wxs.nl> <55EEA48B-263D-4956-9EAE-6FAB388430EC@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1379789713 20857 80.91.229.3 (21 Sep 2013 18:55:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Sep 2013 18:55:13 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Sep 21 20:55:18 2013 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 1VNSKr-0001EB-Mu for gctc-ntg-context-518@m.gmane.org; Sat, 21 Sep 2013 20:55:17 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 06A02101F3; Sat, 21 Sep 2013 20:53:16 +0200 (CEST) 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 RtNuuCDpQqnX; Sat, 21 Sep 2013 20:53:14 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 711D1101E5; Sat, 21 Sep 2013 20:53:14 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3BC65101E5 for ; Sat, 21 Sep 2013 20:53:13 +0200 (CEST) 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 oal+uegufP6e for ; Sat, 21 Sep 2013 20:53:12 +0200 (CEST) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id 8C5D510193 for ; Sat, 21 Sep 2013 20:53:12 +0200 (CEST) Original-Received: from mail-ea0-x22f.google.com (mail-ea0-x22f.google.com [IPv6:2a00:1450:4013:c01::22f]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r8LIvc1q018901 for ; Sat, 21 Sep 2013 20:57:38 +0200 Original-Received: by mail-ea0-f175.google.com with SMTP id m14so887751eaj.6 for ; Sat, 21 Sep 2013 11:55:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=o+7pEDyyKKXvhaJ3jbTuqVeZM50DPSE1/IhhzMw9dn4=; b=NHGyalaKRfVS02U9aX+7MyTuK3U1Dk3nlq1aFuCJr+Ftee+HI0srZ/s6fENN9JwM3G 41UuqZsxYSTl9czdNUZ/5S4u9oIH/JFbqsxa9HN8XIFeHzgDjMGHC5OZjBW29V7K2Ta3 /w7hhYLIUCC908pxjTt35bDuEn5t4OsjcKCPro1MwfC9RPTOhZ9n/jFrOiMN56nTNCqa po93hx26MfDfcMtwNNB/AXUcNamV3M45A07FZmtjCy2MAFxdF3to759sGfKyB6J1PKAr ZUJ7nQq051zo/w2hvNOa2H9IqSoutLYgAkgQnu2gB/M3oRoJlwD2E+0dNEf31mpGwXok znQg== X-Received: by 10.15.48.67 with SMTP id g43mr21489791eew.17.1379789713018; Sat, 21 Sep 2013 11:55:13 -0700 (PDT) Original-Received: from keima.localdomain (x2f21fe0.dyn.telefonica.de. [2.242.31.224]) by mx.google.com with ESMTPSA id h45sm20187636eeg.5.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 21 Sep 2013 11:55:12 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.1510) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:4013:c01::22f; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01KrSVCzi - 0a1808c36bb9 - 20130921 (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:84378 Archived-At: Am 21.09.2013 um 20:46 schrieb Thangalin : > Hi, Wolfgang. > = > I tried dropping in the Lua code, but it does not extract the text: > = > \define[1]\StyleChapter{% > \StyleChapterFramed{% > \framed[align=3Dright, frame=3Doff]{% > \startoverlay > \color[ColourSecondaryLightest]{% > \cldcontext{string.sub(#1,0,1)} \cldcontext{string.sub("#1",0,1)}% > } > \vskip-1.9em\hskip1.2em#1 > \stopoverlay > } > } > } When this doesn=92t help you have to provide a complete minimal example. > ! LuaTeX error [string "\directlua "]:1: bad argument #1 to 'sub' (string= expected, got nil) > = > I've tried a few variations: > = > \directlua{string.sub(tex.sprint("\luatexluaescapestring{#1}") } > \directlua{string.sub("\luatexluaescapestring{#1}",0,1)} > \directlua{string.sub(tex.sprint("#1"),0,1)} > \cldcontext{string.sub(tex.sprint("#1"),0,1)} 1. You have to use string.sub in the parameters of tex.sprint. 2. ConTeXt uses \luaescapestring. 3. We use in ConTeXt \ctxlua instead of \directlua. Wolfgang ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________