ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Exams
@ 2010-02-22 17:24 Roger Mason
  2010-02-22 17:36 ` Exams Aditya Mahajan
  0 siblings, 1 reply; 3+ messages in thread
From: Roger Mason @ 2010-02-22 17:24 UTC (permalink / raw)
  To: ntg-context

Hello,

Sorry, I sent this message to the list without a subject earlier today.

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:

\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

\def\exam[#1]
  {\getrawparameters
    [Exam]
    [     title=
         course=,
           date=,
          start=,
           stop=,
              #1]
  \title{\Examtitle}}

\definefont [BigFontOne]  [RegularSlanted sa 2.5]
\definefont [BigFontTwo]  [Regular sa 1.5]

\setuphead[title]
 [  style=\BigFontOne,
  command=\examtitle,
   before={},
    after={\blank[big] \bgroup \colortwo
     Date: \expanded{\date[Examdate]}
    \hfill
    Start: \expanded{Examstart}
    Stop: \expanded{Examstop}
   \egroup\blank},
 ]

%D This macro does the actual typesetting of the title
\def\examtitle#1#2%
  {\framed[
              width=broad,
              frame=off,
              align=middle,
    foregroundcolor=colortwo,
         % I want a shadow around the title frame
         background=shadow]
      {#2\\{Examcourse}}}

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

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'

Thanks for any help,
Roger
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: Exams
  2010-02-22 17:24 Exams Roger Mason
@ 2010-02-22 17:36 ` Aditya Mahajan
  2010-02-22 20:31   ` Exams Roger Mason
  0 siblings, 1 reply; 3+ messages in thread
From: Aditya Mahajan @ 2010-02-22 17:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 22 Feb 2010, Roger Mason wrote:

> Hello,
>
> Sorry, I sent this message to the list without a subject earlier today.
>
> 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:
>
> \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
>
> \def\exam[#1]
>  {\getrawparameters
>    [Exam]
>    [     title=
>         course=,
>           date=,
>          start=,
>           stop=,
>              #1]
>  \title{\Examtitle}}
>
> \definefont [BigFontOne]  [RegularSlanted sa 2.5]
> \definefont [BigFontTwo]  [Regular sa 1.5]
>
> \setuphead[title]
> [  style=\BigFontOne,
>  command=\examtitle,
>   before={},
>    after={\blank[big] \bgroup \colortwo
>     Date: \expanded{\date[Examdate]}
                             ^^^^^^^^

This should be \Examdate

>    \hfill
>    Start: \expanded{Examstart}

No need for \expanded here. Just \Examstart is enough

>    Stop: \expanded{Examstop}

\Examstop

>   \egroup\blank},
> ]
>
> %D This macro does the actual typesetting of the title
> \def\examtitle#1#2%
>  {\framed[
>              width=broad,
>              frame=off,
>              align=middle,
>    foregroundcolor=colortwo,
>         % I want a shadow around the title frame
>         background=shadow]
>      {#2\\{Examcourse}}}

Again, \Examcourse

>
> \exam[
>  title=Mid-term 2010,
>  course=ES2917,
>  date={d=17,m=2,y=2010},
>  start={9:00 am},
>  stop={11:00 am}
> ]
>
> 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 need to use \Exam... to access the values.

Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: Exams
  2010-02-22 17:36 ` Exams Aditya Mahajan
@ 2010-02-22 20:31   ` Roger Mason
  0 siblings, 0 replies; 3+ messages in thread
From: Roger Mason @ 2010-02-22 20:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Aditya Mahajan <adityam@umich.edu> writes:

> You need to use \Exam... to access the values.

Again, many thanks.

Roger
___________________________________________________________________________________
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
___________________________________________________________________________________


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

end of thread, other threads:[~2010-02-22 20:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-22 17:24 Exams Roger Mason
2010-02-22 17:36 ` Exams Aditya Mahajan
2010-02-22 20:31   ` Exams Roger Mason

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