1

I am getting the following error, but cannot figure out the problem yet

! LaTeX Error: No counter 'theorem' defined.

I have

\newtheorem{galex-theorem}{Theorem}[section]
\newtheorem{galex-corollary}{Corollary}[theorem]

which could be problematic, but I cannot see it clearly.

6
  • 1
    What is the last line suppose to mean? Why is there a [theorem] there?
    – daleif
    Sep 27, 2022 at 11:26
  • @daleif: I guess it means corollaries are numbered per theorem.
    – Bernard
    Sep 27, 2022 at 11:49
  • You're naming the environment and the counter galex-theorem.
    – egreg
    Sep 27, 2022 at 12:14
  • I can do numbering per section with \newtheorem{galex-theorem}{Theorem}[section]. I think one can number per theorem but [theorem] is not being recognised. Perhaps a different keyword should be used for such a thing.
    – konmi
    Sep 27, 2022 at 13:44
  • 1
    you could number within theorem but first you need to define theorem, so far you have only defined galex-theorem Sep 27, 2022 at 14:11

1 Answer 1

1

As the error states you have not defined theorem however you have defined galex-thorem so I assume you intended that. (You give no indication of your intended output)

enter image description here

\documentclass{article}

\newtheorem{galex-theorem}{Theorem}[section]
\newtheorem{galex-corollary}{Corollary}[galex-theorem]

\begin{document}

\section{hmmm}

\begin{galex-theorem}
  $1=0$
\end{galex-theorem}
\begin{galex-corollary}
  everything is provable
\end{galex-corollary}


\begin{galex-theorem}
  a new theorem
\end{galex-theorem}
\begin{galex-corollary}
  corollary 1 (again) as reset by galex-theorem
\end{galex-corollary}
\begin{galex-corollary}
  corollary 2 
\end{galex-corollary}


\end{document}
4
  • Correct, I wanted that corollary takes the numbering scheme corresponding to galex-theorem. You got the result I have been working to do.
    – konmi
    Sep 28, 2022 at 15:33
  • Want to ask whether the basic built-in latex has the theorem command with an associated counter. Or there is just \newtheorem where users do construct their own theorem related categorisations?
    – konmi
    Sep 28, 2022 at 15:36
  • you could have just tried \begin{theorem} and seen it is not defined Sep 28, 2022 at 18:00
  • You have been of enormous help to me. I am much more skillful now, and eventually capable of making valuable contributions.
    – konmi
    Sep 28, 2022 at 18:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .