Math & ScienceWide Bar in Math Mode

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Wide Bar in Math Mode

Post by Cham »

How can I tell LaTeX to put a wide bar on top of a symbol?

I need to write \Psi with a large bar, but \bar{\Psi} gives a too small bar on top. I need a large one (i.e. wide bar). Apparently, a command like \widebar doesn't exist, while \widetilde do exists.

For the ones familiar with quantum field theory, I need to write the "Dirac adjoint" of the bi-spinor field.

Any idea on this ?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Wide Bar in Math Mode

Post by localghost »

Code: Select all

$\overline{\Psi}$

Thorsten
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Wide Bar in Math Mode

Post by Cham »

localghost wrote:

Code: Select all

$\overline{\Psi}$
Hmm, now I think that this bar is a bit too long. I'm not sure. I need to check how the Dirac adjoint is written elsewhere.


Edit:
OK, apparently, in most of the books I have, it's the usual \bar which appears to be used. However, most of them are using \psi instead of \Psi (I much prefer the latter), so I'm not sure yet how I should write the Dirac's adjoint.
Last edited by Cham on Wed Jun 20, 2012 7:30 pm, edited 1 time in total.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Wide Bar in Math Mode

Post by localghost »

Cham wrote:[…] Hmm, now I think that this bar is a bit too long. I'm not sure. I need to check how the Dirac adjoint is written elsewhere. […]
No reason to despair. Define your own command if the given ones are not satisfactory.

Code: Select all

\documentclass[11pt]{article}

\newcommand*\xbar[1]{%
  \hbox{%
    \vbox{%
      \hrule height 0.5pt % The actual bar
      \kern0.5ex%         % Distance between bar and symbol
      \hbox{%
        \kern-0.1em%      % Shortening on the left side
        \ensuremath{#1}%
        \kern-0.1em%      % Shortening on the right side
      }%
    }%
  }%
} 

\begin{document}
  $\xbar{\Psi}$
\end{document}
The new command works both in text and mode.
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Re: Wide Bar in Math Mode

Post by Cham »

Wow !

Your solution is pretty complex, but the result looks very nice.

I'll experiment with it.

Thanks a lot !
samrob
Posts: 1
Joined: Tue Feb 18, 2014 11:47 am

Wide Bar in Math Mode

Post by samrob »

The package mathabx provides a \widebar macro. This is documented in "The Comprehensive LaTeX Symbol List".

For more disambiguation I thoroughly recommend to have a look at it.
quatsch83
Posts: 1
Joined: Mon Apr 14, 2014 5:08 pm

Wide Bar in Math Mode

Post by quatsch83 »

localghost wrote: No reason to despair. Define your own command if the given ones are not satisfactory.
This command doesn't work if used in a subscript. It doesn't change the size of the font to the proper subscript size.
Post Reply