Dear all,
 
I think that I found the cause.
The page layout of my file is different from that of MetaFun manual.
After borrowing the \setuplayout from MetaFun-000.tex, it works correctly.

I am sorry to give you a wrong example.

Thank you for reading.

Best regards,

Dalyoung


2023. 2. 10. 오후 9:05, Jeong Dal via ntg-context <ntg-context@ntg.nl> 작성:

Dear all,

I copied the code of defining chapter command  from metafun-000.tex, and run it.
But the result is different from that in MetaFun Manual.
There is a big spaces between the number and the title which yields the number cannot be seen.
I commented out several lines which seems to be not-related with chapter title.
And, I changed

\def\ChapterCommand#1#2% —> \define[2]\ChapterCommand

Would you please test the following code to find out what is wrong?

Thank you for reading.

Best regards,

Dalyoung


\startuseMPgraphic{circled}
pickup pencircle scaled 1mm ;
drawoptions(withcolor (.6+uniformdeviate.35)*white) ;
fill fullcircle xscaled 1.5cm yscaled 1cm ;
drawoptions(withcolor .625yellow) ;
draw fullcircle xscaled 1.5cm yscaled 1cm ;
\stopuseMPgraphic

%\startnotmode[proof]
% \defineoverlay[circled][\useMPgraphic{circled}]
%\stopnotmode

\define[1]\Circled%
{\framed
[background=circled,frame=off,offset=overlay]
{\color[darkred]{#1}}}

\setuppagenumbering[location=]
\setupheadertexts[margin][][\hbox to \hsize{\hss\Circled\pagenumber\hss}]

\startuniqueMPgraphic{titled}
path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
pickup pencircle scaled 1mm ;
drawoptions(withcolor .625yellow) ;
draw llcorner p -- lrcorner p ;
setbounds currentpicture to p ;
\stopuniqueMPgraphic

\defineoverlay[titled][\uniqueMPgraphic{titled}]

\define[2]\ChapterCommand%
{\setbox0=\hbox to \leftmarginwidth{#1\hss}%
\hskip-\leftmarginwidth
\hskip-\leftmargindistance
\framed
[background=titled,frame=off,offset=0pt]
{\box0
\hskip\leftmargindistance
#2}}

\define[2]\TitleCommand%
{\framed
[background=titled,frame=off,offset=0pt]
{#2}}

\setuphead
[chapter]%,section,subsection]
[command=\ChapterCommand,
style=\ss\bf\tfd,
color=darkred]

\setuphead
[title]%,subject,sububject]
[command=\TitleCommand,
style=\ss\bf\tfd,
color=darkred]


\setupbodyfont[bonum,rm,12pt]
\showframe

\starttext
\startchapter[title={Introduction}]
This is the chapter for introduction.
\stopchapter

\startchapter[title={Function}]
Now, we study the function.
\stopchapter

\starttitle[title={References}]
\startitemize[n]
\item first
\item second
\item third
\stopitemize
\stoptitle

\stoptext
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________