ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Chapter title in MetaFun manual.
@ 2023-02-10 12:05 Jeong Dal via ntg-context
  2023-02-10 12:26 ` Jeong Dal via ntg-context
  0 siblings, 1 reply; 2+ messages in thread
From: Jeong Dal via ntg-context @ 2023-02-10 12:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Jeong Dal


[-- Attachment #1.1: Type: text/plain, Size: 2391 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 9166 bytes --]

[-- Attachment #2: Type: text/plain, Size: 496 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Chapter title in MetaFun manual.
  2023-02-10 12:05 Chapter title in MetaFun manual Jeong Dal via ntg-context
@ 2023-02-10 12:26 ` Jeong Dal via ntg-context
  0 siblings, 0 replies; 2+ messages in thread
From: Jeong Dal via ntg-context @ 2023-02-10 12:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Jeong Dal


[-- Attachment #1.1: Type: text/plain, Size: 3494 bytes --]

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
> ___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 11223 bytes --]

[-- Attachment #2: Type: text/plain, Size: 496 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-10 12:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-10 12:05 Chapter title in MetaFun manual Jeong Dal via ntg-context
2023-02-10 12:26 ` Jeong Dal via ntg-context

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