ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Header problem in project
@ 2007-01-08  5:32 David Arnold
  2007-01-08 19:04 ` Taco Hoekwater
  0 siblings, 1 reply; 3+ messages in thread
From: David Arnold @ 2007-01-08  5:32 UTC (permalink / raw)


Hans et all,

We have a project call book.tex, a product in that called  
chapter1.tex, and a component in that called section1exercises.tex.

We have blocks that we save and then place at the end of  
section1exercises.tex with a macro defined in our environment file:

\def\placeanswers{%
   \bgroup
   \doifmodeelse{short}
   {
      \keepblocks[shortsubanswer,longsubanswer]
       \answers{Answers}\vskip 1em\startcolumnset[answers]
       \selectblocks[shortanswer][criterium=section]
       \stopcolumnset
   }
   {
   	  \def\headermarkleft{{\sc Chapter \headnumber[chapter]}}
   	  \def\headermarkright{{\sc{}Section \headnumber[section]}}
   	  \setupheadertexts[][\headermarkright][\headermarkleft][]
       \keepblocks[shortsubanswer,longsubanswer]
       \answers{Solutions}\vskip 1em
       \selectblocks[longanswer][criterium=section]
   }
   \egroup
}

The else part of the do above is an attempt to define a different  
header when we compile with --mode=long, but just for the pages on  
which we use \placeanswers. The other pages have a different header  
defined in the environment file. Those headers have page numbers as  
well with:

\def\headermarkleft{\bold{\pagenumber}\headerskip{\sc\headerskip  
Chapter \headnumber[chapter]\headerskip\getmarking[chapter][current]}}

\def\headermarkright{{\sc{}Section \headnumber[section]\headerskip 
\getmarking[section][current]}\headerskip\bold{\pagenumber}}


The file section1exercises ends like this:

%%% ENDTESTBANK
%%%================================================
\stopquestions

\placeanswers\kern0pt

\stopcomponent

When we compile section1exercises.tex with texmfstart texexec -- 
mode=long section1exercises, all is well until the last page, where  
the former header is used instead of the header defined in the  
\placeanswers macro. But we want to finish out the document from the  
point we put the \placeanswers with the second header.

Any suggestions?

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

* Re: Header problem in project
  2007-01-08  5:32 Header problem in project David Arnold
@ 2007-01-08 19:04 ` Taco Hoekwater
  2007-01-08 20:30   ` David Arnold
  0 siblings, 1 reply; 3+ messages in thread
From: Taco Hoekwater @ 2007-01-08 19:04 UTC (permalink / raw)


David Arnold wrote:
> 
> \placeanswers\kern0pt
> 
> \stopcomponent
> 
> When we compile section1exercises.tex with texmfstart texexec -- 
> mode=long section1exercises, all is well until the last page, where  
> the former header is used instead of the header defined in the  
> \placeanswers macro. But we want to finish out the document from the  
> point we put the \placeanswers with the second header.
> 
> Any suggestions?

Does ending with \placeanswers\page help?

Taco

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

* Re: Header problem in project
  2007-01-08 19:04 ` Taco Hoekwater
@ 2007-01-08 20:30   ` David Arnold
  0 siblings, 0 replies; 3+ messages in thread
From: David Arnold @ 2007-01-08 20:30 UTC (permalink / raw)


Taco et all,

 From what I could deduce, our former macro for placeanswers was a  
group.

\def\placeanswers{
   \bgroup
   \doifmodeelse{short}
   {
      \keepblocks[shortsubanswer,longsubanswer]
       \answers{Answers}\vskip 1em\startcolumnset[answers]
       \selectblocks[shortanswer][criterium=section]
       \stopcolumnset
   }
   {
       \keepblocks[shortsubanswer,longsubanswer]
       \answers{Solutions}\vskip 1em
       \selectblocks[longanswer][criterium=section]
   }
   \egroup
}

It occurred at the end of an exercise set like this:

%%% ENDTESTBANK
%%%================================================
\stopquestions

\placeanswers\kern0pt

\stopcomponent

So when the group was finished, the header for the component took  
over. Here is the fix I found. I just set new headers for the rest of  
the way.

\def\placeanswers{\doifmode{long}{%
	\page[yes]
   	  \def\headermarkleft{{\sc Chapter \headnumber[chapter]}}
   	  \def\headermarkright{{\sc{}Section \headnumber[section]}}
   	  \setupheadertexts[][\headermarkright][\headermarkleft][]}
   \bgroup
   \doifmodeelse{short}
   {
      \keepblocks[shortsubanswer,longsubanswer]
       \answers{Answers}\vskip 1em\startcolumnset[answers]
       \selectblocks[shortanswer][criterium=section]
       \stopcolumnset
   }
   {
       \keepblocks[shortsubanswer,longsubanswer]
       \answers{Solutions}\vskip 1em
       \selectblocks[longanswer][criterium=section]
   }
   \egroup
}

So now when we compile with:

texmfstart texexec --mode=long,paging section1exercise

We get what we want, which is no page numbers in the headers once the  
solutions start. You can see the result at:

http://msenux.redwoods.edu/IntAlgText2/chapter2/section1solutions.pdf

We have a paging mode and a perl script that syncs the page numbers  
at the beginning of this document with the chapter page numbers.

Thanks.



On Jan 8, 2007, at 11:04 AM, Taco Hoekwater wrote:

> David Arnold wrote:
>>
>> \placeanswers\kern0pt
>>
>> \stopcomponent
>>
>> When we compile section1exercises.tex with texmfstart texexec --
>> mode=long section1exercises, all is well until the last page, where
>> the former header is used instead of the header defined in the
>> \placeanswers macro. But we want to finish out the document from the
>> point we put the \placeanswers with the second header.
>>
>> Any suggestions?
>
> Does ending with \placeanswers\page help?
>
> Taco
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

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

end of thread, other threads:[~2007-01-08 20:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-08  5:32 Header problem in project David Arnold
2007-01-08 19:04 ` Taco Hoekwater
2007-01-08 20:30   ` David Arnold

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