3

I'd like double bars over my X, that I can get using these overline symbols

\[\overline{\overline{X}}\]

I also tried the bar symbols, but they're misaligned over the X.

\[\bar{\bar{X}}\]

What I end up with is two bars, but the spacing seems too large between the bars. How do I decrease the spacing with double bars?

enter image description here

  • 1
    You can see also https://tex.stackexchange.com/a/364929/4427 for using \widebar from mathabx – egreg Apr 29 '19 at 14:59

1 Answers1

6

A general version that works across math styles.

\documentclass{article}
\usepackage{amsmath,scalerel}
\newcommand\doverline[1]{\ThisStyle{%
  \setbox0=\hbox{$\SavedStyle\overline{#1}$}%
  \ht0=\dimexpr\ht0-.15ex\relax% CHANGE .15 TO AFFECT SPACING
  \overline{\copy0}%
}}

\begin{document}
$\overline{X} + \doverline{X}$

$\scriptstyle\overline{X} + \doverline{X}$

$\scriptscriptstyle\overline{X} + \doverline{X}$
\end{document}

enter image description here

If you only require it in \displaystyle,

\documentclass{article}
\usepackage{amsmath}
\newcommand\doverline[1]{%
  \setbox0=\hbox{$\overline{#1}$}%
  \ht0=\dimexpr\ht0-.15ex\relax% CHANGE .15 TO AFFECT SPACING
  \overline{\copy0}%
}

\begin{document}
$\overline{X} + \doverline{X}$
\end{document}
  • And I wanted to put an answer like this one :-) much primitive :-) `\documentclass{article}

    \usepackage{mathtools} \usepackage{graphicx} \newcommand{\dbar}{\rotatebox{90}{$\parallel$}} \newcommand{\dsbar}{\rotatebox{90}{$\scriptstyle\parallel$}}

    \begin{document}

    [ \overset{\lower.1em\hbox{\dbar}}{X},\quad \scriptstyle{\overset{\lower.1em\hbox{\dsbar}}{X}}] \end{document}`

    – Sebastiano Apr 29 '19 at 15:32
  • @Sebastiano As they say, there are many ways to skin a cat! – Steven B. Segletes Apr 29 '19 at 15:39
  • It is absolutely true. But I wanted to beat you ahahahah. My regards. – Sebastiano Apr 29 '19 at 15:41