On Sunday 03 October 2010 12:44:05 Julien Rioux wrote:
> On 03/10/2010 4:57 AM, Steve Litt wrote:
> > U D Man Julien!!!
> 
> Well, to be fair the main hint of using afterpage came from Paul.
> 
> > \gdef didn't work, but \xdef sure did. I replaced this:
> >
> > \afterpage{\renewcommand{\plotdatehdr}[0]{\plotdateondeck}}
> >
> > With this:
> >
> > \afterpage{\xdef\plotdatehdr{\plotdateondeck}}
> >
> > And bang! It does what it's supposed to. I set \plotdatehdr with the
> > chapter date charstyle, and that determines the header date of the first
> > page of the chapter. After that, the header date is the last value input
> > with the body date charstyle before the current page. That's exactly what
> > I wanted.
> 
> \gdef worked for me, but I also had just one variable \currentdate which
> you either set directly by \def\currentdate{Oct. 3} or set indirectly,
> after the page, with \setdate{Oct. 4}.
> 
> > I'm still not quite sure it works right so I won't yet put<SOLVED>  in
> > the subject. I need to investigate this more thoroughly tomorrow. I also
> > need to find out exactly what \xdef does that \gdef and \def and
> > \renewcommand don't do, but there's time for that tomorrow.
> 
> \gdef and \xdef are global, the others \def and \newcommand family are
> constrained to the current scope {}.
> 
> The difference between \gdef and \xdef is that \xdef will extend any
> macro at the time of definition, and \gdef does not. So in your case:

Isn't it kind of like \gdef assigns by reference, and \xdef assigns by value? 
I think that follows from what you said and vice versa.

By the way, there's an \edef that's like \xdef without the globality. \edef 
didn't work -- it acted just like \def.

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt

Reply via email to