[Tex/LaTex] How to draw an isomorphism arrow in tikz-cd

diagramstikz-arrowstilde

I want to show an arrow for an isomorphism in a commutative diagram. Currently I'm using

\ar[rr, dotted, "\textasciitilde", "\funcname{f}''"']

but there is two much vertical space between the Tilde and the arrow. What is the proper way to do this in tikz-cd?

Best Answer

I didn't quite understand at first what you wanted to achieve. So here's the final version (thanks to @egreg for the help).

Output

enter image description here

Code

\documentclass[margin=10pt]{standalone}
\usepackage{tikz-cd}

\begin{document}

\begin{tikzcd}
A \ar[r, dotted, "\sim", "f''"'] & B
\end{tikzcd}

\end{document}