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.


  • 1
    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. Jul 21 '14 at 21:24

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


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

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

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


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


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)

enter image description here


\usepackage[paper size={12cm,8cm}

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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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