When I try to compile in my laptop a (synced) tex file wich is perfectly compiling in my desktop computer I get the message:

"! LaTeX Error: No counter 'd' defined."

I reinstalled and updated MikTeX and packages, and deleted aux files, but the problem persists.

Does anybody know what can be the problem and how to solve it?

Thank you very much.

Edit: I think I isolated a bit the problem. A MWE follows:


% mypackages.sty

% STANDARD PACKAGES -------------------------------------------------------

% mypackages.sty




\usepackage{float}         % controls figure positions

% THEOREMS -------------------------------------------------------

% ----------------------------------------------------------------

This is a definition.


Concretely, the issues are:

  • If I compile the code like this, it works.

  • If I include all the packages in "mypackages.sty", and substitute then by \RequirePackage{../../../_config_LaTeX/my_packages} then I get the error:

    "! LaTeX Error: No counter 'd' defined."

  • If I then remove "[thm]" from "\newtheorem{defn}[thm]{Definition}", then it compiles well again.

  • I am only having this problem in my laptop, in my desktop computer everything compiles well.

Hope that these indications help.

  • Without seeing code this is difficult to tell. I don't know a package or class, that uses d as a counter name – user31729 Jun 10 '16 at 20:01
  • 5
    it means you have gone \setcounter{d}{42} without going \newcounter{d} if you do not get an error on the other computer, it is executing different code. – David Carlisle Jun 10 '16 at 20:07
  • 1
    unrelated to your question but \rm has been deprecated since latex2e came out in 1993, but if you do use it it does not take an argument so the syntax is {\rm xxx} not \rm{xxx] – David Carlisle Jun 10 '16 at 21:48
  • 2
    The MWE runs without error, add \listfiles and then run it on the two machines and compare the file lists at the end of each log. – David Carlisle Jun 12 '16 at 19:56
  • 1
    Then there is an error in that local file. – David Carlisle Jun 12 '16 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.