From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/38315 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:09:52 +0100 Message-ID: <20071227160952.471cd95b.schuster.wolfgang@googlemail.com> References: <6703815B292B664DBAEC55EE3192386A20BD6F@poseidon.in.dynetics.com> <4773BD0E.2020108@wxs.nl> 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 1198771901 13707 80.91.229.12 (27 Dec 2007 16:11:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Dec 2007 16:11:41 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Thu Dec 27 17:11:55 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 1J7vKo-0002uE-K0 for gctc-ntg-context-518@m.gmane.org; Thu, 27 Dec 2007 17:11:50 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 933071FB9B; Thu, 27 Dec 2007 17:11:28 +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 06811-01-2; Thu, 27 Dec 2007 17:10:48 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BD99B1FB30; Thu, 27 Dec 2007 17:10:48 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id CC4F91FB29 for ; Thu, 27 Dec 2007 17:10:47 +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 06795-02 for ; Thu, 27 Dec 2007 17:10:15 +0100 (CET) Original-Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by ronja.ntg.nl (Postfix) with ESMTP id 06B4E1FA63 for ; Thu, 27 Dec 2007 16:16:17 +0100 (CET) Original-Received: by fg-out-1718.google.com with SMTP id e12so1824141fga.8 for ; Thu, 27 Dec 2007 07:16:16 -0800 (PST) Original-Received: by 10.86.98.18 with SMTP id v18mr7897076fgb.18.1198768576871; Thu, 27 Dec 2007 07:16:16 -0800 (PST) Original-Received: from rover ( [84.149.78.177]) by mx.google.com with ESMTPS id 3sm8841629fge.7.2007.12.27.07.16.15 (version=SSLv3 cipher=OTHER); Thu, 27 Dec 2007 07:16:15 -0800 (PST) In-Reply-To: <4773BD0E.2020108@wxs.nl> 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:38315 Archived-At: On Thu, 27 Dec 2007 15:56:14 +0100 Hans Hagen wrote: > 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 > > \externalfigure[{flower[1].jpg}] may also work This did not work, the bracket after 1 is interpreted as the end for externalfigure and ConTeXt looks for a figure with the name "flower[1" but brackets in figure names could be used with \useexternalfigure. > > 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? > > > > Cheers, > > Mike 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 ___________________________________________________________________________________