![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
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
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
------------------------------------------------------------------------
___________________________________________________________________________________ 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 ___________________________________________________________________________________
-- ----------------------------------------------------------------- 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 -----------------------------------------------------------------