ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Document title (was: (no subject))
Date: Sat, 10 Sep 2011 17:39:04 +0200	[thread overview]
Message-ID: <B18089F2-6D7E-46AC-8D15-675D576D37E5@googlemail.com> (raw)
In-Reply-To: <y65tyt98i08.fsf@perthite.esd.mun.ca>


Am 22.02.2010 um 15:25 schrieb Roger Mason:

> Hello,
> 
> I'm working on a project to set up exams, basing the work on Aditya's
> asignment class that was published in Practex in 2006.
> 
> I have a problem getting title information printed correctly.  This is a
> cut-down version:
> 
> […]
> 
> I'm processing this with Mark II.  The problems are that
> 
> (1) The literal 'Examcourse' is typeset;
> (2) Today's date is typset, not the one entered in the interface;
> (3) The start and stop times are typeset as literals 'Examstart' & 'Examstop'

You forgot the backslash in front of your values.

It’s also bad style to misuse the \title command for your document title
because \title is only the unnumbered version of \chapter, nothing else.

Another way to create your document title is the following code:

\setupcolors  [state=start]

\definecolor  [colorone]    [r=0.625,g=0,b=0] %dark red
\definecolor  [colortwo]    [b=0.625,g=0,r=0] %dark blue

\startsetups examtitle

    \startframedtext
        [
            width=broad,
            frame=off,
            align=middle,
            foregroundcolor=colortwo,
            background=shadow,
        ]

        {\definedfont[RegularSlanted sa 2.5]\getvariable{exam}{title}}
        \blank
        \getvariable{exam}{course}

    \stopframedtext

    \blank[big]

    \startcolor[colortwo]

        \doifelsevariable{exam}{date}{\expanded{\date[\getvariable{exam}{date}]}}{\currentdate}
        \hfill
        Start: \getvariable{exam}{start}
        \space
        Stop: \getvariable{exam}{stop}

    \stopcolor

    \blank

\stopsetups

\setvariables[exam][set={\setups[examtitle]}]

\starttext

\setvariables
  [exam]
  [ title=Mid-term 2010,
   course=ES2917,
     date={d=17,m=2,y=2010},
    start={9:00 am},
     stop={11:00 am}]

\stoptext

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

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


  reply	other threads:[~2011-09-10 15:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-22 14:25 (no subject) Roger Mason
2011-09-10 15:39 ` Wolfgang Schuster [this message]
2011-09-10 16:20   ` Document title (was: (no subject)) Aditya Mahajan
2011-09-11  9:05     ` Wolfgang Schuster
2011-09-11 14:49       ` Aditya Mahajan
2011-09-11 16:21         ` Wolfgang Schuster
2011-09-11 23:20           ` Aditya Mahajan
2011-09-12 15:06             ` Wolfgang Schuster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B18089F2-6D7E-46AC-8D15-675D576D37E5@googlemail.com \
    --to=schuster.wolfgang@googlemail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).