Hi,

I'm new to ConTeXt and decided to teach myself a bit by resetting my 
old thesis (originally done, many years ago, in LaTeX).  As the purpose 
is to teach myself ConTeXt rather than just have an electronic version 
of the thesis I decided to try to do things the "right" way.

So, in setting the title page I followed the pattern shown on 
Contextgarden here: http://wiki.contextgarden.net/Document_Titles.  
That page shows how to define a nice \placetitle command with an 
associated \setuptitle which allows us to define values for title, 
subject, and date.  However, I want also to be able to define values 
for degree, subject, and committee (to follow the school-standard LaTeX 
style file I had from all those years ago).  I can't work out how to do 
this.

Simply using a variable like \c!degree (to match the \c!title I found 
in the example) doesn't work, as ConTeXt doesn't know about such a 
control sequence.  I was quite puzzled for a while but then it dawned 
on me that the example I found on contextgarden works because the keys 
it uses (for key/value pairs) are ones that are already defined in the 
ConTeXt system: title, subject, date.  My attempt fails because the 
system doesn't know about degree, subject, and committee.

I tried defining a new variable with startvariables, but that didn't 
appear to help.

So, my question: what do I need to do to define a new key that can be 
used in a key/value pair?


Here's an example of what I tried:


\startvariables all
   degree: degree
\stopvariables

\definesystemvariable{tp}  % title page

\def\setuptitlepage{\dodoubleempty\dosetuptitlepage}

\def\dosetuptitlepage[#1][#2]%
   {\ifsecondargument
      \dodosetuptitlepage[#1][#2]%
    \else
      \dodosetuptitlepage[\v!content][#1]%
    \fi}

\def\dodosetuptitlepage[#1][#2]%
   {\def\dododosetuptitlepage##1%
      {\getparameters[\??tp##1][#2]}%
    \processcommalist[#1]\dododosetuptitlepage}

\def\placetitlepage
   {\startalignment[\v!middle]
     \doattributes{\??tp\c!degree}\c!style\c!color\@@tpcontentdegree
     \stopalignment}

\setuptitlepage
   [\c!degree]
   [\c!style=\tfa,\c!color=]

\startfrontmatter
\placetitlepage
\stopfrontmatter

\starttext
\stoptext


Cheers,
Rory

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to