$\leadsto$
cause
How one can write this from right to left?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this community(Remark: Please be sure to check out Heiko's extended/improved solution as well.)
Here's a solution that builds on and refines Christian Hupfer's suggestion. The two new macros -- called \flowsfroma
and \flowsfromb
in the following code -- produce very similar, but not identical, left-pointing squigglies: The first macro performs a rotation of 180 degrees; the second performs a reflection around a centered vertical axis.
\documentclass{article}
\usepackage{amssymb} % for "\leadsto" macro
\usepackage{graphicx} % for "\rotatebox" and "\reflectbox" macros
\newcommand\flowsfroma{\mathrel{\vcenter{\hbox{\rotatebox{180}{$\leadsto$}}}}}
\newcommand\flowsfromb{\mathrel{\reflectbox{$\leadsto$}}}
\begin{document}
$u \leadsto v$
$v \flowsfroma u$
$v \flowsfromb u$
\end{document}
\reflectbox{...}
is shorter than \vcenter{\hbox{{% \rotatebox[origin=center]{180}{$\leadsto$}}}}
– AlexG
Aug 28 '17 at 11:39
\rotatebox
-based version puts it on a different vertical position than the original. So I would prefer/recommend the \reflectbox
-based version.
– AlexG
Aug 28 '17 at 11:54
\rotatebox[]{...}{...}
, \rotatebox[origin]{...}{...}
, and \rotatebox[origin=c]{...}{...}
are using the center of the box as origin, but \rotatebox[origin=center]{...}{...}
is the same as \rotatebox[origin=tr]{...}{...}
and differs from origin=c
.
– Heiko Oberdiek
Aug 28 '17 at 16:45
\vcenter{\rotatebox..}
is vertically misplaced, because the symbol is higher than the baseline and is not vertically centered in its glyph bounding box. Therefore, the origin should be placed on the math axis and \vcenter
is not needed. See my answer that provides an implementation.
– Heiko Oberdiek
Aug 28 '17 at 19:27
Your symbol looks similar to the one of stix
package, hence you could use \leftsquigarrow
:
\documentclass{article}
\usepackage{amsmath, amssymb}
\usepackage{stix}
\begin{document}
\[
\leadsto \quad \leftsquigarrow
\]
\end{document}
Otherwise, look at The Comprehensive LATEX Symbol List.
Extended version to Mico's solution:
\mathsurround
is set to zero (\m@th
) to avoid additional
horizontal space if \mathsurround
is not zero.\leadsto
is a symbol, whose horizontal line segment (or the arrow) lies on the
math axis. Therefore, the rotation origin is put on the math axis to
avoid a vertical displacement of the symbol.Full example:
\documentclass{article}
\usepackage{amssymb}
\usepackage{graphicx}
\makeatletter
\newcommand*{\flowsfroma}{%
\mathrel{\mathpalette\math@point@reflection\leadsto}%
}
% Point reflection at point (width/2, math axis).
% Package graphicx is required.
\newcommand*{\math@point@reflection}[2]{%
% #1: math style
% #2: math symbol
\begingroup
% Height of box 0 is math axis
\setbox0=\hbox{$#1\vcenter{}$}%
\rotatebox[y=\ht0]{180}{$#1#2\m@th$}%
\endgroup
}
\newcommand*{\flowsfromb}{%
\mathrel{\mathpalette\math@reflect@box\leadsto}%
}
% Reflection at the y-axis.
% Package graphics is required.
\newcommand*{\math@reflect@box}[2]{%
% #1: math style
% #2: math symbol
\reflectbox{$#1#2\m@th$}%
}
\makeatother
% Test part
\usepackage{xcolor}
\newcommand*{\TestAux}[2][\textstyle]{%
\sbox0{$#1u#2v$}%
\leavevmode
\rlap{\textcolor{green!50!white}{%
$#1\vcenter{\hrule height .05pt depth .05pt width\wd0}$%
}}%
\copy0 %
}
\newcommand*{\Test}[1]{%
\TestAux[\textstyle]{#1} %
\TestAux[\scriptstyle]{#1} %
\TestAux[\scriptscriptstyle]{#1}\par
}
\begin{document}
\Test\leadsto
\Test\flowsfroma
\Test\flowsfromb
\end{document}
The thin light green lines mark the math axis.
If you prefer the “old” symbol:
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\DeclareFontFamily{U}{lasy}{}
\DeclareFontShape{U}{lasy}{m}{n}{
<-5.5> lasy5
<5.5-6.5> lasy6
<6.5-7.5> lasy7
<7.5-8.5> lasy8
<8.5-9.5> lasy9
<9.5-> lasy10
}{}
\DeclareRobustCommand{\Leadsto}{%
\mathrel{\text{\usefont{U}{lasy}{m}{n}\symbol{"3B}}}%
}
\DeclareRobustCommand{\rLeadsto}{%
\mathrel{\text{\reflectbox{\usefont{U}{lasy}{m}{n}\symbol{"3B}}}}%
}
\begin{document}
$A\Leadsto B\rLeadsto C$
\end{document}
\rotatebox{180}{$\leadsto$}
? Needs thegraphicx
package – user31729 Aug 28 '17 at 11:24\reflectbox{$\leadsto$}
, for it appears at the same vertical position as $\leadsto$. – AlexG Aug 28 '17 at 11:37