Re: [NTG-context] framed with titles

2017-11-13 Thread Jeong Dal
Hi,

Here is a sample code of framed text with titles using FunnyFrame.

I tried to use it to display theorems “Theorem #.#” inside the FrameTitle, and 
the text in FunnyFrame.
So, I defined “\defineenumeration[Thm]”.
But I couldn’t make it.
Is it possible to do that? If so, please let me know how to do the following 
two things.

1. to put “Theorem #.#” inside the FrameTitle?(#.# means that chapter 
number.theorem number)
2. to suppress the automatically display of “Thm #” inside the text?

Thanks for reading.

Best regards,

Dalyoung

 framed Text copied from MetaFun book.
\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 .85white ;  %.425green;%.
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\FrameTitle #1% 
{\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut\ss\bf #1\hss}}} 

\defineenumeration[Thm]
   [%text=\thm,
style=,
title=yes,
prefix=yes,
prefixsegments=chapter,
way=bychapter,
number=yes,
before={\blank[big]\FrameTitle{Theorem} \startFunnyText},
after={\stopFunnyText\blank}]

\starttext

{\FrameTitle{Fort's space}
\startFunnyText{Fort's space}
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}.
\stopFunnyText}

\startThm
Fort's space is a compact and Hausdorff topological space.
\stopThm
\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
___

Re: [NTG-context] Problem with math alignment

2017-11-13 Thread Jeong Dal
Dear Otared,

Thank you for checking my code.

> The strange fact is that if one puts 
>   \startitem $\overline{A} = A$ \stopitem
> as the first item in your example (instead of the second), then ConTeXt 
> creates three columns, with the first item the result of the above line, and 
> then items 2 and 3 in the second column and finally item 4 in the third 
> column. Despite this the textwidth is divided into four…
> 

I have noticed before what you described. If there are 8 items, the outputs are 
all different depends on the location of \overline.
I couldn’t see any pattern in the output.
The only thing I can see is that the command ‘\overline’  makes a blank line,
and I just guess that it is related with the column environment.

> I hope Hans will see your message and fix the issue.

Yes, it is also my hope. And, I believe that he also solve the alignment 
problem too.

Best regards,

Dalyoung

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

Re: [NTG-context] Problem with math alignment

2017-11-13 Thread Wolfgang Schuster



Otared Kavian 
13. November 2017 um 11:08


Hi Wolfgang,

Thanks for your help. In math-ali.mkiv there are the following lines:

\setupmathmatrix
[\c!distance=\emwidth,
\c!left=,
\c!right=,
\c!align=\v!middle]

Is it here where one has to change something? I confess that I am not 
at all familiar with the source code…


No, this is only the default setup for matrices. The alignment is done 
at the begin and end of the cell content (look at the commented commands 
below):


\unexpanded\def\math_matrix_start_cell
  {\dostarttagged\t!mathtablecell\empty
   \hss
  %\math_left_of_equalign
   \startimath
   \math_matrix_set_style
   \tabskip\zeropoint
   \everycr\emptytoks}

\unexpanded\def\math_matrix_stop_cell
  {\stopimath
  %\math_right_of_eqalign
   \hss
   \dostoptagged}

Wolfgang
___
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
___

Re: [NTG-context] Problem with math alignment

2017-11-13 Thread Otared Kavian
Dear Dalyoung,

Thank you for having tested my example.

Regarding what you are reporting in another thread about the weird behaviour of 
\overline in columns, I was traveling and could not test your file. Now I 
tested your example and I get the same result as you with the latest beta 
2017.11.08 22:45.
The strange fact is that if one puts 
\startitem $\overline{A} = A$ \stopitem
as the first item in your example (instead of the second), then ConTeXt creates 
three columns, with the first item the result of the above line, and then items 
2 and 3 in the second column and finally item 4 in the third column. Despite 
this the textwidth is divided into four…

I hope Hans will see your message and fix the issue.

Best regards: OK

> On 13 Nov 2017, at 03:12, Jeong Dal  wrote:
> 
> Dear Otared,
> 
> I run your code and found that they are not aligned properly as you want.
> But I don’t know how to do for the correct alignment.
> 
> Did you see the mail about the \overline problem in column environment which 
> I listed recently?
> It is a different problem from yours, but I’d like to know whether  you got 
> the same output as mine or not.
> Would you please check it in your computer?
> 
> Thank you.
> 
> Best regards,
> 
> Dalyoung
> ___
> 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
> ___

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

Re: [NTG-context] Problem with math alignment

2017-11-13 Thread Wolfgang Schuster



Otared Kavian 
12. November 2017 um 17:37
Hi everybody,

Does anyone have noticed that the mathalignment has changed its 
behaviour recently? I think a bug has managed to enter the environment 
which handles the mathalignment, at least since a few weeks ago. I did 
not report it earlier because I was traveling and did not have a 
stable internet access.
The align option for mathmatrix doesn’t work anymore because the 
function is disabled (commented) in the code.


Wolfgang
___
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
___