* How to put a circle on top of a character
@ 2017-08-29 12:54 Otared Kavian
2017-08-29 13:34 ` Aditya Mahajan
0 siblings, 1 reply; 8+ messages in thread
From: Otared Kavian @ 2017-08-29 12:54 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi,
How can I put a small circle on top of a character in math mode (for the curious this is needed when one defines the interior of a set…).
I tried the following, but the small circle is too far away from the character A. I am sure I had an ugly solution for this in plain TeX some years ago but I woul dlike to have an elegant solution in ConTeXt.
%%% begin interior-of-a-set.tex
\showgrid
\starttext
\mathtriplet{A}{\circ}{}
\startformula
\mathtriplet{A}{\circ}{}
\stopformula
\stoptext
%%% end interior-of-a-set.tex
Thanks for your help: OK
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to put a circle on top of a character
2017-08-29 12:54 How to put a circle on top of a character Otared Kavian
@ 2017-08-29 13:34 ` Aditya Mahajan
2017-08-29 14:24 ` Otared Kavian
0 siblings, 1 reply; 8+ messages in thread
From: Aditya Mahajan @ 2017-08-29 13:34 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1: Type: TEXT/PLAIN, Size: 676 bytes --]
On Tue, 29 Aug 2017, Otared Kavian wrote:
> Hi,
>
> How can I put a small circle on top of a character in math mode (for the curious this is needed when one defines the interior of a set…).
>
> I tried the following, but the small circle is too far away from the
> character A. I am sure I had an ugly solution for this in plain TeX some
> years ago but I woul dlike to have an elegant solution in ConTeXt.
The proper solution in LaTeX is to use the \mathring accent (I think that
amssym package defines that). The accent should also be available in
ConTeXt (sorry cannot check right now, but a simple grep of char-def.lua
should confirm that).
Aditya
[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to put a circle on top of a character
2017-08-29 13:34 ` Aditya Mahajan
@ 2017-08-29 14:24 ` Otared Kavian
2017-08-29 17:23 ` Hans Hagen
0 siblings, 1 reply; 8+ messages in thread
From: Otared Kavian @ 2017-08-29 14:24 UTC (permalink / raw)
To: mailing list for ConTeXt users
Thanks Aditya,
Indeed the solution is already there in luatex-math.tex…
one can just use $\mathring{A}$ out of the box!
I see why I love ConTeXt :-)
Best regards: OK
> On 29 Aug 2017, at 15:34, Aditya Mahajan <adityam@umich.edu> wrote:
>
> On Tue, 29 Aug 2017, Otared Kavian wrote:
>
>> Hi,
>>
>> How can I put a small circle on top of a character in math mode (for the curious this is needed when one defines the interior of a set…).
>>
>> I tried the following, but the small circle is too far away from the character A. I am sure I had an ugly solution for this in plain TeX some years ago but I woul dlike to have an elegant solution in ConTeXt.
>
> The proper solution in LaTeX is to use the \mathring accent (I think that amssym package defines that). The accent should also be available in ConTeXt (sorry cannot check right now, but a simple grep of char-def.lua should confirm that).
>
> Aditya___________________________________________________________________________________
> 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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to put a circle on top of a character
2017-08-29 14:24 ` Otared Kavian
@ 2017-08-29 17:23 ` Hans Hagen
2017-08-29 19:56 ` Otared Kavian
0 siblings, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2017-08-29 17:23 UTC (permalink / raw)
To: ntg-context
On 8/29/2017 4:24 PM, Otared Kavian wrote:
> Thanks Aditya,
>
> Indeed the solution is already there in luatex-math.tex…
> one can just use $\mathring{A}$ out of the box!
>
> I see why I love ConTeXt :-)
I checked one of the stacker sub-mechanisms and fixed / extended something:
\starttext
\definemathstackers[symbol][voffset=-.30\mathexheight,hoffset=\zeropoint,color=red]
\definemathover[symbol][interiorset]["2217]
\startformula
\mathover [symbol]{"2217} {A}
\mathover [symbol]{"2218} {A}
\mathover [symbol]{"2219} {A}
\mathunder [symbol] {"2217}{A}
\mathunder [symbol] {"2218}{A}
\mathunder [symbol] {"2219}{A}
\mathdouble[symbol]{"2217}{"2217}{A}
\mathdouble[symbol]{"2218}{"2218}{A}
\mathdouble[symbol]{"2219}{"2219}{A}
\mathring{A}
\interiorset{A}^{\interiorset{A}^{\interiorset{A}}}
\stopformula
\stoptext
Maybe it comes in handy for weird cases.
(not yet uploaded)
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to put a circle on top of a character
2017-08-29 17:23 ` Hans Hagen
@ 2017-08-29 19:56 ` Otared Kavian
2017-08-29 21:28 ` Hans Hagen
0 siblings, 1 reply; 8+ messages in thread
From: Otared Kavian @ 2017-08-29 19:56 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1: Type: text/plain, Size: 610 bytes --]
Hi Hans,
That’s wonderful! Indeed this is very handy and I’ll add it to the wiki.
However, before doing so, I would like to ask how is it possible to get the command act entirely in math mode, that is respecting the distances and the math fonts. Please see the attached output.
%%% begin interior-of-a-set.tex
\definemathstackers[symbol][voffset=-.30\mathexheight,hoffset=\zeropoint]
\definemathover[symbol][interiorset]["2218]
\starttext
Here is the new command \type{\interiorset{K}}: $\mathring{K} \neq \interiorset{K}$
\stoptext
%%% end interior-of-a-set.tex
Best regards: OK
[-- Attachment #2: interior-of-a-set.pdf --]
[-- Type: application/pdf, Size: 10527 bytes --]
[-- Attachment #3: Type: text/plain, Size: 2000 bytes --]
> On 29 Aug 2017, at 19:23, Hans Hagen <pragma@wxs.nl> wrote:
>
> On 8/29/2017 4:24 PM, Otared Kavian wrote:
>> Thanks Aditya,
>> Indeed the solution is already there in luatex-math.tex…
>> one can just use $\mathring{A}$ out of the box!
>> I see why I love ConTeXt :-)
> I checked one of the stacker sub-mechanisms and fixed / extended something:
>
> \starttext
>
> \definemathstackers[symbol][voffset=-.30\mathexheight,hoffset=\zeropoint,color=red]
>
> \definemathover[symbol][interiorset]["2217]
>
> \startformula
> \mathover [symbol]{"2217} {A}
> \mathover [symbol]{"2218} {A}
> \mathover [symbol]{"2219} {A}
> \mathunder [symbol] {"2217}{A}
> \mathunder [symbol] {"2218}{A}
> \mathunder [symbol] {"2219}{A}
>
> \mathdouble[symbol]{"2217}{"2217}{A}
> \mathdouble[symbol]{"2218}{"2218}{A}
> \mathdouble[symbol]{"2219}{"2219}{A}
>
> \mathring{A}
> \interiorset{A}^{\interiorset{A}^{\interiorset{A}}}
> \stopformula
>
> \stoptext
>
> Maybe it comes in handy for weird cases.
>
> (not yet uploaded)
>
> Hans
>
> -----------------------------------------------------------------
> Hans Hagen | PRAGMA ADE
> Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
[-- Attachment #4: Type: text/plain, Size: 492 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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to put a circle on top of a character
2017-08-29 19:56 ` Otared Kavian
@ 2017-08-29 21:28 ` Hans Hagen
2017-08-30 11:45 ` Otared Kavian
2017-08-30 13:39 ` Otared Kavian
0 siblings, 2 replies; 8+ messages in thread
From: Hans Hagen @ 2017-08-29 21:28 UTC (permalink / raw)
To: ntg-context
On 8/29/2017 9:56 PM, Otared Kavian wrote:
> Hi Hans,
>
> That’s wonderful! Indeed this is very handy and I’ll add it to the wiki.
>
> However, before doing so, I would like to ask how is it possible to get the command act entirely in math mode, that is respecting the distances and the math fonts. Please see the attached output.
>
> %%% begin interior-of-a-set.tex
> \definemathstackers[symbol][voffset=-.30\mathexheight,hoffset=\zeropoint]
> \definemathover[symbol][interiorset]["2218]
> \starttext
>
> Here is the new command \type{\interiorset{K}}: $\mathring{K} \neq \interiorset{K}$
>
> \stoptext
> %%% end interior-of-a-set.tex
I'll add an offset
\definemathstackers
[\v!symbol]
[\c!voffset=-.3\mathexheight,
\c!hoffset=\zeropoint,
\c!mathclass=ord,
\c!topoffset=.4\mathemwidth, % poor man's italic correction
\c!middlecommand=\mathematics]
but keep in mind, this is not really meant for accented math, more for
special cases
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to put a circle on top of a character
2017-08-29 21:28 ` Hans Hagen
@ 2017-08-30 11:45 ` Otared Kavian
2017-08-30 13:39 ` Otared Kavian
1 sibling, 0 replies; 8+ messages in thread
From: Otared Kavian @ 2017-08-30 11:45 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi Hans,
Thanks for your attention.
Indeed I understand that the stackers structures are for putting things such as a circle or a star on top of another character or constructs.
In fact, in terms of readability, the result of your new command \interiorset{K} is better than that of \mathring{K}, but the « K » coming out with \interiorset is set in Roman, while it should be math italic (or whatever font is used in math mode).
Also the white space around it is not yet correct. I’ll test what you will have added in the next beta and then put an entry on the wiki about mathstackers.
Thanks again: OK
> On 29 Aug 2017, at 23:28, Hans Hagen <pragma@wxs.nl> wrote:
>
> On 8/29/2017 9:56 PM, Otared Kavian wrote:
>> Hi Hans,
>> That’s wonderful! Indeed this is very handy and I’ll add it to the wiki.
>> However, before doing so, I would like to ask how is it possible to get the command act entirely in math mode, that is respecting the distances and the math fonts. Please see the attached output.
>> %%% begin interior-of-a-set.tex
>> \definemathstackers[symbol][voffset=-.30\mathexheight,hoffset=\zeropoint]
>> \definemathover[symbol][interiorset]["2218]
>> \starttext
>> Here is the new command \type{\interiorset{K}}: $\mathring{K} \neq \interiorset{K}$
>> \stoptext
>> %%% end interior-of-a-set.tex
>
> I'll add an offset
>
> \definemathstackers
> [\v!symbol]
> [\c!voffset=-.3\mathexheight,
> \c!hoffset=\zeropoint,
> \c!mathclass=ord,
> \c!topoffset=.4\mathemwidth, % poor man's italic correction
> \c!middlecommand=\mathematics]
>
> but keep in mind, this is not really meant for accented math, more for special cases
>
> Hans
>
> -----------------------------------------------------------------
> Hans Hagen | PRAGMA ADE
> Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------
> ___________________________________________________________________________________
> 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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to put a circle on top of a character
2017-08-29 21:28 ` Hans Hagen
2017-08-30 11:45 ` Otared Kavian
@ 2017-08-30 13:39 ` Otared Kavian
1 sibling, 0 replies; 8+ messages in thread
From: Otared Kavian @ 2017-08-30 13:39 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi Hans,
Regarding what you have added on line 1327 of math-stc.mkvi, that line should be
\definemathover[\v!symbol][interiorset]["2218]
(instead of "2217).
I added also a wiki page for mathstackers:
http://wiki.contextgarden.net/mathstackers
Best regards: OK
> On 29 Aug 2017, at 23:28, Hans Hagen <pragma@wxs.nl> wrote:
>
> On 8/29/2017 9:56 PM, Otared Kavian wrote:
>> Hi Hans,
>> That’s wonderful! Indeed this is very handy and I’ll add it to the wiki.
>> However, before doing so, I would like to ask how is it possible to get the command act entirely in math mode, that is respecting the distances and the math fonts. Please see the attached output.
>> %%% begin interior-of-a-set.tex
>> \definemathstackers[symbol][voffset=-.30\mathexheight,hoffset=\zeropoint]
>> \definemathover[symbol][interiorset]["2218]
>> \starttext
>> Here is the new command \type{\interiorset{K}}: $\mathring{K} \neq \interiorset{K}$
>> \stoptext
>> %%% end interior-of-a-set.tex
>
> I'll add an offset
>
> \definemathstackers
> [\v!symbol]
> [\c!voffset=-.3\mathexheight,
> \c!hoffset=\zeropoint,
> \c!mathclass=ord,
> \c!topoffset=.4\mathemwidth, % poor man's italic correction
> \c!middlecommand=\mathematics]
>
> but keep in mind, this is not really meant for accented math, more for special cases
>
> Hans
>
> -----------------------------------------------------------------
> Hans Hagen | PRAGMA ADE
> Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------
> ___________________________________________________________________________________
> 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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-08-30 13:39 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-29 12:54 How to put a circle on top of a character Otared Kavian
2017-08-29 13:34 ` Aditya Mahajan
2017-08-29 14:24 ` Otared Kavian
2017-08-29 17:23 ` Hans Hagen
2017-08-29 19:56 ` Otared Kavian
2017-08-29 21:28 ` Hans Hagen
2017-08-30 11:45 ` Otared Kavian
2017-08-30 13:39 ` Otared Kavian
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).