ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Delayed expansion of macro?
@ 2009-06-26 13:30 Gerben Wierda
  2009-06-26 14:11 ` Gerben Wierda
  0 siblings, 1 reply; 2+ messages in thread
From: Gerben Wierda @ 2009-06-26 13:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I need to use a macro like this:

\def\typeSQLfile#1{%
\startsetups header:margin
  \framed
    [frame=off,
     orientation=90,
     width=2\leftmarginwidth,
     height=\textheight,
     align={top,middle}]
    {#1\hfil\pagenumber\hfil\IfSQprojectname}
\stopsetups
\typefile[SQL]{#1}}

In the following setting:

\starttext
\typeSQLfile{Library-procedures/details.pls}
\typeSQLfile{Library-procedures/hlx$requery.pls}
\stoptext

This results in two problems;
1. The pagenumber is the same on each page for a file
2. The file name with the $ in it crashes the typefile argument (file  
not found), where \typefile itself handles the name OK.

How do I solve these? In LaTeX I would probably use \protect on  
\pagenumber.

G
___________________________________________________________________________________
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] 2+ messages in thread

* Re: Delayed expansion of macro?
  2009-06-26 13:30 Delayed expansion of macro? Gerben Wierda
@ 2009-06-26 14:11 ` Gerben Wierda
  0 siblings, 0 replies; 2+ messages in thread
From: Gerben Wierda @ 2009-06-26 14:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 26 Jun 2009, at 15:30, Gerben Wierda wrote:

> I need to use a macro like this:
>
> \def\typeSQLfile#1{%
> \startsetups header:margin
> \framed
>   [frame=off,
>    orientation=90,
>    width=2\leftmarginwidth,
>    height=\textheight,
>    align={top,middle}]
>   {#1\hfil\pagenumber\hfil\IfSQprojectname}
> \stopsetups
> \typefile[SQL]{#1}}
>
> In the following setting:
>
> \starttext
> \typeSQLfile{Library-procedures/details.pls}
> \typeSQLfile{Library-procedures/hlx$requery.pls}
> \stoptext
>
> This results in two problems;
> 1. The pagenumber is the same on each page for a file
> 2. The file name with the $ in it crashes the typefile argument  
> (file not found), where \typefile itself handles the name OK.

Adding to this, it also crashes (not only file not found) the TeX job  
if there is a _ in the filename (missing $ inserted).

G
___________________________________________________________________________________
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] 2+ messages in thread

end of thread, other threads:[~2009-06-26 14:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-26 13:30 Delayed expansion of macro? Gerben Wierda
2009-06-26 14:11 ` Gerben Wierda

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).