3

I write code:

$\sim(p\land q)\iff (\sim p\lor \sim q)$

and my output is like this:

siple logic law with werid spacing between letter and logic symbol

As you can see, the \land symbol is nice in between 'p' and 'q', but the \lor symbol stick somehow to the left, to the 'p' without space. I could manually "fix" it with forcefully added space, but I don't understand why the left and right side would have different output. Why in one example it stick to letter before, in second not. Am I doing something wrong? Is there better way to fix it without adding \; in math mode?

  • 4
    \sim is set up as a binary relation (like =) and you are using it as a prefix negation so you want to define a command that is equivalent to \mathord{\sim} (or equivalently just {\sim} (or perhaps \mathop) – David Carlisle Sep 29 '19 at 12:14
  • 1
    The negation symbol intended to go with \lor and \land is \lnot, though of course you could decide you don't like how it looks. I wonder if in that case it would not be more idiomatic to redefine \lnot to have the appearance of \mathord{\sim}. – Misha Lavrov Sep 29 '19 at 21:04
7

\sim is set up as an infix relation so has the spacing of = which affects the spacing of adjacent binary operators, you want a \mathord (like a letter) or perhaps better \mathop (like \log) symbol as you are using this as a prefix operator.

enter image description here

\documentclass{article}

\begin{document}

$\sim(p\land q)\iff (\sim p\lor \sim q)$

${\sim}(p\land q)\iff ({\sim} p\lor {\sim} q)$

$\mathop{{}\sim}(p\land q)\iff (\mathop{{}\sim} p\lor \mathop{{}\sim} q)$

\end{document}
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.