3

I'm a math and latex novice, and I'm trying to write out the following rule with latex:

enter image description here

I'm having a hard time with this capital R. In the textbook, it has that nice side padding but when I type something like x R y, it's all squashed together.

As for the cancelled syntax, x \cancel{R} y seems to do the trick, but I'm not sure if that's the right way.

Sandy G
  • 42,558

2 Answers2

8

Make a new symbol enclosed in \mathrel.

enter image description here

\documentclass{article}

\newcommand{\rel}{\mathrel{R}}

\begin{document}

$a\rel b\not\rel c$

\end{document}

Sandy G
  • 42,558
1

This is happening because math mode gobbles whitespace. In order to get nice spacing you have to use one of a series of whitespace commands, like \;

This image gives you all of them, but for this formula try (using two dollar signs centres a formula and puts it on it's own line):

\[x R y\]
\[x\;R\;y\]

This renders as:

(thanks to Sandy G for the edits)

Nick
  • 11
  • 1
    In LaTeX you should always use \[...\] instead of $$...$$. Explanation here. Also, for a relation you should use \; to imitate the spacing. The command \: produces the (slightly smaller) spacing used for binary operations like +. – Sandy G Aug 31 '23 at 18:55