ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Math accents set too close to capital
@ 2013-07-30 22:04 Michael Murphy
  2013-07-31  7:05 ` Keith J. Schultz
  2013-07-31  7:48 ` Hans Hagen
  0 siblings, 2 replies; 8+ messages in thread
From: Michael Murphy @ 2013-07-30 22:04 UTC (permalink / raw)
  To: Context Mailing List


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

Hello all,

I'm trying to typeset 'H' with a circumflex (or hat) in math mode, but the result is rather ugly when not using latin-modern. I've tried to redefine the \hat macro to move the accent up a bit using \topaccent: is this the best approach? Having to nest '$' does not seem right at all. (Also, for some reason although I find \mathhat in enco-ini.mkiv, when I try to use it I get undefined control sequence.)

Thanks,
Michael

\starttypescript [mathfont]
  \definetypeface [mathfont] [mm] [math]  [palatino]  [default] [rscale=1.0]
\stoptypescript
\usetypescript[mathfont]
\setupbodyfont[mathfont]

\starttext

$\hat{H}$

\def\hat#1{\topaccent{3pt}{0}{90}{\textcircumflex}{$#1$}}

$\hat{H}$

\stoptext

--

Michael Murphy
murphy.md@gmail.com




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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Math accents set too close to capital
  2013-07-30 22:04 Math accents set too close to capital Michael Murphy
@ 2013-07-31  7:05 ` Keith J. Schultz
  2013-08-01  8:04   ` Khaled Hosny
  2013-07-31  7:48 ` Hans Hagen
  1 sibling, 1 reply; 8+ messages in thread
From: Keith J. Schultz @ 2013-07-31  7:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi,

Have you tries U+1024 or LETTER CAPITAL H WITH CIRCUMFLEX?

True not all Fonts might not have it and it is TEXT not Math.

Just a thought.

regards
	Keith.

Am 31.07.2013 um 00:04 schrieb Michael Murphy <murphy.md@gmail.com>:

> Hello all,
> 
> I'm trying to typeset 'H' with a circumflex (or hat) in math mode, but the result is rather ugly when not using latin-modern. I've tried to redefine the \hat macro to move the accent up a bit using \topaccent: is this the best approach? Having to nest '$' does not seem right at all. (Also, for some reason although I find \mathhat in enco-ini.mkiv, when I try to use it I get undefined control sequence.)
> 
> Thanks,
> Michael
> 
> \starttypescript [mathfont]
>   \definetypeface [mathfont] [mm] [math]  [palatino]  [default] [rscale=1.0]
> \stoptypescript
> \usetypescript[mathfont]
> \setupbodyfont[mathfont]
> 
> \starttext
> 
> $\hat{H}$
> 
> \def\hat#1{\topaccent{3pt}{0}{90}{\textcircumflex}{$#1$}}
> 
> $\hat{H}$
> 
> \stoptext
> 
> --
> 
> Michael Murphy
> murphy.md@gmail.com


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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Math accents set too close to capital
  2013-07-30 22:04 Math accents set too close to capital Michael Murphy
  2013-07-31  7:05 ` Keith J. Schultz
@ 2013-07-31  7:48 ` Hans Hagen
  2013-07-31 10:26   ` Michael Murphy
  1 sibling, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2013-07-31  7:48 UTC (permalink / raw)
  To: ntg-context

On 7/31/2013 12:04 AM, Michael Murphy wrote:
> Hello all,
>
> I'm trying to typeset 'H' with a circumflex (or hat) in math mode, but
> the result is rather ugly when not using latin-modern. I've tried to
> redefine the \hat macro to move the accent up a bit using \topaccent: is
> this the best approach? Having to nest '$' does not seem right at all.
> (Also, for some reason although I find \mathhat in enco-ini.mkiv, when I
> try to use it I get undefined control sequence.)
>
> Thanks,
> Michael
>
> \starttypescript [mathfont]
>    \definetypeface [mathfont] [mm] [math]  [palatino]  [default]
> [rscale=1.0]
> \stoptypescript
> \usetypescript[mathfont]
> \setupbodyfont[mathfont]
>
> \starttext
>
> $\hat{H}$
>
> \def\hat#1{\topaccent{3pt}{0}{90}{\textcircumflex}{$#1$}}
>
> $\hat{H}$
>
> \stoptext

$\widehat{H}$

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Math accents set too close to capital
  2013-07-31  7:48 ` Hans Hagen
@ 2013-07-31 10:26   ` Michael Murphy
  2013-07-31 19:40     ` Sietse Brouwer
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Murphy @ 2013-07-31 10:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi Hans,

Thanks for the response. This is sort of what I wanted, except the \widehat is, well, quite wide. So I hacked it around a bit to put the \widehat from a capital 'I' on top of a capital 'H'. In case it happens to be helpful, the final macro was

\def\hhat{H\kern-0.61em\widehat{\phantom{I}}\kern0.178em}

If I really cared, I wouldn't hard-code those numbers, but since they are in em I'm not really too worried. 

-- 
Michael Murphy
murphy.md@gmail.com


On Wednesday, 31 July 2013 at 08:48, Hans Hagen wrote:

> On 7/31/2013 12:04 AM, Michael Murphy wrote:
> > Hello all,
> > 
> > I'm trying to typeset 'H' with a circumflex (or hat) in math mode, but
> > the result is rather ugly when not using latin-modern. I've tried to
> > redefine the \hat macro to move the accent up a bit using \topaccent: is
> > this the best approach? Having to nest '$' does not seem right at all.
> > (Also, for some reason although I find \mathhat in enco-ini.mkiv, when I
> > try to use it I get undefined control sequence.)
> > 
> > Thanks,
> > Michael
> > 
> > \starttypescript [mathfont]
> > \definetypeface [mathfont] [mm] [math] [palatino] [default]
> > [rscale=1.0]
> > \stoptypescript
> > \usetypescript[mathfont]
> > \setupbodyfont[mathfont]
> > 
> > \starttext
> > 
> > $\hat{H}$
> > 
> > \def\hat#1{\topaccent{3pt}{0}{90}{\textcircumflex}{$#1$}}
> > 
> > $\hat{H}$
> > 
> > \stoptext
> 
> $\widehat{H}$
> 
> -----------------------------------------------------------------
> Hans Hagen | PRAGMA ADE
> Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com (http://www.pragma-ade.com)
> | www.pragma-pod.nl (http://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://tex.aanhet.net
> archive : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
> ___________________________________________________________________________________
> 
> 



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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Math accents set too close to capital
  2013-07-31 10:26   ` Michael Murphy
@ 2013-07-31 19:40     ` Sietse Brouwer
  2013-07-31 21:01       ` Marco Patzer
  0 siblings, 1 reply; 8+ messages in thread
From: Sietse Brouwer @ 2013-07-31 19:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Tangential to your issue, but nota bene: instead of $...$ for inline
math, ConTeXt lets you use \math{...} or \m{...}. Which is a bit more
explicit, and can be easier to debug. You might prefer it.

For display math, you really should use \startformula...\stopformula
if you aren’t using it already, because $$...$$ doesn't space
correctly. (Says the wiki. I don’t know it’s still true.)

Cheers,
Sietse


On 31 July 2013 12:26, Michael Murphy <murphy.md@gmail.com> wrote:
> Hi Hans,
>
> Thanks for the response. This is sort of what I wanted, except the \widehat
> is, well, quite wide. So I hacked it around a bit to put the \widehat from a
> capital 'I' on top of a capital 'H'. In case it happens to be helpful, the
> final macro was
>
> \def\hhat{H\kern-0.61em\widehat{\phantom{I}}\kern0.178em}
>
> If I really cared, I wouldn't hard-code those numbers, but since they are in
> em I'm not really too worried.
>
> --
> Michael Murphy
> murphy.md@gmail.com
>
> On Wednesday, 31 July 2013 at 08:48, Hans Hagen wrote:
>
> On 7/31/2013 12:04 AM, Michael Murphy wrote:
>
> Hello all,
>
> I'm trying to typeset 'H' with a circumflex (or hat) in math mode, but
> the result is rather ugly when not using latin-modern. I've tried to
> redefine the \hat macro to move the accent up a bit using \topaccent: is
> this the best approach? Having to nest '$' does not seem right at all.
> (Also, for some reason although I find \mathhat in enco-ini.mkiv, when I
> try to use it I get undefined control sequence.)
>
> Thanks,
> Michael
>
> \starttypescript [mathfont]
> \definetypeface [mathfont] [mm] [math] [palatino] [default]
> [rscale=1.0]
> \stoptypescript
> \usetypescript[mathfont]
> \setupbodyfont[mathfont]
>
> \starttext
>
> $\hat{H}$
>
> \def\hat#1{\topaccent{3pt}{0}{90}{\textcircumflex}{$#1$}}
>
> $\hat{H}$
>
> \stoptext
>
>
> $\widehat{H}$
>
> -----------------------------------------------------------------
> Hans Hagen | PRAGMA ADE
> Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
> | 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://tex.aanhet.net
> archive : http://foundry.supelec.fr/projects/contextrev/
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Math accents set too close to capital
  2013-07-31 19:40     ` Sietse Brouwer
@ 2013-07-31 21:01       ` Marco Patzer
  0 siblings, 0 replies; 8+ messages in thread
From: Marco Patzer @ 2013-07-31 21:01 UTC (permalink / raw)
  To: ntg-context


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

On 2013–07–31 Sietse Brouwer wrote:

> Tangential to your issue, but nota bene: instead of $...$ for inline
> math, ConTeXt lets you use \math{...} or \m{...}.

Indeed. And when you use \asciimode, you have no other choice (and
that's a good thing):

  \asciimode
  \starttext
    My #1 is $5

    \math{a^2 + b^2}
  \stoptext

Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Math accents set too close to capital
  2013-07-31  7:05 ` Keith J. Schultz
@ 2013-08-01  8:04   ` Khaled Hosny
  2013-08-01 13:04     ` Michael Murphy
  0 siblings, 1 reply; 8+ messages in thread
From: Khaled Hosny @ 2013-08-01  8:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Jul 31, 2013 at 09:05:18AM +0200, Keith J. Schultz wrote:
> Hi,
> 
> Have you tries U+1024 or LETTER CAPITAL H WITH CIRCUMFLEX?
> 
> True not all Fonts might not have it and it is TEXT not Math.

And you shouldn’t use it in math, even Unicode discourages such use.
Accents in text and math are not the same.

Regards,
Khaled
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Math accents set too close to capital
  2013-08-01  8:04   ` Khaled Hosny
@ 2013-08-01 13:04     ` Michael Murphy
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Murphy @ 2013-08-01 13:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

I did try that, but it doesn't seem to exist in my font. Besides, I'm inclined to agree with Khaled on math accents. I think that what I'm trying to do shouldn't be that hard, I just want the \mathhat accent to be placed a little higher. Something like \skew in plain TeX, but in the vertical direction.  

Michael  


On Thursday, 1 August 2013 at 09:04, Khaled Hosny wrote:

> On Wed, Jul 31, 2013 at 09:05:18AM +0200, Keith J. Schultz wrote:
> > Hi,
> >  
> > Have you tries U+1024 or LETTER CAPITAL H WITH CIRCUMFLEX?
> >  
> > True not all Fonts might not have it and it is TEXT not Math.
>  
> And you shouldn’t use it in math, even Unicode discourages such use.
> Accents in text and math are not the same.
>  
>  



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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2013-08-01 13:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-30 22:04 Math accents set too close to capital Michael Murphy
2013-07-31  7:05 ` Keith J. Schultz
2013-08-01  8:04   ` Khaled Hosny
2013-08-01 13:04     ` Michael Murphy
2013-07-31  7:48 ` Hans Hagen
2013-07-31 10:26   ` Michael Murphy
2013-07-31 19:40     ` Sietse Brouwer
2013-07-31 21:01       ` Marco Patzer

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