Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is there any way to typeset in LaTeX a \simeq with a longer bar, or equivalently \stackrel{\sim}{\longrightarrow} without the arrowhead?

share|improve this question

4 Answers 4

I made this for our students how need a similar symbol for statistics

\newcommand\DistTo{\xrightarrow{
   \,\smash{\raisebox{-0.65ex}{\ensuremath{\scriptstyle\sim}}}\,}}

enter image description here

share|improve this answer
    
Thanks, but this still has the arrowhead! –  Adeel Jun 27 '13 at 14:15
    
Sorry, didn't read the question correctly. Though I think the placement is better than just using \stackrel, try combining them –  daleif Jun 27 '13 at 14:24

Try this.

\documentclass{article}
\begin{document}
\[
A \stackrel{\displaystyle\sim}{\smash{\rule[1.5pt]{2em}{0.5pt}}} B
\]
\end{document}

Adjust the parameters as required. You can use \raisebox to raise the whole symbol.

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\[
A \raisebox{0pt}{$\stackrel{\displaystyle\sim}{\smash{\rule[1.5pt]{2em}{0.5pt}}}$} B
\]
\end{document}
share|improve this answer
    
Thanks. \textwidth is way too wide, about 16pt seems to be the same size as \longrightarrow. However, the vertical position is too low. See this picture: i.imgur.com/2qPcqUl.png –  Adeel Jun 27 '13 at 14:01
    
@Adeel --- I have edited my answer to allow vertical adjustment. –  Ian Thompson Jun 27 '13 at 14:31

The following constructs the math symbol \isomorphism similar to \simeq, but with a longer line:

\documentclass{article}

\makeatletter
\newcommand*{\isomorphism}{%
  \mathrel{%
    \mathpalette\@isomorphism{}%
  }%
}
\newcommand*{\@isomorphism}[2]{%
  % Calculate the amount of moving \sim up as in \simeq
  \sbox0{$#1\simeq$}%
  \sbox2{$#1\sim$}%
  \dimen@=\ht0 %
  \advance\dimen@ by -\ht2 %
  %
  % Compose the two symbols
  \sbox0{%
    \lower1.9\dimen@\hbox{%
      $\m@th#1\relbar\isomorphism@joinrel\relbar$%
    }%
  }%
  \rlap{%
    \hbox to \wd0{%
      \hfill\raise\dimen@\hbox{$\m@th#1\sim$}\hfill
    }%
  }%
  \copy0 %
}
\newcommand*{\isomorphism@joinrel}{%
  \mathrel{%
    \mkern-3.4mu %
    \mkern-1mu %
    \nonscript\mkern1mu %
  }%
}
\makeatother

\begin{document}
\[ A \isomorphism B \simeq C = D \sim E \]
\[ A \isomorphism B^{C \isomorphism D^{E \isomorphism F}} \]
\end{document}

Result

Remarks:

  • The line is constructed similar to \longrightarrow. There a line \relbar is joined a \rightarrow. The joining removes the side bearings, which means the glyphs can have white margins at the left and the right. LaTeX's \joinrel adds a negative space of 3mu to move the relational symbols together. The test file uses the symbol in smaller math styles, there -3mu leaves a gap, therefore \isomorphism@joinrel is defined with customized settings (-3.4mu for \displaystyle and \textstyle, -4.4mu for scriptstyle and \scriptscriptstyle).

  • The symbol \sim is horizontally centered and set in the same math style and size. It is raised to the same height as aymbol \simeq.

  • The vertical position of the line in \simeq is unhappily not available in TeX, therefore a guessed value is used (the shift of \sim multiplied by 1.9). If you want the line a little higher, then you can decrease the factor.

  • \mathpalette is used to support the symbol in all math styles. Then the internal macro \@isomorphism gets the math style (\displaystyle, \textstyle, \scriptstyle, \scriptscriptstyle) as first argument. The second argument is not used and left empty.

  • The measuring and glyph composing is done with many low level plain TeX macros for efficiency (and fun).

  • \m@th sets \mathsurround to 0pt. Usually the value is 0pt, but if set, then the space that should surround math expressions should not occur inside a formula or math symbol.

share|improve this answer

Combining some ideas from the answers of @Ian Thompson and @daleif, I think the following is pretty good.

\newcommand{\iso}{\ \raisebox{0.5ex}{\ensuremath{\stackrel{\sim}{\rule{16pt}{0.7pt}}}\ \,}}

enter image description here

share|improve this answer
1  
the rule looks a bit too thick, and the \sim is a bit farther from the rule (or arrow) than one might like. –  barbara beeton Jun 27 '13 at 16:16

Your Answer

 
discard

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.