From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/38308 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: escaping filenames with externalfigure Date: Thu, 27 Dec 2007 16:00:42 +0100 Message-ID: <20071227160042.7b85a47f.schuster.wolfgang@googlemail.com> References: <6703815B292B664DBAEC55EE3192386A20BD6F@poseidon.in.dynetics.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" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1198767963 1327 80.91.229.12 (27 Dec 2007 15:06:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Dec 2007 15:06:03 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Thu Dec 27 16:06:16 2007 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1J7uIx-000706-2l for gctc-ntg-context-518@m.gmane.org; Thu, 27 Dec 2007 16:05:51 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 111D51FADB; Thu, 27 Dec 2007 16:05:30 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 29597-01-5; Thu, 27 Dec 2007 16:04:54 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 33CDC1FAC5; Thu, 27 Dec 2007 16:04:54 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 421B71FAC5 for ; Thu, 27 Dec 2007 16:04:51 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 30238-01-2 for ; Thu, 27 Dec 2007 16:04:12 +0100 (CET) Original-Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by ronja.ntg.nl (Postfix) with ESMTP id 634C41FA63 for ; Thu, 27 Dec 2007 16:04:12 +0100 (CET) Original-Received: by fg-out-1718.google.com with SMTP id e12so1822041fga.8 for ; Thu, 27 Dec 2007 07:04:11 -0800 (PST) Original-Received: by 10.86.79.19 with SMTP id c19mr7886530fgb.31.1198767851888; Thu, 27 Dec 2007 07:04:11 -0800 (PST) Original-Received: from rover ( [84.149.78.177]) by mx.google.com with ESMTPS id d6sm8700817fga.0.2007.12.27.07.04.10 (version=SSLv3 cipher=OTHER); Thu, 27 Dec 2007 07:04:11 -0800 (PST) In-Reply-To: <6703815B292B664DBAEC55EE3192386A20BD6F@poseidon.in.dynetics.com> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.10.14; i686-pc-mingw32) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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 X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:38308 Archived-At: On Thu, 27 Dec 2007 08:09:55 -0600 "Santy, Michael" wrote: > Is there a way to escape special characters in filenames passed to externalfigure. I'm encountering the situation where users are choosing images that may contain brackets or curly braces (e.g., flower[1].jpg or flower{1}.jpg). If I pass filename containing these characters directly to externalfigure, the closing bracket is mistaken for the end of the filename. > \externalfigure[flower{1}.jpg] % works > \externalfigure[flower[1].jpg] % doesn't work > > I then tried to define a variable that holds the filename and pass that variable to externalfigure, but it ran into problems with curly braces. > > \def\myimagefilename{flower[1].jpg} > \externalfigure[\myimagefilename] % works > > \def\myimagefilename{flower{1}.jpg} > \externalfigure[\myimagefilename] % doesn't work > > Does anyone have any idea how I could handle arbitrary filename inputs that contain brackets and curly braces? Yould could define symbolic names for the figures and access the figures with this name, this allows you also to use bracketrs in the file names. \useexternalfigure[brace flower][flower{1}] \useexternalfigure[bracket flower][{flower[1]}] \starttext \externalfigure[brace flower] \externalfigure[bracket flower] \stoptext Wolfgang ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________