4

Say I want to look for occurances of a variable Y in a .tex file in texniccenter. Then it would make sense to restrict the search to occurances of Y that occur in a math environment. Thus the Y in

\begin{align}
Y=X^2
\end{align}

should be found, but the Y in

Ay, ay, sir!

should not. Is this possible?

willem
  • 2,341

1 Answers1

4

Write

\mathcode`Y = "8000 % cap Y
\mathcode`y = "8000 % small y

and you get an error in the line containing math Y (y).

  • Aah, this is a way to make LaTeX give you the locations of the variables. Not exactly what I asked, but useful anyway – willem Jun 28 '11 at 10:54