2

I would like to have a decoration for math symbols that is a \bar - only with parenthesis around it. Consider this example:

\documentclass{standalone}
\usepackage{amsmath}
\begin{document}
\newcommand\barparen[1]{\overset{(-)}{#1}}
$p\bar{p}\barparen{p}$
\end{document}

Here's how it looks:

first try

Clearly, this is not very nice - the spacing is very different to the standard \bar command. Of course, I can try to fiddle with \raisebox and \scalebox until it looks about right, but isn't there some nicer way to do this?

carsten
  • 2,966
  • 5
    See http://tex.stackexchange.com/questions/286111/overlined-capital-letter-with-small-parenthesis – Dan Nov 08 '16 at 21:31

3 Answers3

3

Two suggestions:

  • Modify your macro \barparen by applying \scriptscriptstyle to the (-) thingy. (By default, the first argument of \overset is typeset in script style.)

  • Use the \scalebox macro (part of the graphicx package) to reduce the size of the (-) thingy even further, and apply negative kerning (in the amount of \mkern-1mu) to snug up the (, -, and ) elements.

enter image description here

\documentclass{article}
\usepackage{amsmath,graphicx}
\begin{document}
\newcommand\barparena[1]{\overset{%
   \scriptscriptstyle(-)}{#1}}
\newcommand\barparenb[1]{\overset{%
   \scalebox{0.4}{$(\mkern-1mu-\mkern-1mu)$}}{#1}}
$p\bar{p}\barparena{p}\barparenb{p}$
\end{document}
Mico
  • 506,678
1
\documentclass{standalone}
\usepackage{amsmath}
\begin{document}
$ %
p % 
\overset{-}{p} %
\overset{(-)}{p} %
\overset{\scriptscriptstyle(-)}{p} %
$
\end{document}

enter image description here

Related

1

First I would recommend visiting Overlined capital letter with small parenthesis.

Another way that I found from http://latex-community.org/forum/viewtopic.php?f=46&t=6646 is to do the following:

\documentclass{standalone}
\usepackage{lmodern}
\usepackage{amsmath}
\begin{document}
\newcommand\barparen[1]{\overset{(-)}{#1}}
$p\bar{p} \overset{\textbf{\fontsize{2pt}{2pt}\selectfont(---)}}{p} $\\
\end{document}

This gives:

enter image description here

Dan
  • 3,699