3

This question already has an answer here:

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

marked as duplicate by egreg math-mode Apr 29 at 14:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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

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