# Problem with symbol [duplicate]

I am trying to write a math paper, and I need to write the following symbol:

$\overline{\underline{X}}$

Is there any package that already contains it?

-

## marked as duplicate by Speravir, Werner, Guido, Sean Allred, Gonzalo MedinaFeb 28 '14 at 2:37

I'm not sure whether a macro is defined by some package for that, but you can always define your own, e.g.: \newcommand\ovunderline[1]{\overline{\underline{#1}}}. –  Jubobs Feb 27 '14 at 14:40
Welcome to TeX.SX! What is the notation supposed to represent? –  Sean Allred Feb 27 '14 at 14:43
Do you mean an X with bars above and below close to it, like what is sometimes found for representing Roman numerals? –  egreg Feb 27 '14 at 14:45
Does this question help you? –  Keba Feb 27 '14 at 14:51
We are doing sets and relations between them, and the professor usually writes a capital X with bars connecting the two upper extremities together, and the two lower ones as well. What I do not like about this one is the space between the lines and the letter, I would like to eliminate that –  ruben1691 Feb 27 '14 at 17:31

The \overline{\underline{}} mentioned by Jubobs is easier, if you are happy with that look, unless you wanted to tweak the settings I mention below, or if you want rounded caps on your over/under rules. If you wanted this done on text, rather than math variables, then removing the $ from my definitions will accomplish that. You can perform an over/understack, as shown here. The rule thickness is set to 0.33pt and can be changed. The offset above and below is set to 1pt and can be changed. The commented out code includes a cute package located at Is there such a thing as a \mathrule? (rounded endcaps), which gives rules a round endcap, rather than a chopped off norm of \rule. The image I show includes both versions \documentclass{article} % http://tex.stackexchange.com/questions/161297/is-there-such-a-thing-as-a-mathrule-rounded-endcaps/161309#161309 %\usepackage{roundrule} %\let\rrule\roundrule \usepackage{stackengine} \def\overunderline#1{% \setbox0=\hbox{$#1$}% \stackon[1pt]{\stackunder[1pt]{$#1$}{\rule{\wd0}{.33pt}}}{\rule{\wd0}{.33pt}}% } %\def\roverunderline#1{% %\setbox0=\hbox{$#1$}% % \stackon[1pt]{\stackunder[1pt]{$#1$}{\rrule{\wd0}{.33pt}}}{\rrule{\wd0}{.33pt}}% %} %\parskip 1ex \begin{document}$x\overunderline{x}\overunderline{f}\overunderline{G}y$\par %$x\roverunderline{x}\roverunderline{f}\roverunderline{G}y\end{document}  EDIT: Seeing a comment of the OP, I offer this additional solution: \documentclass{article} \usepackage{stackengine} \def\dbar#1{% \setbox0=\hbox{#1}% \def\stackalignment{r}\stackon[-.25pt]{% \def\stackalignment{l}\stackunder[-.3pt]{%#1\$}{\rule{.95\wd0}{.33pt}}}{\rule{.95\wd0}{.33pt}}%
}
\begin{document}
\dbar X \dbar Y \dbar R
\end{document}


Here are non-italic versions:

\documentclass{article}
\usepackage{stackengine}
\def\dbar#1{%
\setbox0=\hbox{#1}%
\stackon[-.25pt]{\stackunder[-.3pt]{#1}{\rule{.95\wd0}{.33pt}}}{\rule{.95\wd0}{.33pt}}%
}
\begin{document}
\dbar X \dbar Y \dbar R
\end{document}


-

So, thanks to Keba I found the solution. You can use the romanbar package, which puts bars on top and bottom of a letter, without leaving a gap.

\documentclass[]{article}
\usepackage{romanbar}
\begin{document}
\Romanbar{X}
\end{document}


This generates:

Thanks to everyone for their help!!!

-