[OS X TeX] "! LaTeX Error: No counter 'a' defined."

Don Green Dragon fergdc at Shaw.ca
Sat Dec 18 22:33:40 EST 2010

Hi John B,

According to George Gratzer's book "More Math into LaTeX", on page 4 he states:

"The name of a LaTeX source file should be one word (no spaces, no special characters), and end with .tex."

From your error messages, it appears that you have a source file (for example) <ch.geom.tex> (without < and >) and that first occurrence of '.' may be the culprit. Each of the error messages appears to be complaining about an \include line.

Did you try the suggestion made by Ross Moore?

However, I did mimick your example and encountered no problems! The test and root file was:

\author{Don Carvel}




The results were:

(1) When both \includeonly lines were commented out, the title page, table of contents, and both chapters were okay in the PDF preview console.

(2) With the setup above, only chapter 2 and the table of contents appeared in the PDF file, as should be, I think.

(3) With the setup


then only chapter 1 and the table of contents appeared.

(4) With the setup


the PDF was a repeat of trial (2). I.E., only the last \includeonly was acted on. There were no complaints!!! I was surprised.

Mind you the files Chap1.copy.tex and Chap2.copy.tex were totally trivial -- just text ..... well ..... text, one \chapter and one \section command in each chapter.

But the experiment castes doubt on whether the period character is the culprit.

I suggest working with but two included files, and see if you can track down the problem.

On 2010-17Dec-, at 1:54 PM, John B. Thoo wrote:

> Hi, everyone.
> This is not specifically a TeX on Mac question, so I hope you'll forgive my asking here.  I am, however, using TeX-Live 2009 in Mac OS X 10.6.4 on a MacBook Pro.
> I have a main file "narrowhom.tex" in which I use
> \documentclass[11pt]{amsbook}
> \usepackage[utf8]{inputenc}
> \usepackage[T1]{fontenc}
> [...]
> %\includeonly{ch.numsys}
> %\includeonly{ch.numthry}
> %\includeonly{ch.solveeqn}
> %\includeonly{ch.geom}
> I compile using "latex narrowhom.tex" in X11 and view using xdvi.
> If all the "includeonly" are commented out (like above), compiling does not present any obvious errors.
> If "\includeonly{ch.numthry}" is uncommented, compiling also does not present any obvious errors.
> However, if "\includeonly{ch.numsys}" or "\includeonly{ch.solveeqn}" or "\includeonly{ch.geom}" is uncommented, then I get errors like these:
> ! LaTeX Error: No counter 'a' defined.
> See the LaTeX manual or LaTeX Companion for explanation.
> Type  H <return>  for immediate help.
> ...                                              


Don Green Dragon
fergdc at Shaw.ca

More information about the MacOSX-TeX mailing list