Chevron in MathJax

How do I write a chevron/circum (^) in MathJax? A backslash doesn't work as an escape character.

(Specific context: using x^y to mean XOR as in $$x\oplus y$$. It's not my choice of notation so don't tell me that I can just use a different symbol.)

Is $$x\hat{}y$$ acceptable? Gotten with $x\hat{}y$. In-line I have used $x$^$y$ which produces $$x$$^$$y$$. To get that effect in a displayed formula, an obvious work around is to wrap it in a text box $$\text{x^y}$$ produced with the snippet $$\text{x^y}$$.

• I'm sure TeXperts know of better ways, but tweaks like that were common in the plainTeX-era. May 14 '20 at 9:28

I'd imagine $$\land$$ would be the right symbol here as an operator, so \land (logical and) or \wedge will produce $$\land$$ (and $$\wedge$$).

But it might not be the same as $$x$$^$$y$$ if you write $$x\land y$$. It's up to you to decide if you like it or not. In either case, be sure to clarify the notation, which normally means "and" rather than "xor".

You can try $$x^\land y$$ as well.

• I can see a typeset version of the symbol (but not its source) and it's definitely a superscript rather than an infix.
– A.M.
May 14 '20 at 10:58
– Asaf Karagila Mod
May 14 '20 at 10:58
• Ah, using a superscript and \land hadn't occurred to me. Good idea.
– A.M.
May 14 '20 at 12:16
• The spacing above bothers me, as the caret is being parsed as a superscript on $x$. Perhaps $x\mathbin{{}^\land} y$ would work? This is typeset as $x\mathbin{{}^\land} y$. I also think that \land should probably be replaced by \wedge (they are synonymous and are typeset identically, but \wedge feels more general).
– Xander Henderson Mod
May 14 '20 at 23:56
• @Xander: Yes, I was also bothered by this. I'd think you suggest the right approach here. Or with a lack of spacing, $x{{}^\wedge\!}y$.
– Asaf Karagila Mod
May 15 '20 at 0:01

The first time you use MathJax in a post, use this command:

\newcommand{\^}{\text{^}}

If you apply it by itself, it will just make a tiny blank space: $$\newcommand{\^}{\text{^}}$$.

Thenceforth, every time you use \^, you will get a chevron: $$x\^y$$.