From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/55468 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: What is the luatex version of \pdfescapehex Date: Wed, 06 Jan 2010 09:38:32 +0100 Message-ID: <4B444C08.7060204@wxs.nl> References: <769ba7781001051733h204cdaa7w87382293cb8e2475@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1262767139 14537 80.91.229.12 (6 Jan 2010 08:38:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Jan 2010 08:38:59 +0000 (UTC) Cc: Zhichu Chen To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 06 09:38:52 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.50) id 1NSRPn-00036G-QM for gctc-ntg-context-518@m.gmane.org; Wed, 06 Jan 2010 09:38:51 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3BAE4C9B8C; Wed, 6 Jan 2010 09:38:49 +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 YjoMVybDBlDg; Wed, 6 Jan 2010 09:38:46 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CB9DEC9B41; Wed, 6 Jan 2010 09:38:46 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4BF9DC9B41 for ; Wed, 6 Jan 2010 09:38:46 +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 xhlyJ3CEuy2g for ; Wed, 6 Jan 2010 09:38:44 +0100 (CET) Original-Received: from mail.solcon.net (dsl-083-247-100-017.solcon.nl [83.247.100.17]) by balder.ntg.nl (Postfix) with ESMTP id 1F3B4C9B35 for ; Wed, 6 Jan 2010 09:38:43 +0100 (CET) X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.100; Original-Received: from [10.100.1.100] (unverified [10.100.1.100]) by controller-9 (SurgeMail 4.2d2) with ESMTP id 561-1713362 for multiple; Wed, 06 Jan 2010 09:38:35 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 In-Reply-To: <769ba7781001051733h204cdaa7w87382293cb8e2475@mail.gmail.com> X-Authenticated-User: hagen@controller-9 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:55468 Archived-At: On 6-1-2010 2:33, Zhichu Chen wrote: > Hi, > > I've written a very old module which used a lot of pdf primitives like > \pdfescapehex > and \pdfescapename etc. and it turns out not they don't work in mkiv. > So I just want > to know are there any alternatives? just lua code as placeholders for primitives will not show up in context mkiv \startluacode local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes local gsub, format, byte = string.gsub, string.format, string.byte function commands.hexify(str) texsprint(ctxcatcodes,(gsub(str,".",function(s) return format("%0X",byte(s)) end))) end \stopluacode \long\def\hexify#1{\ctxlua{commands.hexify([[#1]])}} \hexify{I wonder why this is needed.} btw, if your old module produces pdf and uses other \pdf... primitives it's unlikely to work with mkiv anyway so you'd better check if it's still needed Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 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 ___________________________________________________________________________________