Consider the following latex
document.
\documentclass{article}
\usepackage{tikz}
\begin{document}
Consider the following picture.
\[
\begin{tikzpicture}
\node (X) {X}; % this X should be enclosed in a dollar sign to be in math mode
\node[right of= X] (Y) {Y}; % this Y should be enclosed in a dollar sign to be in math mode
\draw[->] (X.east) -- (Y.west);
\end{tikzpicture}
\]
\end{document}
I want to enclose the X
and Y
in the tikzpicture
environment with dollar signs (because I want them typeset in math mode). However, when I attempt to do so, emacs throws an error in the minibuffer reading Math mode started with '\[' cannot be closed with dollar
.
What's wrong here?
I'm using GNU Emacs 27.1
with AUCTeX-version 12.3.1
.
Note that this is not a latex question since my desired code (below) compiles fine in latex.
\documentclass{article}
\usepackage{tikz}
\begin{document}
Consider the following picture.
\[
\begin{tikzpicture}
\node (X) {$X$};
\node[right of= X] (Y) {$Y$};
\draw[->] (X.east) -- (Y.west);
\end{tikzpicture}
\]
\end{document}