Sign up ×
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.

This document

\newcommand{\mycommand}{Here is the command}
Here is the lemma

is perfectly compiled but the problem is that TeXStudio says that \begin{lemma} \end{lemma} are unrecognized commands when I put the pointer on them and they have an horrible orange background (I know how to disable this but I don't want to because that feature is useful). The same happens when I define another environments. I often define a couple of theorem environments.

But the strange thing is that when I define a new command, TeXStudio does recognize it and the autocompletion feature works with both the new command and the new theorem environments (when I write \begin{lem} a box is shown with my new environment which is cool).

I'd like that TeXStudio recognize my environments.

share|improve this question
possible duplicate of TeXStudio doesn't recognize some commands –  egreg Apr 12 '12 at 22:58

3 Answers 3

It worked for me when I checked all the options in Options > Configure TexStudio > Completion > Use following completion files. I do not know which header file we need to use particularly in this case.

You may also see the post at TeXStudio doesn't recognize some commands

share|improve this answer
the problem is not the completion, it works pretty well, the problem is that TeXStudio does not recognize my new environment. –  Anon Mar 14 '12 at 0:24

According to the SourceForge TeXstudio forum entry
this is solved when using the SVN version of TeXstudio and is fixed.

The proposed solution is to

  1. Use the SVN version; or
  2. Wait for the updated release (possibly 2.4).
share|improve this answer

I have a similar problem (using TexStudio 2.9.4, so the problem was not totally resolved by 2.4 as announced), but it does not occur when defining a new environment THAT HAS NO PARAMETER, but only if my new environment HAS A PARAMETER:



% this works, and in the editor is diplayed correctly:

    without parameter

% all the following work also, but "\begin{..}" is marked as error in the editor as described above

    with parameter, empty value

    with parameter, some value

    with optional parameter, no value

    with optional parameter, empty value

    with optional parameter, some value

share|improve this answer
Welcome to TeX.SX! –  Christian Hupfer Jul 15 at 12:44

Your Answer


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.