# overline over no text

Suppose I want to have the function $\bar: A \to B$ where instead of $\bar$ it's a longer bar. What is the proper way to do this? Note that the bar here is floating on top of no text. It's just floating.

I also wasn't sure what tags to use. Sorry.

Thanks.

-
Welcome to TeX.sx! :) –  clemens Jul 21 '14 at 19:09
I wouldn't go for that notation. It would be clearer to write it out: We define $x\to \overline{x}$ as a map $A\mapsto B$. Or something like that, I'm not a very good English speaker. If you go for the direct notation anyways, use parentheses to clarify the notation: $(\overline{\phantom{A}}):A\mapsto B$. –  yo' Jul 21 '14 at 19:19
Not what you're asking about but $f\colon A\to B$ puts the colon in the right place: something like f: A -> B instead of f : A -> B. –  David Richerby Jul 21 '14 at 21:24

If I understand what you're trying to do, you can use \overline{\phantom{<text>}}:

\documentclass{article}
\pagestyle{empty}
\begin{document}

$\overline{\phantom{A}}: A\to B$

$\overline{\phantom{AA}}: A\to B$

$\overline{\phantom{AAA}}: A\to B$

\end{document}
-

If I may, there is another alternative that provides more flexibility. i.e., Use of

\rule[raise-height]{width}{thickness}

The \rule command is used to produce horizontal lines. The arguments are defined as follows.

raise-height specifies how high to raise the rule (optional)

width specifies the length of the rule (mandatory)

thickness specifies the thickness of the rule (mandatory)

Code

\documentclass{article}
\usepackage[paper size={12cm,8cm}
\pagestyle{empty}
\begin{document}

baseline + 0cm \hfil shorter \hfil thicker

\hfil $\rule[0cm]{1cm} {0.1pt}: A\to B$
\hfil $\rule[0cm]{0.5cm} {0.1pt}: A\to B$
\hfil $\rule[0cm]{1cm} {1pt}: A\to B$  \hfil

\medskip    baseline + 0.1cm    \medskip

\hfil $\rule[0.1cm]{1cm} {0.1pt}: A\to B$
\hfil $\rule[0.1cm]{0.5cm}{0.1pt}: A\to B$
\hfil $\rule[0.1cm]{1cm} {1pt}: A\to B$ \hfil

\medskip    baseline + 0.3cm     \medskip

\hfil $\rule[0.3cm]{1cm} {0.1pt}: A\to B$
\hfil $\rule[0.3cm]{0.5cm}{0.1pt}: A\to B$
\hfil $\rule[0.3cm]{1cm} {1pt}: A\to B$ \hfil

\medskip    baseline + 0.5cm    \medskip

\hfil $\rule[0.5cm]{1cm} {0.1pt}: A\to B$
\hfil $\rule[0.5cm]{0.5cm} {0.1pt}: A\to B$
\hfil $\rule[0.5cm]{1cm} {1pt}: A\to B$ \hfil

\end{document}
-