Latex Code for One Set Minus Another .... .... A\B .... ....

  • Context: LaTeX 
  • Thread starter Thread starter Math Amateur
  • Start date Start date
  • Tags Tags
    Code Latex Set
Click For Summary

Discussion Overview

The discussion revolves around the correct usage of LaTeX code for representing set operations, specifically the notation for one set minus another, such as A\B. Participants explore various methods to achieve the desired output and address issues related to syntax errors in LaTeX.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes an issue with using the command \K in LaTeX, leading to an undefined command error.
  • Another participant suggests using \mathbb{R}^n\text{\\}K as a potential solution, although they express uncertainty about the necessity of escaping the backslash.
  • Further contributions mention alternative commands such as \mathbb{R}^n\backslash K and \mathbb{R}^n\setminus K, noting differences in spacing.
  • A participant highlights the "Detexify" tool available in the editor, which allows users to draw characters to find corresponding LaTeX code.
  • There is a reiteration of the issue with the undefined command \K and clarification that TeX commands typically consist of a backslash followed by letters.

Areas of Agreement / Disagreement

Participants express varying opinions on the best approach to writing the LaTeX code for set subtraction, with multiple proposed solutions and no consensus on a single correct method.

Contextual Notes

Some participants note the peculiarities of LaTeX syntax, particularly regarding the use of escape characters, which may lead to confusion for users unfamiliar with the rules.

Math Amateur
Gold Member
MHB
Messages
3,920
Reaction score
48
Recently I posted the following text on the Analysis forum ..." ... ... In order to demonstrate that $$K$$ is closed, we prove that $$\mathbb{R}^n\K$$ is open. Indeed, choose $$y \notin K$$ and define $$O_j = \{ x \in \mathbb{R}^n \ \mid \ \mid \mid x - y \mid \mid \gt \frac{1}{j} \}$$ for $$j \in \mathbb{N}$$. ... ... "... and (as I did above) got a red \K in \mathbb{R}^n\K presumably because I'm misusing a special character \ in the code ...

What is wrong with what I've done and how do I correct it?

Further, how does one correctly write Latex code for one set minus another as in A\B?

Peter
 
Physics news on Phys.org
This works, although there might be a better solution...

\mathbb{R}^n\text{\\}K

gives:

$$\mathbb{R}^n\text{\\}K$$
 
MarkFL said:
This works, although there might be a better solution...

\mathbb{R}^n\text{\\}K

gives:

$$\mathbb{R}^n\text{\\}K$$
Thanks Mark ... but seems strange to me that two \s are required in text{ \\ } ... but then ... hey ... that's the rules of the code :)

Thanks again ...

Peter
 
Peter said:
Thanks Mark ... but seems strange to me that two \s are required in text{ \\ } ... but then ... hey ... that's the rules of the code :)

Thanks again ...

Peter

Yeah, you have to escape the escape character to get a literal character. :)

You can also use:

\mathbb{R}^n\backslash K

or:

\mathbb{R}^n\setminus K (this one has more padding to the left and right of the slash)
 
I also want to point out that in the "MHB Widgets" block to the right of the editor is "Detexify" listed as the second entry in the list, and clicking that will popup a window into which you can draw a character you wish to use, and it will give you in most cases several options to try. (Yes)
 
MarkFL said:
\mathbb{R}^n\setminus K (this one has more padding to the left and right of the slash)
This is the correct solution.

Peter said:
What is wrong with what I've done and how do I correct it?
The command \K is undefined. TeX commands usually consist of a backslash followed by letters.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 0 ·
Replies
0
Views
3K
Replies
11
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K