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?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityI 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?
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}
% https://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!!!
\newcommand\ovunderline[1]{\overline{\underline{#1}}}
.X
with bars above and below close to it, like what is sometimes found for representing Roman numerals?