Why can't my Latex editor convert these equations below?
(x,−2x,x)+(y,−2y,y)=(x+y,−2(x+y),x+y) ∈ E
{(x,−2x,x)∣x∈R}
These are the codes I tried:
$(x,−2x,x)+(y,−2y,y)=(x+y,−2(x+y),x+y) \in E$$ \ {(x,−2x,x) \mid x \in R \ }$
Why can't my Latex editor convert these equations below?
(x,−2x,x)+(y,−2y,y)=(x+y,−2(x+y),x+y) ∈ E
{(x,−2x,x)∣x∈R}
These are the codes I tried:
$(x,−2x,x)+(y,−2y,y)=(x+y,−2(x+y),x+y) \in E$$ \ {(x,−2x,x) \mid x \in R \ }$LaTeX does not silently fail, if there is an error it is reported on the terminal and log file.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
$(x,−2x,x)+(y,−2y,y)=(x+y,−2(x+y),x+y) \in E$
\end{document}
has terminal output
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-02-24>
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/home/davidc/texmf/tex/latex/l3backend/l3backend-pdftex.def)
No file cc134.aux.
! LaTeX Error: Unicode character − (U+2212)
not set up for use with LaTeX.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.7 $(x,−
2x,x)+(y,−2y,y)=(x+y,−2(x+y),x+y) \in E$
?
Where the linebreak highlights the location of the error, and the message explains the problem that − is not known.
You could retype the expression with a normal ascii - character or declare the Unicode − to act like - with \DeclareUnicodeCharacter{2212}{-}
\documentclass{article}
\usepackage{amsmath}
\DeclareUnicodeCharacter{2212}{-}
\begin{document}
$(x,−2x,x)+(y,−2y,y)=(x+y,−2(x+y),x+y) \in E$
\end{document}
runs with no error and produces
When we are using Unicode math then we have no problem, because your character is Unicode minus. For example in OpTeX:
\fontfam[lm]
$(x,−2x,x)+(y,−2y,y)=(x+y,−2(x+y),x+y) \in E$
\bye
gives expected result. Moreower, you can use the ∈ directly, if you know how to type it on your keyboard:
\fontfam[lm]
$(x,−2x,x)+(y,−2y,y)=(x+y,−2(x+y),x+y) ∈ E$
\bye
{...}in LaTeX needs\{...\}and the vertical line in Eq. (2) can use\midto ensure necessary space. – Teddy van Jerry Mar 27 '22 at 12:15$\{ (x,-2x,x)\mid x\in R\}$– daleif Mar 27 '22 at 12:30−) is not the standard ASCII-. And so is the vertical line. – Teddy van Jerry Mar 27 '22 at 12:33