ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* escaping filenames with externalfigure
@ 2007-12-27 14:09 Santy, Michael
  2007-12-27 14:55 ` Hans Hagen
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Santy, Michael @ 2007-12-27 14:09 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 906 bytes --]


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?

Cheers,
Mike

[-- Attachment #1.2: Type: text/html, Size: 1364 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: escaping filenames with externalfigure
  2007-12-27 14:09 escaping filenames with externalfigure Santy, Michael
@ 2007-12-27 14:55 ` Hans Hagen
  2007-12-27 15:02   ` Santy, Michael
  2007-12-27 14:56 ` Hans Hagen
  2007-12-27 15:00 ` Wolfgang Schuster
  2 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2007-12-27 14:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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?

maybe "name" works

-----------------------------------------------------------------
                                           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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: escaping filenames with externalfigure
  2007-12-27 14:09 escaping filenames with externalfigure Santy, Michael
  2007-12-27 14:55 ` Hans Hagen
@ 2007-12-27 14:56 ` Hans Hagen
  2007-12-27 15:05   ` Santy, Michael
  2007-12-27 15:09   ` Wolfgang Schuster
  2007-12-27 15:00 ` Wolfgang Schuster
  2 siblings, 2 replies; 12+ messages in thread
From: Hans Hagen @ 2007-12-27 14:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: escaping filenames with externalfigure
  2007-12-27 14:09 escaping filenames with externalfigure Santy, Michael
  2007-12-27 14:55 ` Hans Hagen
  2007-12-27 14:56 ` Hans Hagen
@ 2007-12-27 15:00 ` Wolfgang Schuster
  2007-12-27 15:16   ` Santy, Michael
  2 siblings, 1 reply; 12+ messages in thread
From: Wolfgang Schuster @ 2007-12-27 15:00 UTC (permalink / raw)
  To: ntg-context

On Thu, 27 Dec 2007 08:09:55 -0600
"Santy, Michael" <Michael.Santy@dynetics.com> 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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: escaping filenames with externalfigure
  2007-12-27 14:55 ` Hans Hagen
@ 2007-12-27 15:02   ` Santy, Michael
  0 siblings, 0 replies; 12+ messages in thread
From: Santy, Michael @ 2007-12-27 15:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2255 bytes --]

If I understand your suggestion correctly, specifying name doesn't work.

\externalfigure[][name=flower[1].jpg]
\externalfigure[name=flower[1].jpg]

Cheers,
Mike

-----Original Message-----
From: ntg-context-bounces@ntg.nl on behalf of Hans Hagen
Sent: Thu 12/27/2007 8:55 AM
To: mailing list for ConTeXt users
Subject: Re: [NTG-context] escaping filenames with externalfigure
 
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?

maybe "name" works

-----------------------------------------------------------------
                                           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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 3688 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: escaping filenames with externalfigure
  2007-12-27 14:56 ` Hans Hagen
@ 2007-12-27 15:05   ` Santy, Michael
  2007-12-27 15:09   ` Wolfgang Schuster
  1 sibling, 0 replies; 12+ messages in thread
From: Santy, Michael @ 2007-12-27 15:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2865 bytes --]

\externalfigure[{flower[1].jpg}] demonstrates the same behavior as \externalfigure[flower[1].jpg]

Cheers,
Mike


-----Original Message-----
From: ntg-context-bounces@ntg.nl on behalf of Hans Hagen
Sent: Thu 12/27/2007 8:56 AM
To: mailing list for ConTeXt users
Subject: Re: [NTG-context] escaping filenames with externalfigure
 
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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 4662 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: escaping filenames with externalfigure
  2007-12-27 14:56 ` Hans Hagen
  2007-12-27 15:05   ` Santy, Michael
@ 2007-12-27 15:09   ` Wolfgang Schuster
  1 sibling, 0 replies; 12+ messages in thread
From: Wolfgang Schuster @ 2007-12-27 15:09 UTC (permalink / raw)
  To: ntg-context

On Thu, 27 Dec 2007 15:56:14 +0100
Hans Hagen <pragma@wxs.nl> 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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: escaping filenames with externalfigure
  2007-12-27 15:00 ` Wolfgang Schuster
@ 2007-12-27 15:16   ` Santy, Michael
  2007-12-27 15:27     ` Wolfgang Schuster
  0 siblings, 1 reply; 12+ messages in thread
From: Santy, Michael @ 2007-12-27 15:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2463 bytes --]


Wolfgang,

Thanks for the suggestion.  However, I'm using ConTeXt to typeset arbitrary XML input from users (and therefore arbitrary image filenames).  While your idea works for the two examples that I gave, it doesn't work if the curly braces aren't balanced in the filename (e.g., "flower{1.jpg").  Is there any general character escaping mechanism for macro arguments?

Cheers,
Mike

-----Original Message-----
From: ntg-context-bounces@ntg.nl on behalf of Wolfgang Schuster
Sent: Thu 12/27/2007 9:00 AM
To: ntg-context@ntg.nl
Subject: Re: [NTG-context] escaping filenames with externalfigure
 
On Thu, 27 Dec 2007 08:09:55 -0600
"Santy, Michael" <Michael.Santy@dynetics.com> 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
___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 3425 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: escaping filenames with externalfigure
  2007-12-27 15:16   ` Santy, Michael
@ 2007-12-27 15:27     ` Wolfgang Schuster
  2007-12-27 15:58       ` Santy, Michael
  0 siblings, 1 reply; 12+ messages in thread
From: Wolfgang Schuster @ 2007-12-27 15:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> Wolfgang,
>
>  Thanks for the suggestion.  However, I'm using ConTeXt to typeset arbitrary
> XML input from users (and therefore arbitrary image filenames).  While your
> idea works for the two examples that I gave, it doesn't work if the curly
> braces aren't balanced in the filename (e.g., "flower{1.jpg").  Is there any
> general character escaping mechanism for macro arguments?
>
>  Cheers,
>  Mike

If you use xml as input format you could save the file name in a temporary
macro and use this macro now in the \externalfigure command. You already
gave a example for this.

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: escaping filenames with externalfigure
  2007-12-27 15:27     ` Wolfgang Schuster
@ 2007-12-27 15:58       ` Santy, Michael
  2007-12-28 23:19         ` Hans Hagen
  0 siblings, 1 reply; 12+ messages in thread
From: Santy, Michael @ 2007-12-27 15:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1523 bytes --]

The problem that I've found with that approach is that the braces have to be balanced.

\def\myimagefilename{flower{1.jpg} % doesn't work
\def\myimagefilename{flower{1}.jpg} % works


-----Original Message-----
From: ntg-context-bounces@ntg.nl on behalf of Wolfgang Schuster
Sent: Thu 12/27/2007 9:27 AM
To: mailing list for ConTeXt users
Subject: Re: [NTG-context] escaping filenames with externalfigure
 
> Wolfgang,
>
>  Thanks for the suggestion.  However, I'm using ConTeXt to typeset arbitrary
> XML input from users (and therefore arbitrary image filenames).  While your
> idea works for the two examples that I gave, it doesn't work if the curly
> braces aren't balanced in the filename (e.g., "flower{1.jpg").  Is there any
> general character escaping mechanism for macro arguments?
>
>  Cheers,
>  Mike

If you use xml as input format you could save the file name in a temporary
macro and use this macro now in the \externalfigure command. You already
gave a example for this.

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
___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 2406 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: escaping filenames with externalfigure
  2007-12-27 15:58       ` Santy, Michael
@ 2007-12-28 23:19         ` Hans Hagen
  2008-01-03 13:35           ` Santy, Michael
  0 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2007-12-28 23:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Santy, Michael wrote:
> The problem that I've found with that approach is that the braces have to be balanced.
> 
> \def\myimagefilename{flower{1.jpg} % doesn't work
> \def\myimagefilename{flower{1}.jpg} % works

no time for a detailed answer now, but in xml mode you can make { } 
letters which solves the problem

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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: escaping filenames with externalfigure
  2007-12-28 23:19         ` Hans Hagen
@ 2008-01-03 13:35           ` Santy, Michael
  0 siblings, 0 replies; 12+ messages in thread
From: Santy, Michael @ 2008-01-03 13:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users, mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 876 bytes --]

Hans,

> no time for a detailed answer now, but in xml mode you can make { } 
> letters which solves the problem

Could you please elaborate a bit?  I'm not familiar with ConTeXt's XML mode (other than for processing MathML).  One thing that I suspect is that XML mode would have an issue with '<' and '>' in the filenames.

Another thought: The image filenames are encoded in my original xml documents according to RFC 1738 (http://www.blooberry.com/indexdot/html/topics/urlencoding.htm).  In my XML -> ConTeXt XSL stylesheets I'm decoding those filenames.  Would it be useful for others if the externalfigure could understand url encoded filenames similar to something like this:

%
% includes the file "flower{1.jpg"
%
\externalfigure[flower%7B1.jpg][encoding=rfc1738]

This would give ConTeXt a general-purpose filename escaping mechanism.

Cheers,
Mike

[-- Attachment #1.2: Type: text/html, Size: 1461 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-01-03 13:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-27 14:09 escaping filenames with externalfigure Santy, Michael
2007-12-27 14:55 ` Hans Hagen
2007-12-27 15:02   ` Santy, Michael
2007-12-27 14:56 ` Hans Hagen
2007-12-27 15:05   ` Santy, Michael
2007-12-27 15:09   ` Wolfgang Schuster
2007-12-27 15:00 ` Wolfgang Schuster
2007-12-27 15:16   ` Santy, Michael
2007-12-27 15:27     ` Wolfgang Schuster
2007-12-27 15:58       ` Santy, Michael
2007-12-28 23:19         ` Hans Hagen
2008-01-03 13:35           ` Santy, Michael

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).