Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm starting to use TeXStudio. I'm having some issues, for example with

\begin{align*}
\sqrt[n]{a}^2-\sqrt[n]{ab}&=m\sqrt[n]{a}\\
\end{align*}

When i put the point on align* i get a small message unrecognized command, when it is in \sqrt or ^ i get the message math command outside math env, and something similar happens with & when it gives me the message tabular command outside tabular env. These commands are highlighted with an orange background.
I have similar mistakes with \eqref,\implies. Some commands as \title,\author or \sqrt(when it is between dollar signs) don't present any problem.

When i build the PDF, i have no problems at all and it gives me the desired result.
I'd like that TeXStudio recognize these commands

share|improve this question

1 Answer

up vote 2 down vote accepted

TeXStudio recognises commands that it finds in files ending with .cwl. The \eqref command and the align* environment come from the amsmath package, so you need to make sure that amsmath.cwl is loaded. Under some circumstances, this will happen automatically, but the mechanism isn't foolproof (e.g. it doesn't know that amsmath can be loaded indirectly via \usepackage{mathtools}).

On a Mac, you can ensure that amsmath.cwl is loaded by going to

Options --> Configure TeXStudio

selecting Completion on the left and checking the box next to amsmath.cwl. Presumably the procedure is similar on other operating systems. If the other unrecognised commands also come from packages for which TeXStudio has cwl files, activate these as well. Section 1.4 of the TeXStudio manual explains how to add your own cwl file for commands that do not come from standard packages.

share|improve this answer
Same can be done on Win7(x64) – Stat-R May 7 at 14:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.