TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I might be doing something stupid, but the following code produces a document with the first equation unnumbered (only an empty set of parentheses is given). The second equation is correctly numbered as 1.1.2. If I remove the change to \theequation, then everything is counted normally.

\setmainfont[BoldFont={* Bold},ItalicFont={* Italic},BoldItalicFont={* Bold Italic},SlantedFont={Linux Libertine Slanted O}]{Linux Libertine O}
\title{A test document}
Test document.
Test document.

I’ve also tried removing various non-essential declarations from the preamble with no success.

share|improve this question
Thank you for pointing out my moment of illiteracy. That did it. :) – AstroPig7 Dec 7 '12 at 20:45
up vote 3 down vote accepted

amsmath's \numberwithin{<slave>}{<master>} does a couple of things. It:

  1. checks whether the counters <slave> and <master> exist. If they do, then it
  2. redefines the presentation of the <slave> counter to include the master using the format <master>.<slave>; and
  3. adds <slave> to the reset list of <master>. That is, <slave> will reset to 0 whenever <master> is incremented.

Here it is, in super high definition, from amsmath.sty:

      \@xp\xdef\csname the#2\endcsname{%
        \@xp\@nx\csname the#3\endcsname .\@nx#1{#2}}}}%

So, you would only need


to achieve what you're after.

share|improve this answer

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.