Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

making \lambdabar, like \hbar?

942 views
Skip to first unread message

Johann Hibschman

unread,
Apr 4, 2000, 3:00:00 AM4/4/00
to
Hi,

Does anyone know where I can get LaTeX macros to construct a
"\lambdabar", namely a Greek \lambda with a bar across its stem? It's
the same idea as \hbar, only this time for the reduced Compton
wavelength. ;-)

I've been trying all sorts of ugly things like

\newcommand{\lambdabar}{\mbox{\makebox[-0.5ex][l]{$\lambda$} \raisebox{0.7ex}[0pt][0pt]{--}}}

but I don't really understand how to get the spacing right. This
seems wrong, somehow; the 0.5ex negative space and the unknown width
of the argument of the \raisebox leave me uncertain that the next LR
box in the line will be placed correctly. Plus, it doesn't look that
great. How can I improve this?

Any hints?

--Johann

--
Johann Hibschman joh...@physics.berkeley.edu

George Pearson

unread,
Apr 4, 2000, 3:00:00 AM4/4/00
to
Shamelessly stolen from revtex.sty:

\def\lambdabar{\protect\@lambdabar}
\def\@lambdabar{%
\relax
\bgroup
\def\@tempa{\hbox{\raise.73\ht0
\hbox to0pt{\kern.25\wd0\vrule width.5\wd0
height.1pt depth.1pt\hss}\box0}}%
\mathchoice{\setbox0\hbox{$\displaystyle\lambda$}\@tempa}%
{\setbox0\hbox{$\textstyle\lambda$}\@tempa}%
{\setbox0\hbox{$\scriptstyle\lambda$}\@tempa}%
{\setbox0\hbox{$\scriptscriptstyle\lambda$}\@tempa}%
\egroup
}


Since @'s are included you will either need to surround this definition with
\makeatletter and \makeatother or place it inside a separate .sty file. The
later is probably preferred.

Regards,

George Pearson
MacKichan Software, Inc.

"Johann Hibschman" <joh...@physics.berkeley.edu> wrote in message
news:mtzor9w...@astron.berkeley.edu...

Johann Hibschman

unread,
Apr 4, 2000, 3:00:00 AM4/4/00
to
George Pearson writes:

> Shamelessly stolen from revtex.sty:
[...]

You know, that was sitting around on the server, but I had no idea it
was there, let alone had a lambdabar, until you pointed it out.
Thanks!

--
Johann Hibschman joh...@physics.berkeley.edu

0 new messages