I'm pretty new to Latex, so please bare with me.
I'm trying to add this notation to my document:
I created the above picture from the Online Latex Equation Editor, but it seems that when I try to apply the same code in my editor (TeXstudio), things are different...
For example, the above picture was produced using the code:
D=\left\{ x\in\mathbb{N}|1\leq x\leq 100 \right\}
But when I write it in my editor (enclosed in the $ sign of course), I get the following error when compiling:
Undefined control sequence. $D=\left{x\in \mathbb
The funny thing is that I was still able to see the output in the preview window (even though the editor shows that this line has error in it).
That's the first problem.
The second problem is, although I can see the output in the preview window, it won't be the same as the output I get from the Online Latex Equation Editor.
While the Online Latex Equation Editor produces this:
My TeXstudio editor produces this:
Notice the distinction in the N symbol that denotes the set of natural numbers. It is different the what I intended, which is the first version, as it produced by the Online Latex Equation Editor.
What's wrong here? Am I missing a package or something?
\mathbb
you should have\usepackage{amssymb}
(or\usepackage{amsfonts}
, but better to have the bigger thing). The bar should be\mid
for correct spacing. Note that\left
and\right
here serve no purpose.{...|...}
sets: tex.stackexchange.com/a/25411/11002