TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This seems to be a dummy one but I haven't found anything that works good for me.

I'm working in an article and I need to get an underlined expression, like this enter image description here

I mean REALLY CLOSE, but, so far, the available options such as \underlying{x} or \underset{_}{x} haven't worked so good because it left a huge vertical space. I need it to be real close of x. Any ideas?

Thanks in advance.

share|improve this question

A \underline seems to work great:

enter image description here

If there is still too much space with you can draw your own \rule and tweak the placement as desired:

enter image description here




\newcommand{\ru}[1]{\raisebox{\BaselineAdjust}{$\substack{\textstyle #1\\[\YShiftContent]\rule[\YShiftRule]{\widthof{#1}}{\LineWidth}}$}}

\[ \int_{R_1} f_x (\ux \mid C_1)\dd \ux \]
or using \verb|\ru| macro:
\[ \int_{R_1} f_x (\ru{x} \mid C_1)\dd \ru{x} \]
share|improve this answer

If you need an underline symbol that's shorter than what's produced by \underline, you could turn to the ushort package and its \ushort macro. The first line below uses the \ushort macro, the second the \underline macro.

enter image description here

\newcommand{\dee}{\operatorname{d\!}{}} % "differential" operator
% see http://tex.stackexchange.com/a/178948/5001
\setlength\textwidth{2in} % just for this example
\[ \int_{R_1} f_x (\ushort{x} \mid C_1)\dee \ushort{x} \]
\[ \int_{R_1} f_x (\underline{x} \mid C_1)\dee \underline{x} \]
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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