From: Jeong Dal <haksan@me.com>
To: "list ntg-context@ntg.nl ntg-context@ntg.nl ntg-context@ntg.nl
ntg-context@ntg.nl" <ntg-context@ntg.nl>
Subject: How to put title and counter of the enumeration env. in the FrameTitle?
Date: Fri, 04 Dec 2015 07:44:12 +0900 [thread overview]
Message-ID: <725AA16C-FD17-4307-A111-271C014BBDBE@me.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 2365 bytes --]
Hi,
I use the FunnyFrame and FrameTitle in the metafun book to display theorems.
Thanks ConTeXt and MetaFun, it looks nice!
For better output, I try to put “Theorem + number” in the FrameTitle instead of putting in the main text. But I couldn’t make it.
I found a similar question and answers by Hans in the list (2015. 8.6-7) under the title
“Some questions about an environment (Metafun)”
It works fine but I want to put number too. I think that I want to much.
Thanks for reading.
Best regards,
Dalyoung
I am using the following code.
%%%%%%%%%%%%
\defineenumeration[Theorem]
[%text=Theorem ,
style=,
% title=yes,
prefix=yes,
prefixsegments=chapter,
way=bychapter,
number=yes,
before={\blank[big]},
after=\blank]
\defineenumeration[Definition]
[text=Definition,
style=,
% title=yes,
prefix=yes,
prefixsegments=chapter,
way=bychapter,
number=yes,
before={\blank[big]},
after=\blank]
\startuseMPgraphic{FunnyFrame}
picture p ; numeric o ; path a, b ; pair c ;
p := textext.rt(\MPstring{FunnyFrame}) ;
o := BodyFontSize ;
a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
p := p shifted (2o,OverlayHeight-ypart center p) ;
drawoptions (withpen pencircle scaled 1pt withcolor .625red) ;
b := a superellipsed .95 ;
%fill b withcolor .85white ;
draw b ;
b := (boundingbox p) superellipsed .95 ;
fill b withcolor .425green;%.85white ;
draw b ;
draw p withcolor black ;
setbounds currentpicture to a ;
\stopuseMPgraphic
\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext[FunnyText][frame=off,background=FunnyFrame, offset=\bodyfontsize, width=\textwidth]%\overlaywidth]%
\def\StTheorem{\startFunnyText\startTheorem}
\def\SpTheorem {\stopTheorem\stopFunnyText }
\def\FrameTitle#1%
{\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut\ss\bf\white #1\hss}}}
\starttext
This is a test for Framed Theorem.
\StTheorem
This is a theorem in the Funny Frame.
\SpTheorem
I'd like to put \quote{Theorem \#1(Some Title)} in a small frame and the main text in the big frame.
\blank[big]
{\FrameTitle{Theorem 2(Title of Theorem)}
\StTheorem
I want to show the main text without \quote{Theorem 2} in this frame.
\SpTheorem
\stoptext
%%%%%%%%%%%%%%%%%%
[-- Attachment #1.2: Type: text/html, Size: 5601 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
next reply other threads:[~2015-12-03 22:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-03 22:44 Jeong Dal [this message]
[not found] <mailman.187.1449199309.31294.ntg-context@ntg.nl>
2015-12-05 0:14 ` Jeong Dal
2015-12-08 13:45 Jeong Dal
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=725AA16C-FD17-4307-A111-271C014BBDBE@me.com \
--to=haksan@me.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).