3

Looking for a simple method to use a widebar over a letter with subscript, but have the space remain the same as when using \bar as \overline produces large space which does not look good even though the bar length is fine, while widebar from \usepackage{mathabx} reduces the gap, but the bar length is not as wide (in addition, I do not want to use mathabx package as I got compile error relating to fonts in some builds).

\documentclass[]{article}%
\usepackage{amsmath}
 \usepackage{mathabx}  %causes problems sometimes
\begin{document}

 $\bar{V}_H$ 

 $\overline{V}_H$ 

 $\widebar{V}_H$ 

\end{document}

I saw this question Can I get a \widebar without using the mathabx package? which I tried (even though I prefer a much simpler solution) but still I see large space gap as above.

question is: Is there a simple Latex way to reduce the space to that similar to using \bar, but still have wide bar over the letter? Like the last image shown below (produced using my advanced skill using paint.exe on windows 7 by manually shifting the letter H over to the left to where I want it positioned)

Mathematica graphics

Using texlive 2013 in Linux mint 16 (please give a simple solution if possible, nothing too advanced, as I am a newbie in Latex)

0
3

In this case, I finally succeeded in resolving the problem through a redefinition of \overline{}, so that an auxiliary macro is not needed.

After several false starts, the approach that worked was to place an \overline atop the phantom of the 1st argument, and stack that in a left-aligned manner over a zero width item. I then followed that with #1, which otherwise has no problems. The #1 lays itself right under the prior \overline, and has no problems picking up sub and superscripts.

\documentclass[]{article}%
\usepackage{amsmath}
\usepackage{mathabx}  %causes problems sometimes
\usepackage{stackengine}
\stackMath
\let\svoverline\overline
\def\overline#1{\stackengine{0pt}{}{\svoverline{\phantom{#1}}}{O}{l}{F}{T}{L}#1%
}
\begin{document}

 $\bar{V}_H \bar{V}_H^2$ ~SHORT

 $\widebar{V}_H$ ~~~~~SHORT

 $\overline{V}_H \overline{V}_H^2 $ ~FIXED FOR V

 $\overline{A}_H$ ~~~~FIXED FOR A

 $\overline{c}_H$ ~~~~~WORKS FOR L.C.

\end{document}

enter image description here

Note that the line

\stackengine{0pt}{}{\svoverline{\phantom{#1}}}{O}{l}{F}{T}{L}%

is functionally equivalent to the following four lines:

\def\stackalignment{l}%
\def\stacktype{L}%
\def\useanchorwidth{T}%
\stackon[0pt]{}{\svoverline{\phantom{#1}}}%
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.