6

I just want to format a simple set theory example. But the following is annoying:

See how close the cap gets to the 'A' because of the tilde sign? I've used sim for the tilde sign. Any suggestions?

Martin Scharrer
  • 262,582
Algific
  • 315
  • Hi, welcome to tex.sx. A minimal document which generates this two lines would be very helpful, so that we can see which packages you are using and to test our answers. – Martin Scharrer Feb 25 '11 at 14:33
  • $A$$=$$(A \cup B)$ $A \cap (( A) \cap B)$ $= $ $ A \cap \sim B$ I use all the $$ to get extra space between the items. – Algific Feb 25 '11 at 14:55
  • 1
    better to edit your answer and place your sample code in there, rather than put it in a comment. Indent it with four spaces to have it formatted like code. – Matthew Leingang Feb 25 '11 at 15:44

4 Answers4

10

You could avoid the binary operator spacing by writing {\sim} or \mathord{\sim}, achieving the same. You might have another look at Spacing around a character in math mode.

Stefan Kottwitz
  • 231,401
2

You could use one of the following commands:

\, (\thinspace) 
\: (\medspace)
\; (\thickspace)
\quad 
\qquad

(They generate different spaces, but I don't know how to mark them in the code.) See also the short math guide, p. 11.


EDIT: This solution should't be used here (see comments below). However, I'll not delete it as there is no harm to know about these commands.

meep.meep
  • 16,905
  • You received a downvote because manual adjustments are not desirable in typesetting (although sometimes unavoidable); the whole point of using TeX is to forget about let the typesetting system worry about consistently positioning and spacing stuff around, allowing you to focus on the actual content. Compare this with the attitude of a Word/OO.o user, where manual adjustments and tweaks are the norm, rather the exception -- with unsurprisingly unimpressive results. – Martin Tapankov Feb 26 '11 at 06:43
  • +1 from me, because these macros are more in the philosophy of math mode than stopping and starting math mode to insert spaces in LR mode. But I agree with Martin that these adjustments are seldom necessary. – Matthew Leingang Feb 26 '11 at 18:03
  • +1 from me too, specially in math mode. I just needed them. – Algific Feb 26 '11 at 19:14
  • Martin's quite right, in this case it's not good to use those manual adjustments since there's a clean solution. But of course it's good to know the adjustments. – Hendrik Vogt Mar 02 '11 at 14:18
1

I believe it's doing that because \sim is meant as a binary operator (between two elements), rather than as a unary prefix operator (like set complement or negation).

You can always manually fix it up with extra space \; or negative space \! so for example, this looks approximately right:

A\; \cap \sim\!\!B
1

Here is a complete code example with output (I just took Stefan's answer and wrote it out).

\documentclass{standalone}
% TEX.SE \url{}
\setlength{\textwidth}{4in}
\begin{document}
\Huge
$A = (A \cup B)$

$A \cap (( A) \cap B) = A \cap \mathord{\sim}B$ \end{document}

sample output

Switching in and out of math mode is not a good way to get extra spaces. If you still want them after classifying the tilde as an ordinal, you can insert them with \,, \; , or \ . See Herbert's mathmode document for FMTYEWTK.

David Carlisle
  • 757,742
Matthew Leingang
  • 44,937
  • 14
  • 131
  • 195