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

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