On 02/10/2010 4:25 PM, Steve Litt wrote:
On Saturday 02 October 2010 14:55:14 Steve Litt wrote:
On Saturday 02 October 2010 11:54:46 Paul A. Rubin wrote:
On 10/2/2010 11:16 AM, Steve Litt wrote:
What happens if you load the afterpage package and put the macro
inside \afterpage{}? Hopefully that would say the new value goes into
effect after the current page is emitted, which (hopefully) would cause
the value at entry to print on the current page.
Hi Paul,
\afterpage, if it's what it looks like, is the key to simplifying this
daunting task, but it's not as simple as just putting my one macro in an
\afterpage{} for one specific reason: I need the ability upon the start of
a chapter to specify the start date for that chapter. I DO NOT want to
specify it at the end of the preceding chapter -- chapters can always get
moved around.
So the way I envision this thing, I have a 2 variable queue. Varh is what's
in the header, and vart holds the latest value from the text. My chapter
begin macro sets Varh directly and overwrites whatever was in it. My
midchapter macro sets vart, overwriting whatever was in it. Now comes the
magic of of \afterpage:
\afterpage{\let\varh\vart}
So if the brand new page is not a chapter beginning, the header value is
the final value of the previous page. Same is true if it IS a chapter
beginning, but that value of varh promptly gets overwritten by the chapter
begin macro.
You're a genius. No ifandelse required. Minimal break logic. All because of
\afterpage{}. I'll let you know if it works.
Ugh! Afterpage appears not to work for reasons unknown. I did this:
\newcommand{\plotdatebodyL}[1]{%
\renewcommand\plotdateondeck[0]{#1}%
\afterpage{\renewcommand{\plotdatehdr}[0]{\plotdateondeck}{}
{zzzzzzzzzzzzzzzzzzzz}}
{XXXXXXX XXXXX}
% \renewcommand{\plotdatehdr}[0]{\plotdateondeck}
}%
The \renewcommand inside the afterpage doesn't work. \afterpage is firing
because I get the row of z's on the next page. The \renewcommand within the
\afterpage either isn't working, or is somehow getting overwritten, because I
keep getting the same value in the header. Note however that when I uncomment
the \renewcommand outside of the \afterpage, the header changes according to
calls to \plotdatebodyL, in which case it's just like the original -- e.g. the
header lists the last value on the page, not the first.
So why isn't the \renewcommand inside the \afterpage working or why is it
getting overwritten? By the way, \let\plotdatehdr\plotdateondeck did exactly
the same thing.
This thing is so close I can taste it, but there's something I'm not seeing.
Thanks
SteveT
Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt
Does this work?
\def\currentdate{}
\newcommand{\setdate}[1]{%
The date is now: #1%
\afterpage{\gdef\currentdate{#1}}
}
\rhead{\currentdate}
--
Julien