I want to write something like this:
But doing \leftarrow{\$}
does not produce the desired result. Any ideas?
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 communitySomething like this?
\documentclass{article}
\begin{document}
$ {\leftarrow}\vcenter{\hbox{\scriptsize\rmfamily\upshape\$}} $ or
$ {\leftarrow}\vcenter{\hbox{\tiny\rmfamily\upshape\$}} $
\end{document}
Addendum, to incorporate some additional information provided by the OP in comment. It looks like this symbol should be assigned the type "mathrel" ("relational operator"). E.g., one could define a macro called (say) \getsdollar
as follows:
\newcommand\getsdollar{\mathrel{{\leftarrow}\vcenter{\hbox{\tiny\rmfamily\upshape\$}}}}
and then write x\getsdollar \mathbb{Z}/n\mathbb{Z}
in the body of the document (in math mode, of course).
\rmfamily\upshape
directives to address it. :-)
A version that scales in subscripts and superscripts. Use a different factor than 0.7
if you want a smaller dollar sign.
\RequirePackage{fix-cm}% arbitrary scaling
\documentclass{article}
\usepackage{amsmath}
\newcommand\leftarrowS{\leftarrow\joinrel\smalldollar}
\newcommand\rightarrowS{\smalldollar\joinrel\rightarrow}
\makeatletter
\newcommand{\smalldollar}{\mathrel{\mathpalette\small@dollar\relax}}
\newcommand{\small@dollar}[2]{%
\vcenter{\hbox{%
$#1\textnormal{\fontsize{0.7\dimexpr\f@size pt}{0}\selectfont\$}$%
}}%
}
\makeatother
\begin{document}
$A\leftarrowS B\rightarrowS C$
$\scriptstyle\leftarrowS$
\end{document}
\documentclass[10pt,a4paper]{article}
\usepackage{tikz}
\newcommand{\ArrowS}[1][1]{%
\tikz[baseline=(a.base)]
\draw[stealth-,shorten >=4pt] (0,0)--(#1,0)
node (a) {\$} ;
}
\begin{document}
Foo \ArrowS Foooooo \ArrowS[3]
\end{document}
The easiest way would be with the cryptocode
package.
To get the sampling operator you'll need to load it with the "operators" option.
\documentclass{standalone}
\usepackage[operators,sets]{cryptocode}
\begin{document}
$r \sample \ZZ_p^+$
\end{document}
$ \leftarrow\$ $
?mathrel
status. I'll post an addendum to my answer.