0

I am using a latex template and the following codes appear the file. I was wondering what their functionality is:

\makeatletter
\let\c@equation\c@thm
\makeatother
\numberwithin{equation}{section}

It seems to me the above somehow numbers the equation withing section and within theorems. The last line resets the counter at every section. The first and third line is supposed to change the character so that `@' could be used in the second line.

\newcommand {\sub}{\mbox{SB}}

This code is totally mysterious to me.

3

\let\c@equation\c@thm makes the counter for equations identical to the one for theorems (assuming that the thm counter is indeed used for theorems). In more detail, counters are referenced by a counter number inside the guts of TeX, and \c@equation expands to the number of the equation counter.

\newcommand {\sub}{\mbox{SB}} creates a command \sub which typesets the two letters “SB” as a single unit. Why the author of the template wanted this, is a different question, which I can't answer. Perhaps you can get some idea by seeing how the command is used elsewhere.

| improve this answer | |
  • 1
    this answer is correct, but there's an easier way to do this when using amsthm or amsart. that is, declare \numberwithin{equatnion}{section} \newtheorem{thm}[equation]{Theorem}. so, to some extent, if numbering the theorems in sequence with equations is wanted, it depends on what documentc class and/or packages are being used. – barbara beeton Aug 6 '17 at 18:35

Your Answer

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

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