53

I've looked everywhere, and there does not seem to be a symbol for this, i.e. a \propto with a \sim underneath. I've googled ways of combining these two symbols but haven't found anything satisfactory. Anybody know a simple way of achieving this? \stackrel and \utilde look horrible.

Torbjørn T.
  • 206,688
Seb
  • 531
  • Welcome to TeX.sx! A tip: You can use backticks ``` to mark your inline code as I did in my edit – Torbjørn T. Nov 03 '11 at 12:34
  • 1
    I don't think that \undertilde{\propto} is acceptable: the tilde is quite different from \sim. – egreg Nov 03 '11 at 14:42
  • i'm pretty sure this isn't in unicode (though i haven't checked), but if it's a "recognized" symbol, i can submit it for consideration. for documentation, this needs a published reference, preferably one that shows the symbol in context, and even better if the surrounding text clearly indicates the meaning, for example where the author is stating the symbol definitions for the document. – barbara beeton Nov 04 '11 at 20:26

4 Answers4

42
\newcommand{\approptoinn}[2]{\mathrel{\vcenter{
  \offinterlineskip\halign{\hfil$##$\cr
    #1\propto\cr\noalign{\kern2pt}#1\sim\cr\noalign{\kern-2pt}}}}}

\newcommand{\appropto}{\mathpalette\approptoinn\relax}

If you don't need the symbol also in subscripts or superscripts, then the simpler

\newcommand{\appropto}{\mathrel{\vcenter{
  \offinterlineskip\halign{\hfil$##$\cr
    \propto\cr\noalign{\kern2pt}\sim\cr\noalign{\kern-2pt}}}}}

will do.

enter image description here

Paulo Cereda
  • 44,220
egreg
  • 1,121,712
15

With this code the spacing looks quite acceptable

\documentclass{article}

\usepackage{amsmath}

\def\approxprop{%
  \def\p{%
    \setbox0=\vbox{\hbox{$\propto$}}%
    \ht0=0.6ex \box0 }%
  \def\s{%
    \vbox{\hbox{$\sim$}}%
  }%
  \mathrel{\raisebox{0.7ex}{%
      \mbox{$\underset{\s}{\p}$}%
    }}%
}

\begin{document}
\[
a \approxprop b
\]
\end{document}

All this box stuff doesn't really look nice and there are probably easier ways to do this. However the result looks ok, and you can tweek the vertical position and spacing to whatever you like.

approxsymbol

EDIT: According to the comments from egreg and barbara beeton I've improved the code. Now, what about that?

\documentclass{article}

\usepackage{amsmath}

\def\app#1#2{%
  \mathrel{%
    \setbox0=\hbox{$#1\sim$}%
    \setbox2=\hbox{%
      \rlap{\hbox{$#1\propto$}}%
      \lower1.1\ht0\box0%
    }%
    \raise0.25\ht2\box2%
  }%
}
\def\approxprop{\mathpalette\app\relax}

\begin{document}
\[a \approxprop b\] \centerline{$a \approxprop b$}
\[\sum_{a \approxprop b}\]
\[X_{Y_{a \approxprop b}}\]
\end{document}

The result looks like that

enter image description here

(so I think it looks now ok in all sizes)

Elmar Zander
  • 1,890
  • This code has many redundancies: \vbox{\hbox{...}} can be reduced to \hbox{...} and the \mbox inside \raisebox is useless. Also defining each time \s and \p can be avoided by defining them (with different names) beforehand. – egreg Nov 03 '11 at 14:24
  • 2
    using \hbox or \mbox, the symbol size won't change if this happens to be used in a subscript or fraction (not that that's likely). \text would allow the sizes to change according to the current environment. the \mathrel is a good idea though as it "corrects" the vertical alignment of the composite symbol. – barbara beeton Nov 03 '11 at 16:06
  • @egreg: You were right. The code was pretty ugly, just a quick hack to get the symbol right. I've updated it now, and if there's still anything to improve I'll gladly hear from you. – Elmar Zander Nov 03 '11 at 22:49
  • @barbarabeeton: Thanks for the comment. The size of the symbol adapts now to the environment as it should. – Elmar Zander Nov 03 '11 at 22:50
  • Define \app with two arguments (#2 won't be used) and say \def\approxprop{\mathpalette\app\relax}. Also \kern-\wd0 can be saved by saying \rlap{\copy0} which wouldn't move the current point. Don't use \box1 for local assignments; change all references to \box1 to \box2 and what you have now as \box2 can become \box0 if you use \box instead of \copy (the box is built before performing the assignment to the box register). – egreg Nov 03 '11 at 22:57
  • Great, thanks. There's always so much to learn about TeX. I didn't know \mathpalette (cute) and had completely forgotten about \rlap. What about box1? Is it reserved for something? As boxes are local to a group I wouldn't expect any problem here... – Elmar Zander Nov 03 '11 at 23:17
  • Knuth advises to use odd numbered scratch registers (1, 3, 5, 7, 9) only for global assignments and even numbered ones (0, 2, 4, 6, 8, but also 255) only for local assignments. You find why in the TeXbook (pages 301 and 346) or in TeX by Topic (look for "save stack"). A last remark: \hbox in \rlap is redundant, as \rlap already does \hbox. – egreg Nov 03 '11 at 23:25
5

Does underset look better?

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\underset{\sim}{\propto} \qquad \stackrel{\propto}{\sim}
\]
\end{document}

enter image description here

Torbjørn T.
  • 206,688
2

Does such a symbol officially exist? What about slight variations like \propto\!\!\sim

\propto!!\sim

or \sim\!\propto

\sim!\propto