From: Jeong Dal <haksan@me.com>
To: Hans Hagen <pragma@wxs.nl>
Cc: "list ntg-context@ntg.nl ntg-context@ntg.nl ntg-context@ntg.nl
ntg-context@ntg.nl" <ntg-context@ntg.nl>
Subject: Re: referencing the customized enumeration with framed title
Date: Sat, 13 Jan 2018 01:22:00 +0900 [thread overview]
Message-ID: <B93A9844-2C02-4185-81F1-2AD1CD6E379A@me.com> (raw)
In-Reply-To: <a3b31197-12d8-f69b-7b68-bcf451d01df3@wxs.nl>
Dear Hans,
Thank you for the quick answer.
Repalcing “p:=textext.rt();” and commenting out “headcommand=gobbleone…” with your suggestion, the references are working.
However, there is a side effect.
“Theorem 1.1” appears twice, one in the frame which I expected and one at the beginning of the framed text which I don’t want.
One more thing, is there no way to show the number of the Definition?
Thanks again.
Best regards,
Dalyoung
%%%%%%%%%%
\setupcolors[state=start]
\definecolor[dGreen] [r=0,g=.375,b=.0]
%%% define the background of Theorems:
\defineframed
[FunnyFramed]
[frame=off,
loffset=1ex,
roffset=1ex,
foregroundstyle=\ssbf]
\startuseMPgraphic{FunnyFrame}
picture p ; numeric o ; path a, b ; pair c ;
%%%%% p := textext.rt(“\FunnyFramed{\enumerationparameter{text} \convertedcounter[Theorem]}”) ;
p := textext.rt("\FunnyFramed{\currentconstructiontext}") ;
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 ;
draw b ;
b := (boundingbox p) superellipsed .95 ;
fill b withcolor .85white ;
draw b ;
draw p withcolor black ;
setbounds currentpicture to a ;
\stopuseMPgraphic
\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext
[FunnyText]
[frame=off,
background=FunnyFrame,
before={\blank[line,halfline]},
after={\blank[line]},
offset=\bodyfontsize,
width=\textwidth]
\defineenumeration[Theorem]
[title=no,
text={\translate[en=Theorem, kr=정리]},
prefix=yes,
prefixsegments=chapter,
way=bychapter,
alternative=command,
%%%%%% headcommand=\gobbleoneargument,
before=\startFunnyText,
after=\stopFunnyText]
%%%% Definition style
\definenumber[DefNumber][way=bychapter,sectionumber=yes]
\setuptextrules[rulecolor=dBlue]
\define\DefCommand{\incrementnumber[DefNumber]
\textrule[top]{\translate[en=Definition, kr=정 의] \getnumber[DefNumber]}
}
\defineenumeration[Definition]
[width=fit,
alternative=serried,
text={},
number=no,
before={\DefCommand},
after=\vskip3pt\hrule\blank]
%%% Examples with or without solutions
\defineenumeration[Exam]
[text={\white\translate[en=Example, kr=예제]},
numbercommand={\inframed[corner=round, framecolor=dYellow,toffset=-1pt,boffset=-1pt, loffset=1ex,roffset=1ex, background=color,backgroundcolor=dGreen]},
% title=no,
alternataive=hanging,
prefix=yes,
prefixsegments=chapter,
way=bychapter,
before={\blank[big]},
after=\blank]
\starttext
\chapter{Spaces}
\section{Space 1}
\startDefinition[def:first]
Let $X$ be a uncountable set. Let $\infty$ is a fixed point of $X$. Let $\mathcal T$ be the family of subsets $G$ such that either (i) $\infty \notin G$ or (ii) $\infty \in G \text{ and } G^c$ is finite. The space $(X, {\mathcal T} )$ is called {\bf Fort's space}.
\stopDefinition
\startTheorem[lem:first]
Fort's space is a compact and Hausdorff topological space.\par
\stopTheorem
\startTheorem[thm:second]
Fort's space is a compact and Hausdorff topological space.
\stopTheorem
\startExam[Ex:first]
Example Example Example Example Example Example Example Example Example
Example Example Example Example Example Example Example Example Example
Example Example Example Example Example Example Example Example Example
\stopExam
In this example, we defined \in{Definition}[def:first]. After that, we proved \in{Lemma}[lem:first] and \in{정리}[thm:second]. Finally, \in{Example}[Ex:first], we saw an example of it.
\stoptext
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2018-01-12 16:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.1.1515668401.1779.ntg-context@ntg.nl>
2018-01-12 2:54 ` Jeong Dal
2018-01-12 14:31 ` Hans Hagen
2018-01-12 16:22 ` Jeong Dal [this message]
2018-01-12 18:19 ` Hans Hagen
2018-07-24 23:40 ` unable to define 'texgyrepagella-regula' error etc Jeong Dal
2018-07-25 8:19 ` Otared Kavian
2018-07-26 0:49 ` Jeong Dal
2018-07-26 8:24 ` Hans Hagen
2018-07-26 14:53 ` Jeong Dal
2018-07-26 15:24 ` Hans Hagen
2018-01-12 14:51 ` referencing the customized enumeration with framed title Hans Hagen
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=B93A9844-2C02-4185-81F1-2AD1CD6E379A@me.com \
--to=haksan@me.com \
--cc=ntg-context@ntg.nl \
--cc=pragma@wxs.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).