ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Using variables in relation to the TOC
@ 2003-02-05  9:49 Willi Egger
  2003-02-05 18:20 ` Patrick Gundlach
  2003-02-08 16:39 ` Hans Hagen
  0 siblings, 2 replies; 5+ messages in thread
From: Willi Egger @ 2003-02-05  9:49 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 896 bytes --]

Hi all,

While developing a manual I encounter the following problem.

Each document of the manual carries a header, where a version number is
placed. In this case the version number is a date.
The manual table of contents requires, that the name of the document
(chapter name) is placed followed by the version number which Ii mentioned
above.

I spent some hours to try to tweak things to get the desired result. -
Unfortunately unsuccesfully. May be that I want to achieve something which
is impossible due to the way TeX is generating the table of contents. - If
you compile hte attached file you get a table of contents which looks in
first instance as it is required. The 'only' problem is, that all documents
get the version number defined in the setuparea (Compare the presentation of
the version number to the versionnumbers as they appear in the header)

Any suggestions?

Thanks Willi

[-- Attachment #2: header.tex --]
[-- Type: application/octet-stream, Size: 1498 bytes --]

% header setup

\setupoutput[pdftex]
\setupinteraction[state=start]
\setupbodyfont[ss,10pt]

\setuplayout
   [header=6\bodyfontsize,
    headerdistance=\bodyfontsize,
    topspace=0.75cm]

\setuppagenumbering[location=,way=bychapter]
\setupsubpagenumber[state=start,way=bychapter]

\definehead[Mychapter][chapter]
\definecombinedlist[Mycontent][part,Mychapter]
\setuplist[Mychapter][pagenumber=no,maxwidth=\textwidth,margin=1cm]

\define[1]\SetUpHeaderText{%
   \setupheadertexts[][%
   {\hbox
      {\switchtobodyfont[small]%
      {\bTABLE
         \setupTABLE[x][1][frame=on,width=.5\textwidth]
         \setupTABLE[x][2][frame=on,width=.35\textwidth]
         \bTR
            \bTD Document: \hfill\headnumber[part]~\getmarking[part][last] \eTD
            \bTD Version: \hfill{#1}  \eTD\eTR
       \eTABLE}}}]}


\ifx\Version\undefined\def\Version{\currentdate[day,-,month,-,year]}\fi


\starttext
%\showframe

\completeMycontent

\part{General}

\chapter{Introduction}
\def\Version{03-02-2003}
\SetUpHeaderText{\Version}
\writetolist[Mychapter]{Introduction}{\hfill \Version}

\subject{Idea}
\input tufte

\chapter{Troubleshooting}
\def\Version{12-12-2002}
\SetUpHeaderText{\Version}
\writetolist[Mychapter]{Troubleshooting}{\hfill \Version}

\subject{Introduction}
\input tufte

\part{Organisation}
\chapter{Diagrams}
\SetUpHeaderText{05-02-2003}

\subject{Holding}
\input tufte

\subject{Local site}
\input tufte
\stoptext

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

* Re: Using variables in relation to the TOC
  2003-02-05  9:49 Using variables in relation to the TOC Willi Egger
@ 2003-02-05 18:20 ` Patrick Gundlach
  2003-02-05 19:09   ` Willi Egger
  2003-02-08 16:39 ` Hans Hagen
  1 sibling, 1 reply; 5+ messages in thread
From: Patrick Gundlach @ 2003-02-05 18:20 UTC (permalink / raw)


"Willi Egger" <w.egger@boede.nl> writes:

Hello Willi,

> I spent some hours to try to tweak things to get the desired result. -

have you tried 

\expanded{\writetolist[Mychapter]{Troubleshooting}{\hfill \Version}}


Patrick

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

* Re: Re: Using variables in relation to the TOC
  2003-02-05 18:20 ` Patrick Gundlach
@ 2003-02-05 19:09   ` Willi Egger
  0 siblings, 0 replies; 5+ messages in thread
From: Willi Egger @ 2003-02-05 19:09 UTC (permalink / raw)


Hi Patrick,

Thanks a lot for your perfect answer. - It works as I had it in mind!
Indeed I tried to place \expanded but never put it in front of the whole as
you did. - Gosh when am I going to understand TeX?? - Oh no, its no reason
to stop loving and using it! :-)

> \expanded{\writetolist[Mychapter]{Troubleshooting}{\hfill \Version}}

Willi

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

* Re: Using variables in relation to the TOC
  2003-02-05  9:49 Using variables in relation to the TOC Willi Egger
  2003-02-05 18:20 ` Patrick Gundlach
@ 2003-02-08 16:39 ` Hans Hagen
  2003-02-08 20:36   ` Willi Egger
  1 sibling, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2003-02-08 16:39 UTC (permalink / raw)


At 10:49 AM 2/5/2003 +0100, Willi Egger wrote:
>Hi all,
>
>While developing a manual I encounter the following problem.
>
>Each document of the manual carries a header, where a version number is
>placed. In this case the version number is a date.
>The manual table of contents requires, that the name of the document
>(chapter name) is placed followed by the version number which Ii mentioned
>above.
>
>I spent some hours to try to tweak things to get the desired result. -

here is a 10 second solution:

   \setuplist[Mychapter][expansion=yes]  % yes|command|no

% or \expanded{...} ...

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

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

* Re: Using variables in relation to the TOC
  2003-02-08 16:39 ` Hans Hagen
@ 2003-02-08 20:36   ` Willi Egger
  0 siblings, 0 replies; 5+ messages in thread
From: Willi Egger @ 2003-02-08 20:36 UTC (permalink / raw)


> here is a 10 second solution:
> 
>    \setuplist[Mychapter][expansion=yes]  % yes|command|no
> 
> % or \expanded{...} ...
> 

Thanks! - I see, the gap is enormous! :-)

Willi

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

end of thread, other threads:[~2003-02-08 20:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-05  9:49 Using variables in relation to the TOC Willi Egger
2003-02-05 18:20 ` Patrick Gundlach
2003-02-05 19:09   ` Willi Egger
2003-02-08 16:39 ` Hans Hagen
2003-02-08 20:36   ` Willi Egger

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