ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* how to make a \lambdabar (like \hbar)
@ 2014-03-10 10:15 Sanjoy Mahajan
  2014-03-10 14:30 ` Aditya Mahajan
  0 siblings, 1 reply; 3+ messages in thread
From: Sanjoy Mahajan @ 2014-03-10 10:15 UTC (permalink / raw)
  To: ntg-context

\hbar is used a lot in physics.  Once in a while, one also uses
\lambdabar to mean \lambda/2\pi.  It's Unicode description is 'LATIN
SMALL LETTER LAMBDA WITH STROKE' (U+019B).

I've been using this hack

  \def\lambdabar{\lambda\kern-1ex\raise0.65ex\hbox{-}}

But it's not beautiful.  Is there a better way to get a lambdabar
into (or from) the math fonts?  I tried

  \def\lambdabar                    {\Umathchar  "0"0"00019B }

by analogy with the definition of \hbar in luatex-math.tex, but it
produces a blank space.  There must be no entry for it in the regular
(or Palatino) math fonts.

For reference, the following thread had a discussion about \hbar

<http://www.ntg.nl/pipermail/ntg-context/2013/070810.html>

and \hbar works well (using MkIV 2014.02.14).

-Sanjoy
___________________________________________________________________________________
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] 3+ messages in thread

* Re: how to make a \lambdabar (like \hbar)
  2014-03-10 10:15 how to make a \lambdabar (like \hbar) Sanjoy Mahajan
@ 2014-03-10 14:30 ` Aditya Mahajan
  2014-03-10 15:29   ` Sanjoy Mahajan
  0 siblings, 1 reply; 3+ messages in thread
From: Aditya Mahajan @ 2014-03-10 14:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 10 Mar 2014, Sanjoy Mahajan wrote:

> \hbar is used a lot in physics.  Once in a while, one also uses
> \lambdabar to mean \lambda/2\pi.  It's Unicode description is 'LATIN
> SMALL LETTER LAMBDA WITH STROKE' (U+019B).
>
> I've been using this hack
>
>  \def\lambdabar{\lambda\kern-1ex\raise0.65ex\hbox{-}}

Is this the canonical name for the glyph used by AMS?

> But it's not beautiful.  Is there a better way to get a lambdabar
> into (or from) the math fonts?  I tried
>
>  \def\lambdabar                    {\Umathchar  "0"0"00019B }
>
> by analogy with the definition of \hbar in luatex-math.tex,

The right way is to update char-def.lua as

  {
   adobename="lambdastroke",
   category="ll",
   description="LATIN SMALL LETTER LAMBDA WITH STROKE",
   direction="l",
   linebreak="al",
   mathclass="variable",
   mathname="lambdabar",
   unicodeslot=0x019B,
  },

> but it produces a blank space.  There must be no entry for it in the 
> regular (or Palatino) math fonts.

The easiest solution will be to file a bug report with the TeX Gyre 
project. This is an easy glyph to add.

Otherwise, you can use a different font as fall back for lambdabar, but 
that will not match the regular lambda from Palatino. If you create the 
glyph on your own, as in your definition above, then you have to play 
around with the length of the bar to make make it "pretty".

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


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

* Re: how to make a \lambdabar (like \hbar)
  2014-03-10 14:30 ` Aditya Mahajan
@ 2014-03-10 15:29   ` Sanjoy Mahajan
  0 siblings, 0 replies; 3+ messages in thread
From: Sanjoy Mahajan @ 2014-03-10 15:29 UTC (permalink / raw)
  To: Aditya Mahajan, mailing list for ConTeXt users

Aditya Mahajan <adityam@umich.edu> writes:

>>  \def\lambdabar{\lambda\kern-1ex\raise0.65ex\hbox{-}}
>
> Is this the canonical name for the glyph used by AMS?

Good question.  The AMS files don't seem to have it (the symbol is
hardly used by mathematicians).  But revtex4 defines it (for latex), in
/usr/local/texlive/2013/texmf-dist/tex/latex/revtex4/revsymb.sty

An example of using it:

\documentclass{revtex4-1}
\begin{document}
$\lambdabar$
\end{document}

> The right way is to update char-def.lua as
>
>   {
>    adobename="lambdastroke",
>    category="ll",
>    description="LATIN SMALL LETTER LAMBDA WITH STROKE",
>    direction="l",
>    linebreak="al",
>    mathclass="variable",
>    mathname="lambdabar",
>    unicodeslot=0x019B,
>   },

I have put that in and ran 'context --make' pending the font update.

> The easiest solution will be to file a bug report with the TeX Gyre 
> project. This is an easy glyph to add.

I'll do that.  If you know of it, could you point me to their bug tracker
(or best way to file a bug report)?  I roamed the GUST site without
finding it.

> Otherwise, you can use a different font as fall back for lambdabar, but 
> that will not match the regular lambda from Palatino. If you create the 
> glyph on your own, as in your definition above, then you have to play 
> around with the length of the bar to make make it "pretty".

That seems to be what revtex does (it has quite a complicated
definition).

-Sanjoy
___________________________________________________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2014-03-10 15:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-10 10:15 how to make a \lambdabar (like \hbar) Sanjoy Mahajan
2014-03-10 14:30 ` Aditya Mahajan
2014-03-10 15:29   ` Sanjoy Mahajan

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