ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Makeup on same page as main content
@ 2022-03-05 23:47 mastermind_ x via ntg-context
  2022-03-06  5:28 ` śrīrāma via ntg-context
  0 siblings, 1 reply; 2+ messages in thread
From: mastermind_ x via ntg-context @ 2022-03-05 23:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: mastermind_ x

Hi all,

I would like to create a makeup environment that will contain author, university logo and date and other information that doesn’t occupy its own page that I can define in an environment file and reuse. 

The logo and date should occupy the margins at the top at the left and right respectively. Then there will be course information on the left and a framed assignment box on the right (as it will have special fonts). Much like the title of a latex article class. It should look something like this:

[logo]                         [date]
---------------------------------------------
[course]: [Code]         [assignment]
[name]                       [                   ]
[class]                        [         1        ]
----------------------------------------------

body

Any pointers on how I can achieve this?

Jethro
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Makeup on same page as main content
  2022-03-05 23:47 Makeup on same page as main content mastermind_ x via ntg-context
@ 2022-03-06  5:28 ` śrīrāma via ntg-context
  0 siblings, 0 replies; 2+ messages in thread
From: śrīrāma via ntg-context @ 2022-03-06  5:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: śrīrāma

On Sunday, March 6, 2022 5:17 AM mastermind_ x via ntg-context wrote:
> Any pointers on how I can achieve this?

You don't have a MWE, so based on my understanding of your illustration, I have the following:

%%% SOF
  % required for 'cow'
  \setupexternalfigures[location={local,default}]

  \setvariables
    [assignments]
    [set={\setups[assignments:set]}]

  \startsetups assignments:set
  \writestatus{variables}{assignments:set is being called..}
  \startalignment[middle]
  \bTABLE[frame=off]
  \setupTABLE[c][1][align=flushleft,style=bold,distance=2cm]
  \setupTABLE[c][2][align={flushright,lohi}]
  \bTR
    \bTD \externalfigure[cow][height=2cm] \eTD
    \bTD \doiftextelse{\getvariable{assignments}{date}}{\getvariable{assignments}{date}}{\date} \eTD
  \eTR
  \bTR
    \bTD Course: \getvariable{assignments}{code} \eTD
    \bTD \getvariable{assignments}{assignment} \eTD
  \eTR
  \bTR
    \bTD Name \eTD
    \bTD \getvariable{assignments}{name} \eTD
  \eTR
  \bTR
    \bTD Class \eTD
    \bTD \getvariable{assignments}{class} \eTD
  \eTR
  \eTABLE
  \stopalignment
  \stopsetups

  \starttext
  \setvariables
    [assignments]
    [code={AB1234},
    date={January 1, 2038},
    assignment={whatever},
    name={the name},
    class={1970}]
  \input tufte

  \page
  \setvariables
    [assignments]
    [code={AB1234},
    date=,
    assignment={whatever},
    name={the name},
    class={2038}]
  \input knuth
  \stoptext
%%% EOF

Essentially, variables in ConTeXt has a nice set key which can be made to trigger anything when the variables are set. So you can give it a setup to do whatever you want by just saying 
\setvariables[assignments][...]
wherever in the document you desire. See here for an example [there is also a 'reset' key]:
	https://wiki.contextgarden.net/Setups

[Since you said 'framed assignment box' you can enable the frames of the cell you want, and change formatting as needed]

Sreeram


___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2022-03-06  5:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-05 23:47 Makeup on same page as main content mastermind_ x via ntg-context
2022-03-06  5:28 ` śrīrāma via ntg-context

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