[Tex/LaTex] How to create a short upper hyphen

hyphenationsymbols

How can I create a short hyphen, that connects two words in their upper part? The usual hyphen connects the words in their middle part. I tried to detexify it, but got only middle and bottom hyphens, not top hyphens.

Best Answer

There should be many ways of doing what you asked for, the following is one of them.

\documentclass[fleqn]{article}

\begin{document}

When used inside text.

top\raisebox{0.5em}{-}hyphen

\bigskip

And in math mode.

Inline equation,
$x\raisebox{0.25em}{-}y$

\medskip

Displayed equation,

\begin{equation}
  \sin(x\raisebox{0.25em}{-}y)
\end{equation}

\end{document}

Here is the output,

enter image description here

Related Question