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: Re: theorem environment
Date: Wed, 13 Jul 2011 15:11:58 +0200	[thread overview]
Message-ID: <793DC50B-3E68-4908-B936-E94D51293866@googlemail.com> (raw)
In-Reply-To: <4E1D29EE.4020309@googlemail.com>


Am 13.07.2011 um 07:15 schrieb Andreas Richter:

> Hello,
> 
> Using ConTeXt, I would like to define environments to appear
> like
> 
> ----------------------------------------------
> Theorem 1.4 (Pythagoras)
> In any right triangle, $c^2 = a^2 + b^2$ holds
> where ...
> ----------------------------------------------
> 
> and
> 
>  --- Example 1.1 -------------------
>  Let $a=2$ ...
>  -----------------------------------
> 
> and (e. g. small, slanted or whatever)
> 
> Remark 1.3
> ----------
>  | Euclidean ...
>  | ...
> .
> 
> After browsing the documentation on the web, focussing
> on \defineenummeration, I'm still nowhere near the solution.
> Could anyone please give examples of how to do this?

You can change the style, color and spacing with \setupenumerations
but for the rules etc. you need other commands.

\defineenumeration[theorem][text=Theorem,title=yes]
\defineenumeration[example][text=Example]
\defineenumeration[remark] [text=Remark]

\setupenumerations
  [theorem]
  [   before={\startframedtext[frame=off,topframe=on,bottomframe=on,width=broad,offset=.5ex]},
       after=\stopframedtext,
   inbetween={\blank[small]}]

\setupenumerations
  [example]
  [  command=\textrule,
       after=\textrule,
   inbetween={\blank[nowhite]}]

\setupenumerations
  [remark]
  [style=italic]

\starttext

\starttheorem{Pythagoras}
In any right triangle, $c^2 = a^2 + b^2$ holds where …
\stoptheorem

\startexample
Let $a=2$ ...
\stopexample

\startremark
Euclidean ...
\stopremark

\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-07-13 13:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-13  5:15 Andreas Richter
2011-07-13 13:11 ` Wolfgang Schuster [this message]
2011-07-24 22:59   ` theorem environment: Is *enumeration* or the `annotation` module recommended? Paul Menzel

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=793DC50B-3E68-4908-B936-E94D51293866@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).