1

I'd like to use symbol \sim as the name of a set, and write expressions such as $x \in \sim$. But \sim is treated by TeX as a relation symbol and as a result the spacing around \in isn't quite right. Is there a way to signal to TeX that I'm using \sim as a standalone symbol so that it adjusts the spacing accordingly? Or am I better off adjusting the spacing manually?

2
  • 1
    Like \mathord{\sim}? Best done in a macro, I guess.
    – mickep
    Jan 15, 2023 at 18:40
  • 3
    Besides Mickes suggestions you also should be able to use {\sim} (AFAIR). But do make a macro for it. This is especially important when you're using a syntax where a symbol can now mean two or more things. The prime example is | which can mean so many things in math. Whenever I edit manuscripts, it is not allowed to have any | in the body of the text. They should be replaced by a more contextually precise macro.
    – daleif
    Jan 15, 2023 at 18:51

1 Answer 1

3

I'm not sure your readers will be happy, but you're the judge.

The main point is that with \mathord\sim you make \sim into an ordinary atom, just like a standard letter. This can be shortened to {\sim}.

However, it's better to define a personal command for it, particularly if you also use \sim in its binary relation nature. And, maybe, after pondering the usage as an ordinary symbol you decide to change the appearance. Having your typescript full of {\sim} would require a very tedious job of “find and replace”.

\documentclass{article}
\usepackage{amsmath}

\newcommand{\simset}{\mathord\sim}

\begin{document}

$x\in\simset$

$x\sim y$

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .