ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* enumeration, framedtext and funny...
@ 2006-11-22 23:15 Marcel Takac
  0 siblings, 0 replies; only message in thread
From: Marcel Takac @ 2006-11-22 23:15 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 709 bytes --]

Hi,
I'm trying to make my document in ConTeXt and in I have some problem.
Problem is in my environment for theorems. Every theorem has name and
number.

I had defined "enumeration" for them. Theorem-text is typed in framedtext,
with backround. Theorem's title is defined by \setMPtext, and is typed
in MPgraphic (\MPstring).

I want to type also theorem's number (Theorem 1, ...) instead of "Here",
but there is a problem: \MPstring{TheoremCaption} is empty.

Where I'm making mistake?

Zrejme robim niekde nejaku elementarnu chybu. Vychadzal som z prikladu v MetaFun 
Manuale, ktory som si upravoval. Mozem poprosit o nakopnutie? Je dost mozne, ze 
sa uberam uplne zlym smerom?

Thanks for your help,
Marcel

[-- Attachment #2: teor.tex --]
[-- Type: text/plain, Size: 2293 bytes --]

\setupoutput[pdf]
\setupcolors[state=start]
\setupinteraction[state=start]


\defineoverlay[TheoremFrame][\useMPgraphic{TheoremFrame}]
\defineframedtext[TheoremText][frame=off,background=TheoremFrame,width=\hsize]
\def\StartTeoFrame{\startTheoremText}
\def\StopTeoFrame {\stopTheoremText}

\def\FrameTheoremTitle#1{\setMPtext{TheoremFrame}{\hbox spread 1em{\hss\strut#1\hss}}}
\setMPtext{TheoremFrame}{}

\def\FrameTheoremCaption#1{\setMPtext{TheoremCaptionFrame}{\hbox spread 1em{\hss\strut#1\hss}}\useMPgraphic{TheoremCaption}}
\setMPtext{TheoremCaptionFrame}{}

\startuseMPgraphic{TheoremFrame}
 picture p, s; path a, b; pair c;
 p := textext.rt(\MPstring{TheoremFrame});
 a := unitsquare xyscaled(OverlayWidth, OverlayHeight);
 o := BodyFontSize ;
 p := p shifted (2o,OverlayHeight-ypart center p) ;
 drawoptions (withpen pencircle scaled 1pt withcolor .625red) ;
 b := a randomized (o/2) ;
 fill b withcolor .95white ; draw b ;
 c := center p;
 c := b intersectionpoint (c shifted (0,-o)--c shifted(0,o)) ;
 p := p shifted (c-center p) ;
 b := (boundingbox p) randomized (o/8) ;
 fill b withcolor .85white ; draw b ;
 draw p withcolor black;
 setbounds currentpicture to a ;
\stopuseMPgraphic


\startuseMPgraphic{TheoremCaption}
 picture p;
 p := textext.rt("Here");
% p := textext.rt(\MPstring{TheoremCaption});
 draw p rotated 90 withcolor blue;
 draw (5mm, 0)..(-2mm, 0mm) withcolor red;
\stopuseMPgraphic

\defineenumeration
 [Theorem]
 [location=right,
  headstyle=bold,
  text=Theorem ,
  command=\FrameTheoremCaption,
  location=inleft,
  before={\StartTeoFrame},
  after={\StopTeoFrame}]

\starttext

\FrameTheoremTitle{Immerman}
\startTheorem[3t9.4.00]
Theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem
theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem
theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem
theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem
theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem
\stopTheorem


\stoptext

[-- Attachment #3: teor.pdf --]
[-- Type: application/pdf, Size: 25878 bytes --]

[-- Attachment #4: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-11-22 23:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-22 23:15 enumeration, framedtext and funny Marcel Takac

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